]> granicus.if.org Git - php/commitdiff
Merge the more sensible way of doing this back in to HEAD
authorJames Moore <jmoore@php.net>
Thu, 17 May 2001 23:57:43 +0000 (23:57 +0000)
committerJames Moore <jmoore@php.net>
Thu, 17 May 2001 23:57:43 +0000 (23:57 +0000)
sapi/cgi/getopt.c

index a20341eef253886756b0eed6311ef160784bb63c..120870108a42e393f713f7a02eae816d9b154f1f 100644 (file)
@@ -10,7 +10,6 @@
 #define OPTERRARG (3)
 
 
-char buff[81]; /* too hold option value when needed */
 char *ap_php_optarg;
 int ap_php_optind = 1;
 static int ap_php_opterr = 1;
@@ -110,12 +109,7 @@ int ap_php_getopt(int argc, char* const *argv, const char *optstr)
         }
         else
         {
-            int offset = 2;
-            int len = 0;
-            while(argv[ap_php_optind][offset]) {
-                buff[len++] = argv[ap_php_optind][offset++];
-            }
-            ap_php_optarg = buff;
+            ap_php_optarg = &argv[ap_php_optind][2];
             ap_php_optind++;
         }
         return(*cp);