Allow multipe urls on command line.

NGLayout only.
This commit is contained in:
scullin%netscape.com 1998-07-21 18:44:20 +00:00
parent 24b71cf5f1
commit ff35b2bf20

View File

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -164,24 +164,27 @@ int main(int argc, char **argv)
nsIStreamListener *pConsumer;
nsIURL *pURL;
nsresult result;
int argn, i;
if (argc < 2) {
printf("test: -trace <URL>\n");
return 0;
}
urlLoaded = 0;
// Turn on netlib tracing...
if (PL_strcasecmp(argv[1], "-trace") == 0) {
NET_ToggleTrace();
url_address = argv[2];
argn = 2;
bTraceEnabled = PR_TRUE;
} else {
url_address = argv[1];
argn = 1;
bTraceEnabled = PR_FALSE;
}
for (i = argn; i < argc; i++) {
urlLoaded = 0;
url_address = argv[i];
if (bTraceEnabled) {
url_address.ToCString(buf, 256);
printf("loading URL: %s...\n", buf);
@ -194,6 +197,9 @@ int main(int argc, char **argv)
pURL = NULL;
result = NS_NewURL(&pURL, url_address);
if (NS_OK != result) {
if (bTraceEnabled) {
printf("NS_NewURL() failed...\n");
}
return 1;
}
@ -227,7 +233,7 @@ int main(int argc, char **argv)
}
pURL->Release();
}
return 0;
}