From 4938991ab830435601e5dd4edfe3b188a60269c5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 13 Dec 2002 16:22:57 +0000 Subject: [PATCH] set up arg2 to point to argv[2] to be used at will by programs --- tests/libtest/first.c | 5 +++++ tests/libtest/test.h | 2 ++ 2 files changed, 7 insertions(+) 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 #include +extern char *arg2; /* set by first.c to the argv[2] or NULL */ +