2011-02-02 20:40 Christos Zoulas <christos@zoulas.com>
+ * help and version output to stdout.
+
* When matching softmagic for ascii files, don't just print
the softmagic classification, keep going and print the
text classification too. This fixes broken troff files when
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: file.c,v 1.139 2010/10/08 22:03:57 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.140 2010/11/30 14:58:53 rrt Exp $")
#endif /* lint */
#include "magic.h"
case 'v':
if (magicfile == NULL)
magicfile = magic_getpath(magicfile, action);
- (void)fprintf(stderr, "%s-%d.%.2d\n", progname,
+ (void)fprintf(stdout, "%s-%d.%.2d\n", progname,
FILE_VERSION_MAJOR, patchlevel);
- (void)fprintf(stderr, "magic file from %s\n",
+ (void)fprintf(stdout, "magic file from %s\n",
magicfile);
return 1;
case 'z':
(void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
"Determine type of FILEs.\n"
-"\n", stderr);
+"\n", stdout);
#define OPT(shortname, longname, opt, doc) \
- fprintf(stderr, " -%c, --" longname doc, shortname);
+ fprintf(stdout, " -%c, --" longname doc, shortname);
#define OPT_LONGONLY(longname, opt, doc) \
- fprintf(stderr, " --" longname doc);
+ fprintf(stdout, " --" longname doc);
#include "file_opts.h"
#undef OPT
#undef OPT_LONGONLY