From: Aleš Křenek Date: Tue, 4 Oct 2005 10:33:35 +0000 (+0000) Subject: correct handling of -s X-Git-Tag: gridsite-core_R_1_1_12~28 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=8b6e135ac7c518aeda027aa925b4885f76bc8602;p=jra1mw.git correct handling of -s --- 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;