-#ifdef DONTDEF
- /*
- * Message management.
- *
- * anno writes a message prefix on stream (eg stdout, stderr).
- *
- * The specified prefix is normally output followed by a colon and a space.
- * However, if other command line options are set, more output can come
- * out, such as the record # within the archive.
- *
- * If the specified prefix is NULL, no output is produced unless the
- * command line option(s) are set.
- *
- * If the third argument is 1, the "saved" record # is used; if 0, the
- * "current" record # is used.
- */
- void
- anno (stream, prefix, savedp)
- FILE *stream;
- char *prefix;
- int savedp;
- {
-# define MAXANNO 50
- char buffer[MAXANNO]; /* Holds annorecment */
-# define ANNOWIDTH 13
- int space;
- long offset;
- int save_e;
-
- save_e = errno;
- /* Make sure previous output gets out in sequence */
- if (stream == stderr)
- fflush (stdout);
- if (f_sayblock)
- {
- if (prefix)
- {
- fputs (prefix, stream);
- putc (' ', stream);
- }
- offset = ar_record - ar_block;
- (void) sprintf (buffer, "rec %d: ",
- savedp ? saved_recno :
- baserec + offset);
- fputs (buffer, stream);
- space = ANNOWIDTH - strlen (buffer);
- if (space > 0)
- {
- fprintf (stream, "%*s", space, "");
- }
- }
- else if (prefix)
- {
- fputs (prefix, stream);
- fputs (": ", stream);
- }
- errno = save_e;
- }
-#endif
+ if (!read_file && !info_script_option)
+ /* FIXME: if fopen is used, it will never be closed. */
+ read_file = archive == STDIN_FILENO ? fopen (TTY_NAME, "r") : stdin;