From 160f208469de68937fea2749ec9a8b4fadbe9d38 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 6 Dec 2009 12:59:49 +0000 Subject: [PATCH] Fix issues on Linux and OSX with libraries being located incorrectly --- dtool/src/dtoolutil/executionEnvironment.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index c99420a7ef..69f534b34c 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -486,7 +486,9 @@ read_args() { maps.getline(buffer, PATH_MAX); char *tail = strrchr(buffer,'/'); char *head = strchr(buffer,'/'); - if (tail && head && (strcmp(tail,"/libp3dtool.so")==0)) { + if (tail && head && (strcmp(tail,"/libp3dtool.so." PANDA_VERSION_STR)==0)) { + _dtool_name = head; + } else if (tail && head && (strcmp(tail,"/libp3dtool.so")==0)) { _dtool_name = head; } } @@ -500,7 +502,9 @@ read_args() { for (uint32_t i = 0; i < ic; ++i) { const char *buffer = _dyld_get_image_name(i); const char *tail = strrchr(buffer, '/'); - if (tail && (strcmp(tail,"/libp3dtool.dylib")==0)) { + if (tail && (strcmp(tail,"/libp3dtool." PANDA_VERSION_STR ".dylib")==0)) { + _dtool_name = buffer; + } else if (tail && (strcmp(tail,"/libp3dtool.dylib")==0)) { _dtool_name = buffer; } }