file/file-4.21-option.dif

38 lines
803 B
Plaintext

--- src/file.c
+++ src/file.c 2007-06-06 16:33:10.402651296 +0200
@@ -240,6 +240,8 @@ main(int argc, char *argv[])
flags |= MAGIC_DEBUG|MAGIC_CHECK;
break;
case 'e':
+ if (!optarg)
+ usage();
for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++)
if (strcmp(nv[i].name, optarg) == 0)
break;
@@ -251,13 +253,15 @@ main(int argc, char *argv[])
break;
case 'f':
- if(action)
+ if(action || !optarg)
usage();
load(magicfile, flags);
unwrap(optarg);
++didsomefiles;
break;
case 'F':
+ if (!optarg)
+ usage();
separator = optarg;
break;
case 'i':
@@ -267,6 +271,8 @@ main(int argc, char *argv[])
flags |= MAGIC_CONTINUE;
break;
case 'm':
+ if (!optarg)
+ usage();
magicfile = optarg;
break;
case 'n':