Better URL fix

This commit is contained in:
rdb 2009-07-22 12:27:46 +00:00
parent a307a23b41
commit 641449a813
1 changed files with 5 additions and 6 deletions

View File

@ -69,9 +69,6 @@ run(int argc, char *argv[]) {
switch (flag) {
case 'u':
root_url = optarg;
if (!root_url.empty() && root_url[root_url.length() - 1] != '/') {
root_url += '/';
}
break;
case 'p':
@ -132,6 +129,11 @@ run(int argc, char *argv[]) {
return 1;
}
// Make sure it ends with a slash.
if (!root_url.empty() && root_url[root_url.length() - 1] != '/') {
root_url += '/';
}
if (!get_plugin(root_url, this_platform, force_download)) {
cerr << "Unable to load Panda3D plugin.\n";
return 1;
@ -292,9 +294,6 @@ get_plugin(const string &root_url, const string &this_platform, bool force_downl
// Couldn't read it, so go get it.
string url = root_url;
if (url.size() > 0 && url[url.size()-1] != '/') {
url += "/";
}
url += "contents.xml";
cerr << "Getting URL " << url << "\n";