aboutsummaryrefslogtreecommitdiffstats
path: root/main/xulrunner/fix-xulrunner-launcher.patch
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2011-01-25 21:00:27 -0600
committerWilliam Pitcock <nenolod@dereferenced.org>2011-01-25 21:00:27 -0600
commitdcc39ed47e2a83ae916eaa5f9c374c99a11b5d2a (patch)
treeb0c150edc7f7d98a668ef41794e80cef4f941113 /main/xulrunner/fix-xulrunner-launcher.patch
parentdaf268baf10f53258168866f3d169dadf7e3740d (diff)
downloadaports-dcc39ed47e2a83ae916eaa5f9c374c99a11b5d2a.tar.bz2
aports-dcc39ed47e2a83ae916eaa5f9c374c99a11b5d2a.tar.xz
testing/xulrunner: promote to main
Diffstat (limited to 'main/xulrunner/fix-xulrunner-launcher.patch')
-rw-r--r--main/xulrunner/fix-xulrunner-launcher.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/main/xulrunner/fix-xulrunner-launcher.patch b/main/xulrunner/fix-xulrunner-launcher.patch
new file mode 100644
index 0000000000..62af1ab308
--- /dev/null
+++ b/main/xulrunner/fix-xulrunner-launcher.patch
@@ -0,0 +1,23 @@
+--- a/xulrunner/stub/nsXULStub.cpp 2008-07-17 21:43:11.000000000 +0200
++++ b/xulrunner/stub/nsXULStub.cpp 2008-07-17 21:47:04.000000000 +0200
+@@ -208,8 +208,10 @@
+ // 3) give up
+
+ struct stat fileStat;
++ char *testp;
+
+- if (!realpath(argv[0], iniPath) || stat(iniPath, &fileStat)) {
++ testp = realpath(argv[0], iniPath);
++ if (!(testp != NULL && stat(iniPath, &fileStat) == 0 && S_ISREG(fileStat.st_mode) && fileStat.st_mode & S_IXUSR) || (testp != NULL && stat(iniPath, &fileStat))) {
+ const char *path = getenv("PATH");
+ if (!path)
+ return 1;
+@@ -222,7 +224,7 @@
+ char *token = strtok(pathdup, ":");
+ while (token) {
+ sprintf(tmpPath, "%s/%s", token, argv[0]);
+- if (realpath(tmpPath, iniPath) && stat(iniPath, &fileStat) == 0) {
++ if (realpath(tmpPath, iniPath) && stat(iniPath, &fileStat) == 0 && S_ISREG(fileStat.st_mode) && fileStat.st_mode & S_IXUSR) {
+ found = PR_TRUE;
+ break;
+ }