]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/cmndline.cc
* apt-pkg/contrib/cmdline.cc:
[apt.git] / apt-pkg / contrib / cmndline.cc
index 159f330a182488d35cf9a930f265e5def324a82e..b8c7f79848de41d4f4779b216b326fe67bd610b3 100644 (file)
@@ -92,8 +92,9 @@ bool CommandLine::Parse(int argc,const char **argv)
       // Match up to a = against the list
       Args *A;
       const char *OptEnd = strchrnul(Opt, '=');
-      for (A = ArgList; A->end() == false && 
-          stringcasecmp(Opt,OptEnd,A->LongOpt) != 0; A++);
+      for (A = ArgList; A->end() == false &&
+          (A->LongOpt == 0 || stringcasecmp(Opt,OptEnd,A->LongOpt) != 0);
+          ++A);
       
       // Failed, look for a word after the first - (no-foo)
       bool PreceedMatch = false;