nsLocalFileWin::IsExecutable needs to trim trailing dots. Fixes bug 267828. r=dbaron, a=dveditz

git-svn-id: svn://10.0.0.236/trunk@169126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%meer.net
2005-02-11 22:11:45 +00:00
parent f6ab3edfff
commit 7430419967

View File

@@ -930,7 +930,14 @@ nsLocalFile::Normalize()
// add the current component to the path, including the preceding backslash
normal.Append(pathBuffer + begin - 1, len + 1);
}
// kill trailing dots and spaces.
PRInt32 filePathLen = normal.Length() - 1;
while(filePathLen > 0 && (normal[filePathLen] == ' ' || normal[filePathLen] == '.'))
{
normal.Truncate(filePathLen--);
}
NS_CopyUnicodeToNative(normal, mWorkingPath);
MakeDirty();
#else // WINCE
@@ -1863,6 +1870,8 @@ nsLocalFile::IsExecutable(PRBool *_retval)
nsresult rv;
Normalize();
// only files can be executables
PRBool isFile;
rv = IsFile(&isFile);