Bug 118203 - nsLocalFile implementation for Mach-0. r=pinkerton, sdagley/sr=sfraser

git-svn-id: svn://10.0.0.236/trunk@130418 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ccarlen%netscape.com
2002-09-25 12:23:39 +00:00
parent 3632df380f
commit 4ea79344a0
15 changed files with 550 additions and 156 deletions

View File

@@ -56,7 +56,7 @@ void NS_ShutdownLocalFile()
nsLocalFile::GlobalShutdown();
}
#if !defined(XP_MAC)
#if !defined(XP_MAC) && !defined(XP_MACOSX)
NS_IMETHODIMP
nsLocalFile::InitWithFile(nsILocalFile *aFile)
{
@@ -70,8 +70,11 @@ nsLocalFile::InitWithFile(nsILocalFile *aFile)
}
#endif
// should work on Macintosh, Unix, and Win32.
#define kMaxFilenameLength 31
#if defined(XP_MAC)
#define kMaxFilenameLength 31
#else
#define kMaxFilenameLength 255
#endif
NS_IMETHODIMP
nsLocalFile::CreateUnique(PRUint32 type, PRUint32 attributes)
@@ -95,8 +98,7 @@ nsLocalFile::CreateUnique(PRUint32 type, PRUint32 attributes)
leafName.SetLength(lastDot - leafName.get()); // strip suffix and dot.
}
// 27 should work on Macintosh, Unix, and Win32.
const int maxRootLength = 27 - strlen(suffix) - 1;
const int maxRootLength = (kMaxFilenameLength - 4) - strlen(suffix) - 1;
if ((int)leafName.Length() > (int)maxRootLength)
leafName.SetLength(maxRootLength);