diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-12-13 16:22:57 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-12-13 16:22:57 +0000 |
commit | 4938991ab830435601e5dd4edfe3b188a60269c5 (patch) | |
tree | 13ec92c0b8cb6ea3b442517fee9a882dd9dbaee7 /tests | |
parent | 13722f536e5e7116f5ccbf625746366e74eda7a5 (diff) |
set up arg2 to point to argv[2] to be used at will by programs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libtest/first.c | 5 | ||||
-rw-r--r-- | tests/libtest/test.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 4f42136a0..528f1785c 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -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); diff --git a/tests/libtest/test.h b/tests/libtest/test.h index d9fbef311..a0d430842 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -1,3 +1,5 @@ #include <curl.h> #include <stdio.h> +extern char *arg2; /* set by first.c to the argv[2] or NULL */ + |