From 0db5c92501fe27b72265d5b0dfad9056d05af8bb Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Wed, 10 May 2000 23:41:33 +0000 Subject: [PATCH] fix for unix filepicker not coming up correctly (bug #38810) git-svn-id: svn://10.0.0.236/trunk@69096 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileUnix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 8ae810cd8b5..f2161a29b20 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -271,8 +271,10 @@ nsLocalFile::InitWithPath(const char *filePath) int len = strlen(filePath); char* name = (char*) nsAllocator::Clone( filePath, len+1 ); - if(name[len-1] == '/') - name[len-1] = '\0'; + if (name[len-1] == '/') { + if (len != 1) + name[len-1] = '\0'; + } mPath = name;