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:
dougt%meer.net
2005-02-11 23:13:38 +00:00
parent 3ba6a95057
commit 830c305229

View File

@@ -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 ) {