]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
BSD getopt fix
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 9 Oct 2004 16:44:06 +0000 (16:44 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 9 Oct 2004 16:44:06 +0000 (16:44 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1103 c046a42c-6fe2-441c-8c8c-71466251a162

qemu-img.c

index 196e0287f2dbb4c0f767bc1fd5b7307e95d24a67..132428cf6dd29e720851e7c5631217f7a71ea131 100644 (file)
@@ -333,7 +333,6 @@ static int img_create(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -403,7 +402,6 @@ static int img_commit(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -511,7 +509,6 @@ static int img_convert(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -639,7 +636,6 @@ static int img_info(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -686,6 +682,7 @@ int main(int argc, char **argv)
     if (argc < 2)
         help();
     cmd = argv[1];
+    optind++;
     if (!strcmp(cmd, "create")) {
         img_create(argc, argv);
     } else if (!strcmp(cmd, "commit")) {