updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / firefox3-pgo / fix-mozilla-launcher.patch
blobde64e4cee23756d1cdd7f5c16aa3e04eac53f415
1 --- xulrunner/stub/nsXULStub.cpp 2008-07-17 21:43:11.000000000 +0200
2 +++ xulrunner/stub/nsXULStub.cpp 2008-07-17 21:47:04.000000000 +0200
3 @@ -208,8 +208,10 @@
4 // 3) give up
6 struct stat fileStat;
7 + char *testp;
9 - if (!realpath(argv[0], iniPath) || stat(iniPath, &fileStat)) {
10 + testp = realpath(argv[0], iniPath);
11 + if (!(testp != NULL && stat(iniPath, &fileStat) == 0 && S_ISREG(fileStat.st_mode) && fileStat.st_mode & S_IXUSR) || (testp != NULL && stat(iniPath, &fileStat))) {
12 const char *path = getenv("PATH");
13 if (!path)
14 return 1;
15 @@ -222,7 +224,7 @@
16 char *token = strtok(pathdup, ":");
17 while (token) {
18 sprintf(tmpPath, "%s/%s", token, argv[0]);
19 - if (realpath(tmpPath, iniPath) && stat(iniPath, &fileStat) == 0) {
20 + if (realpath(tmpPath, iniPath) && stat(iniPath, &fileStat) == 0 && S_ISREG(fileStat.st_mode) && fileStat.st_mode & S_IXUSR) {
21 found = PR_TRUE;
22 break;