From b1feb3df5ee9fe43899df291bfa49b4fa08ec84f Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Fri, 11 Feb 2005 23:11:03 +0000 Subject: [PATCH] nsLocalFileWin::IsExecutable needs to trim trailing dots. Fixes bug 267828. r=dbaron, a=dveditz git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_1_20050124_BRANCH@169131 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileWin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index 7ce2103fe42..ed060642932 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -1845,6 +1845,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 = ::strrchr( path.BeginWriting(), '.' ); if ( ext ) {