Dirk Mueller
44bc099863
- Refresh patches and remove the visibility patch that I upstreamed few releases ago in a different form. OBS-URL: https://build.opensuse.org/request/show/161841 OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=75
58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
Index: src/file.c
|
|
===================================================================
|
|
--- src/file.c.orig
|
|
+++ src/file.c
|
|
@@ -94,10 +94,12 @@ private const char *separator = ":"; /*
|
|
private const struct option long_options[] = {
|
|
#define OPT(shortname, longname, opt, doc) \
|
|
{longname, opt, NULL, shortname},
|
|
+#define OPT_POSIX OPT
|
|
#define OPT_LONGONLY(longname, opt, doc) \
|
|
{longname, opt, NULL, 0},
|
|
#include "file_opts.h"
|
|
#undef OPT
|
|
+#undef OPT_POSIX
|
|
#undef OPT_LONGONLY
|
|
{0, 0, NULL, 0}
|
|
};
|
|
@@ -522,6 +524,7 @@ docprint(const char *opts)
|
|
private void
|
|
help(void)
|
|
{
|
|
+ const unsigned long posix = (unsigned long)getenv("POSIXLY_CORRECT");
|
|
(void)fputs(
|
|
"Usage: file [OPTION...] [FILE...]\n"
|
|
"Determine type of FILEs.\n"
|
|
@@ -529,11 +532,16 @@ help(void)
|
|
#define OPT(shortname, longname, opt, doc) \
|
|
fprintf(stdout, " -%c, --" longname, shortname), \
|
|
docprint(doc);
|
|
+#define OPT_POSIX(shortname, longname, opt, doc) \
|
|
+ fprintf(stdout, " -%c, --" longname "%s", shortname, \
|
|
+ (shortname == 'L') ? (posix ? " (default)" : "") : (posix ? "" : " (default)")), \
|
|
+ docprint(doc);
|
|
#define OPT_LONGONLY(longname, opt, doc) \
|
|
fprintf(stdout, " --" longname), \
|
|
docprint(doc);
|
|
#include "file_opts.h"
|
|
#undef OPT
|
|
+#undef OPT_POSIX
|
|
#undef OPT_LONGONLY
|
|
fprintf(stdout, "\nReport bugs to http://bugs.gw.com/\n");
|
|
exit(0);
|
|
Index: src/file_opts.h
|
|
===================================================================
|
|
--- src/file_opts.h.orig
|
|
+++ src/file_opts.h
|
|
@@ -34,8 +34,8 @@ OPT_LONGONLY("mime-encoding", 0, "
|
|
OPT('k', "keep-going", 0, " don't stop at the first match\n")
|
|
#ifdef S_IFLNK
|
|
OPT('l', "list", 0, " list magic strength\n")
|
|
-OPT('L', "dereference", 0, " follow symlinks (default)\n")
|
|
-OPT('h', "no-dereference", 0, " don't follow symlinks\n")
|
|
+OPT_POSIX('L', "dereference", 0, " follow symlinks\n")
|
|
+OPT_POSIX('h', "no-dereference", 0, " don't follow symlinks\n")
|
|
#endif
|
|
OPT('n', "no-buffer", 0, " do not buffer output\n")
|
|
OPT('N', "no-pad", 0, " do not pad output\n")
|