]> granicus.if.org Git - curl/commitdiff
set up arg2 to point to argv[2] to be used at will by programs
authorDaniel Stenberg <daniel@haxx.se>
Fri, 13 Dec 2002 16:22:57 +0000 (16:22 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Dec 2002 16:22:57 +0000 (16:22 +0000)
tests/libtest/first.c
tests/libtest/test.h

index 4f42136a0328f5052ef3da993e5d0d77bde82bda..528f1785c1fe07654994c28e00c003e994d979c8 100644 (file)
@@ -8,6 +8,8 @@ extern void curl_memdebug(const char *);
 /* test is provided in the test code file */
 CURLcode test(char *url);
 
+char *arg2=NULL;
+
 int main(int argc, char **argv)
 {
   char *URL;
@@ -15,6 +17,9 @@ int main(int argc, char **argv)
     fprintf(stderr, "Pass URL as argument please\n");
     return 1;
   }
+  if(argc>2)
+    arg2=argv[2];
+
   URL = argv[1]; /* provide this to the rest */
 
   fprintf(stderr, "URL: %s\n", URL);
index d9fbef31112d650c64b9080b4b6cde423414633f..a0d430842965b4f223a8c1804a05bf083d67495b 100644 (file)
@@ -1,3 +1,5 @@
 #include <curl.h>
 #include <stdio.h>
 
+extern char *arg2; /* set by first.c to the argv[2] or NULL */
+