OSDN Git Service

CLI: remove 'L' from short opts so that getopt_long properly flags it as an invalid...
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 5 Jun 2010 16:34:32 +0000 (16:34 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 5 Jun 2010 16:34:32 +0000 (16:34 +0000)
I forgot to remove this short option when the --longest was removed.
Also fix the default case of the switch to print the option that failed
rather than the next option.

git-svn-id: svn://localhost/HandBrake/trunk@3357 b64f7644-9d1e-0410-96f1-a4d463321fa5

test/test.c

index 9d624b9..fb26df9 100644 (file)
@@ -2641,9 +2641,12 @@ static int ParseOptions( int argc, char ** argv )
 
         int option_index = 0;
         int c;
+        int cur_optind;
 
-               c = getopt_long( argc, argv,
-                                                "hv::uC:f:4i:Io:t:Lc:m::M:a:A:6:s:UF::N:e:E:2dD:7895gOw:l:n:b:q:S:B:r:R:x:TY:X:Z:z",
+        cur_optind = optind;
+        c = getopt_long( argc, argv,
+                         "hv::uC:f:4i:Io:t:c:m::M:a:A:6:s:UF::N:e:E:"
+                         "2dD:7895gOw:l:n:b:q:S:B:r:R:x:TY:X:Z:z",
                          long_options, &option_index );
         if( c < 0 )
         {
@@ -3099,7 +3102,7 @@ static int ParseOptions( int argc, char ** argv )
                     color_matrix = 2;
                 break;
             default:
-                fprintf( stderr, "unknown option (%s)\n", argv[optind] );
+                fprintf( stderr, "unknown option (%s)\n", argv[cur_optind] );
                 return -1;
         }
     }