mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1079655: Do not sanitize the path used to load XPCOM if the path couldn't
be retrieved successfully on OSX. r=spohl
This commit is contained in:
parent
1db5266dde
commit
e22e48bca9
@ -59,25 +59,25 @@ private:
|
||||
nsresult rv;
|
||||
if (CFURLGetFileSystemRepresentation(executableURL, false, (UInt8*)aResult,
|
||||
MAXPATHLEN)) {
|
||||
// Sanitize path in case the app was launched from Terminal via
|
||||
// './firefox' for example.
|
||||
size_t readPos = 0;
|
||||
size_t writePos = 0;
|
||||
while (aResult[readPos] != '\0') {
|
||||
if (aResult[readPos] == '.' && aResult[readPos + 1] == '/') {
|
||||
readPos += 2;
|
||||
} else {
|
||||
aResult[writePos] = aResult[readPos];
|
||||
readPos++;
|
||||
writePos++;
|
||||
}
|
||||
}
|
||||
aResult[writePos] = '\0';
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Sanitize path in case the app was launched from Terminal via './firefox'
|
||||
// for example.
|
||||
size_t readPos = 0;
|
||||
size_t writePos = 0;
|
||||
while (aResult[readPos] != '\0') {
|
||||
if (aResult[readPos] == '.' && aResult[readPos + 1] == '/') {
|
||||
readPos += 2;
|
||||
}
|
||||
aResult[writePos] = aResult[readPos];
|
||||
readPos++;
|
||||
writePos++;
|
||||
}
|
||||
aResult[writePos] = '\0';
|
||||
|
||||
CFRelease(executableURL);
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user