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

This commit is contained in:
dougt%meer.net 2005-02-11 22:11:45 +00:00
parent af85c463a4
commit a5553f58a0

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);