diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index ebe9cd273f6..6c23cc3e4e7 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -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);