Changeset 28877 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Apr 28, 2010 7:10:47 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp
r28849 r28877 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Path Convertions, generic. 3 * IPRT - Path Convertions, Darwin. 4 * 5 * On darwin path names on the disk are decomposed using normalization 6 * form D (NFD). Since this behavior is unique for the Mac, we will precompose 7 * the path name strings we get from the XNU kernel. 4 8 */ 5 9 6 10 /* 7 * Copyright (C) 2006-20 07Oracle Corporation11 * Copyright (C) 2006-2010 Oracle Corporation 8 12 * 9 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 38 42 int rtPathToNative(char **ppszNativePath, const char *pszPath) 39 43 { 40 return RTStrUtf8ToCurrentCP(ppszNativePath, pszPath); 44 /** @todo We should decompose the string here, but the file system will do 45 * that for us if we don't, so why bother. */ 46 *ppszNativePath = (char *)pszPath; 47 return VINF_SUCCESS; 41 48 } 49 42 50 43 51 int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath) 44 52 { 45 53 NOREF(pszBasePath); 46 return RTStrUtf8ToCurrentCP(ppszNativePath, pszPath);54 return rtPathToNative(ppszNativePath, pszPath); 47 55 } 48 56 49 void rtPathFreeNative(char *pszNativePath) 57 58 void rtPathFreeNative(char *pszNativePath, const char *pszPath) 50 59 { 51 if (pszNativePath) 52 RTStrFree(pszNativePath); 60 Assert((const char *)pszNativePath == pszPath || !pszNativePath); 61 NOREF(pszNativePath); 62 NOREF(pszPath); 53 63 } 54 64 … … 56 66 int rtPathFromNative(char **pszPath, const char *pszNativePath) 57 67 { 58 return RTStrCurrentCPToUtf8(pszPath, pszNativePath); 68 /** @todo We must compose the codepoints in the string here. We get file names 69 * in normalization form D so we'll end up with normalization form C 70 * whatever approach we take. */ 71 return RTStrDupEx(ppszPath, pszNativePath); 59 72 } 60 73 … … 63 76 { 64 77 NOREF(pszBasePath); 65 return RTStrCurrentCPToUtf8(pszPath, pszNativePath);78 return rtPathFromNative(ppszPath, pszNativePath); 66 79 } 67 80 -
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r28800 r28877 70 70 && S_ISDIR(s.st_mode); 71 71 72 rtPathFreeNative(pszNativePath );72 rtPathFreeNative(pszNativePath, pszPath); 73 73 } 74 74 … … 110 110 } 111 111 112 rtPathFreeNative(pszNativePath );112 rtPathFreeNative(pszNativePath, pszPath); 113 113 } 114 114 else … … 131 131 rc = RTErrConvertFromErrno(errno); 132 132 133 rtPathFreeNative(pszNativePath );133 rtPathFreeNative(pszNativePath, pszPath); 134 134 } 135 135 … … 196 196 rc = RTErrConvertFromErrno(errno); 197 197 198 rtPathFreeNative(pszNativePath );198 rtPathFreeNative(pszNativePath, pDir->pszPath); 199 199 } 200 200 -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r28800 r28877 100 100 && S_ISREG(s.st_mode); 101 101 102 rtPathFreeNative(pszNativePath );102 rtPathFreeNative(pszNativePath, pszPath); 103 103 } 104 104 … … 212 212 int fh = open(pszNativeFilename, fOpenMode, fMode); 213 213 int iErr = errno; 214 rtPathFreeNative(pszNativeFilename );214 rtPathFreeNative(pszNativeFilename, pszFilename); 215 215 #endif 216 216 if (fh >= 0) … … 378 378 if (unlink(pszNativeFilename) != 0) 379 379 rc = RTErrConvertFromErrno(errno); 380 rtPathFreeNative(pszNativeFilename );380 rtPathFreeNative(pszNativeFilename, pszFilename); 381 381 } 382 382 return rc; -
trunk/src/VBox/Runtime/r3/posix/fs-posix.cpp
r28800 r28877 81 81 else 82 82 rc = RTErrConvertFromErrno(errno); 83 rtPathFreeNative(pszNativeFsPath );83 rtPathFreeNative(pszNativeFsPath, pszFsPath); 84 84 } 85 85 … … 115 115 else 116 116 rc = RTErrConvertFromErrno(errno); 117 rtPathFreeNative(pszNativeFsPath );117 rtPathFreeNative(pszNativeFsPath, pszFsPath); 118 118 } 119 119 LogFlow(("RTFsQuerySerial(%p:{%s}, %p:{%RX32}: returns %Rrc\n", … … 155 155 else 156 156 rc = RTErrConvertFromErrno(errno); 157 rtPathFreeNative(pszNativeFsPath );157 rtPathFreeNative(pszNativeFsPath, pszFsPath); 158 158 } 159 159 -
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r28800 r28877 512 512 else 513 513 rc = RTErrConvertFromErrno(errno); 514 rtPathFreeNative(pszNativePath );514 rtPathFreeNative(pszNativePath, pszPath); 515 515 } 516 516 … … 615 615 } 616 616 } 617 rtPathFreeNative(pszNativePath );617 rtPathFreeNative(pszNativePath, pszPath); 618 618 } 619 619 … … 789 789 pszSrc, pszDst, fRename, fFileType, rc, errno)); 790 790 791 rtPathFreeNative(pszNativeDst );791 rtPathFreeNative(pszNativeDst, pszDst); 792 792 } 793 rtPathFreeNative(pszNativeSrc );793 rtPathFreeNative(pszNativeSrc, pszSrc); 794 794 } 795 795 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.