2007-05-17 11:31:52 +02:00
|
|
|
--- src/file.c
|
2009-05-06 18:38:39 +02:00
|
|
|
+++ src/file.c 2009-05-05 14:05:15.133901855 +0200
|
|
|
|
@@ -214,6 +214,8 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
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;
|
2009-05-06 18:38:39 +02:00
|
|
|
@@ -225,7 +227,7 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
break;
|
2009-05-06 18:38:39 +02:00
|
|
|
|
2007-05-17 11:31:52 +02:00
|
|
|
case 'f':
|
|
|
|
- if(action)
|
|
|
|
+ if(action || !optarg)
|
|
|
|
usage();
|
2009-05-06 18:38:39 +02:00
|
|
|
if (magic == NULL)
|
|
|
|
if ((magic = load(magicfile, flags)) == NULL)
|
|
|
|
@@ -234,6 +236,8 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
++didsomefiles;
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
+ if (!optarg)
|
|
|
|
+ usage();
|
|
|
|
separator = optarg;
|
|
|
|
break;
|
|
|
|
case 'i':
|
2009-05-06 18:38:39 +02:00
|
|
|
@@ -243,6 +247,8 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
flags |= MAGIC_CONTINUE;
|
|
|
|
break;
|
|
|
|
case 'm':
|
|
|
|
+ if (!optarg)
|
|
|
|
+ usage();
|
|
|
|
magicfile = optarg;
|
|
|
|
break;
|
|
|
|
case 'n':
|