nsLocalFileWin::IsExecutable needs to trim trailing dots. After talking with dbaron, we agreeded that we shouldn't mutate the object. r=dbaron, a=dveditz
git-svn-id: svn://10.0.0.236/trunk@169132 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1870,8 +1870,6 @@ nsLocalFile::IsExecutable(PRBool *_retval)
|
||||
|
||||
nsresult rv;
|
||||
|
||||
Normalize();
|
||||
|
||||
// only files can be executables
|
||||
PRBool isFile;
|
||||
rv = IsFile(&isFile);
|
||||
@@ -1892,6 +1890,13 @@ nsLocalFile::IsExecutable(PRBool *_retval)
|
||||
else
|
||||
GetNativePath(path);
|
||||
|
||||
// kill trailing dots and spaces.
|
||||
PRInt32 filePathLen = path.Length() - 1;
|
||||
while(filePathLen > 0 && (path[filePathLen] == ' ' || path[filePathLen] == '.'))
|
||||
{
|
||||
path.Truncate(filePathLen--);
|
||||
}
|
||||
|
||||
// Get extension.
|
||||
char * ext = (char *) _mbsrchr((unsigned char *)path.BeginWriting(), '.');
|
||||
if ( ext ) {
|
||||
|
||||
Reference in New Issue
Block a user