SHA256
1
0
forked from pool/file
file/file-5.17-option.dif
Dirk Mueller 2f9edeb10a - update to 5.43:
* Add octal indirect magic
  * avoid infinite loop in non-wide code 
  * Obey MAGIC_CONTINUE with multiple magic files
  * Fix bug with large flist
  * PR/364: Detect non-nul-terminated core filenames from QEMU
  * PR/359: Add support for http://ndjson.org/ 
  * PR/362: Fix wide printing 
  * PR/358: Fix width for -f -
- drop file-boo1201350.patch (upstream)

OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=254
2022-09-13 20:12:04 +00:00

41 lines
993 B
Plaintext

Index: file-5.43/src/file.c
===================================================================
--- file-5.43.orig/src/file.c
+++ file-5.43/src/file.c
@@ -260,6 +260,8 @@ main(int argc, char *argv[])
break;
case 'e':
case OPT_EXCLUDE_QUIET:
+ if (!optarg)
+ usage();
for (i = 0; i < __arraycount(nv); i++)
if (strcmp(nv[i].name, optarg) == 0)
break;
@@ -272,7 +274,7 @@ main(int argc, char *argv[])
break;
case 'f':
- if(action)
+ if(action || !optarg)
usage();
if (magic == NULL)
if ((magic = load(magicfile, flags)) == NULL)
@@ -282,6 +284,8 @@ main(int argc, char *argv[])
++didsomefiles;
break;
case 'F':
+ if(!optarg)
+ usage();
separator = optarg;
break;
case 'i':
@@ -294,6 +298,8 @@ main(int argc, char *argv[])
action = FILE_LIST;
break;
case 'm':
+ if(!optarg)
+ usage();
magicfile = optarg;
break;
case 'n':