From 8b6e135ac7c518aeda027aa925b4885f76bc8602 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 4 Oct 2005 10:33:35 +0000 Subject: [PATCH] correct handling of -s --- org.glite.jp.primary/examples/jpps-test.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.glite.jp.primary/examples/jpps-test.c b/org.glite.jp.primary/examples/jpps-test.c index 79f31fb..022842b 100644 --- a/org.glite.jp.primary/examples/jpps-test.c +++ b/org.glite.jp.primary/examples/jpps-test.c @@ -109,7 +109,7 @@ static const char *orig2str(enum jptype__attrOrig orig) int main(int argc,char *argv[]) { - char *server = "http://localhost:8901"; + char *server = NULL; int opt; struct soap *soap = soap_new(); @@ -122,11 +122,16 @@ int main(int argc,char *argv[]) while ((opt = getopt(argc,argv,"s:")) >= 0) switch (opt) { case 's': server = optarg; - argv += 2; break; case '?': usage(argv[0]); } + if (server) { + argv += 2; + argc -= 2; + } + else server = "http://localhost:8901"; + if (!strcasecmp(argv[1],"RegisterJob")) { struct _jpelem__RegisterJob in; struct _jpelem__RegisterJobResponse empty; -- 1.8.2.3