From 641449a813b2dfd8231cfa4bb5c7408a213550b6 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jul 2009 12:27:46 +0000 Subject: [PATCH] Better URL fix --- direct/src/plugin_standalone/panda3d.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/direct/src/plugin_standalone/panda3d.cxx b/direct/src/plugin_standalone/panda3d.cxx index c51c1133d7..270e5ec054 100644 --- a/direct/src/plugin_standalone/panda3d.cxx +++ b/direct/src/plugin_standalone/panda3d.cxx @@ -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";