Pārlūkot izejas kodu

Issue `no input files` also with options set

Matthias Vogelgesang 12 gadi atpakaļ
vecāks
revīzija
c0a871d98d
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      test/ipedec.c

+ 5 - 5
test/ipedec.c

@@ -208,11 +208,6 @@ int main(int argc, char const* argv[])
     int verbose = 0;
     int rows = 1088;
 
-    if (argc == 1) {
-        printf("ipedec: no input files\n");
-        return 0;
-    }
-
     while ((getopt_ret = getopt_long(argc, (char *const *) argv, "r:cvh", long_options, &index)) != -1) {
         switch (getopt_ret) {
             case 'r': 
@@ -232,6 +227,11 @@ int main(int argc, char const* argv[])
         } 
     }
 
+    if (optind == argc) {
+        printf("ipedec: no input files\n");
+        return 1;
+    }
+
     while (optind < argc)
         process_file(argv[optind++], rows, clear_frame, verbose);