Changeset 5692 in vbox
- Timestamp:
- Nov 11, 2007 5:41:29 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 26038
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileOSX.cpp
r2409 r5692 1185 1185 1186 1186 nsLocalFile* inLF = 1187 NS_STATIC_CAST(nsLocalFile*,(nsILocalFileMac*) inMacFile);1187 static_cast<nsLocalFile*>((nsILocalFileMac*) inMacFile); 1188 1188 1189 1189 // If both exist, compare FSRefs … … 1256 1256 CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseRef); 1257 1257 if (parentURLRef) { 1258 // If the parent path is longer than file's path then 1259 // CFURLCreateCopyDeletingLastPathComponent must have simply added 1260 // two dots at the end - in this case indicate that there is no parent. 1261 // See bug 332389. 1262 CFStringRef path = ::CFURLGetString(mBaseRef); 1263 CFStringRef newPath = ::CFURLGetString(parentURLRef); 1264 if (::CFStringGetLength(newPath) < ::CFStringGetLength(path)) { 1258 1265 rv = NS_ERROR_FAILURE; 1259 1266 newFile = new nsLocalFile; … … 1264 1271 rv = NS_OK; 1265 1272 } 1273 } 1266 1274 } 1267 1275 ::CFRelease(parentURLRef); … … 1594 1602 AliasRecord aliasHeader = *(AliasPtr)decodedData; 1595 1603 PRInt32 aliasSize = GetAliasSizeFromRecord(aliasHeader); 1596 if (aliasSize > ( dataSize * 3) / 4) { // be paranoid about having too few data1604 if (aliasSize > ((PRInt32)dataSize * 3) / 4) { // be paranoid about having too few data 1597 1605 PR_Free(decodedData); 1598 1606 return NS_ERROR_FAILURE; … … 1601 1609 // Move the now-decoded data into the Handle. 1602 1610 // The size of the decoded data is 3/4 the size of the encoded data. See plbase64.h 1603 Handle 1611 Handle newHandle = nsnull; 1604 1612 if (::PtrToHand(decodedData, &newHandle, aliasSize) != noErr) 1605 1613 rv = NS_ERROR_OUT_OF_MEMORY; … … 2276 2284 #if 0 /* bird: too new? */ 2277 2285 aOutStr.SetLength(usedBufLen); 2278 if (aOutStr.Length() != usedBufLen)2286 if (aOutStr.Length() != (unsigned int)usedBufLen) 2279 2287 return NS_ERROR_OUT_OF_MEMORY; 2280 2288 UInt8 *buffer = (UInt8*) aOutStr.BeginWriting(); … … 2311 2319 nsCAutoString path; 2312 2320 CFStringReftoUTF8(pathStrRef, path); 2321 ::CFRelease(pathStrRef); 2313 2322 *aResult = HashString(path); 2314 2323 return NS_OK; … … 2405 2414 2406 2415 case fnfErr: 2416 case afpObjectNotFound: 2417 case afpDirNotFound: 2407 2418 outErr = NS_ERROR_FILE_NOT_FOUND; 2408 2419 break; 2409 2420 2410 2421 case dupFNErr: 2422 case afpObjectExists: 2411 2423 outErr = NS_ERROR_FILE_ALREADY_EXISTS; 2412 2424 break; 2413 2425 2414 2426 case dskFulErr: 2427 case afpDiskFull: 2415 2428 outErr = NS_ERROR_FILE_DISK_FULL; 2416 2429 break; 2417 2430 2418 2431 case fLckdErr: 2432 case afpVolLocked: 2419 2433 outErr = NS_ERROR_FILE_IS_LOCKED; 2434 break; 2435 2436 case afpAccessDenied: 2437 outErr = NS_ERROR_FILE_ACCESS_DENIED; 2438 break; 2439 2440 case afpDirNotEmpty: 2441 outErr = NS_ERROR_FILE_DIR_NOT_EMPTY; 2420 2442 break; 2421 2443
Note:
See TracChangeset
for help on using the changeset viewer.