Changeset 28915 in vbox for trunk/src/VBox/Runtime/r3/darwin
- Timestamp:
- Apr 29, 2010 6:12:35 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60863
- Location:
- trunk/src/VBox/Runtime/r3/darwin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp
r28880 r28915 41 41 42 42 43 int rtPathToNative(c har **ppszNativePath, const char *pszPath)43 int rtPathToNative(const char **ppszNativePath, const char *pszPath, const char *pszBasePath) 44 44 { 45 45 /** @todo We should decompose the string here, but the file system will do 46 46 * that for us if we don't, so why bother. */ 47 47 *ppszNativePath = (char *)pszPath; 48 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 48 49 return VINF_SUCCESS; 49 50 } 50 51 51 52 52 int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath)53 void rtPathFreeNative(char const *pszNativePath, const char *pszPath) 53 54 { 54 NOREF(pszBasePath); 55 return rtPathToNative(ppszNativePath, pszPath); 56 } 57 58 59 void rtPathFreeNative(char *pszNativePath, const char *pszPath) 60 { 61 Assert((const char *)pszNativePath == pszPath || !pszNativePath); 55 Assert(pszNativePath == pszPath || !pszNativePath); 62 56 NOREF(pszNativePath); 63 57 NOREF(pszPath); … … 65 59 66 60 67 int rtPathFromNative(char **ppszPath, const char *pszNativePath)61 int rtPathFromNative(char const **ppszPath, const char *pszNativePath, const char *pszBasePath) 68 62 { 69 63 /** @todo We must compose the codepoints in the string here. We get file names 70 64 * in normalization form D so we'll end up with normalization form C 71 65 * whatever approach we take. */ 72 return RTStrDupEx(ppszPath, pszNativePath); 66 int rc = RTStrValidateEncodingEx(pszNativePath, RTSTR_MAX, 0 /*fFlags*/); 67 if (RT_SUCCESS(rc)) 68 *ppszPath = pszNativePath; 69 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 70 return rc; 73 71 } 74 72 75 73 76 int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath)74 void rtPathFreeIprt(const char *pszPath, const char *pszNativePath) 77 75 { 78 NOREF(pszBasePath);79 return rtPathFromNative(ppszPath,pszNativePath);76 Assert(pszPath == pszNativePath || !pszPath); 77 NOREF(pszPath); NOREF(pszNativePath); 80 78 } 81 79 80 81 int rtPathFromNativeCopy(char *pszPath, size_t cbPath, const char *pszNativePath, const char *pszBasePath) 82 { 83 /** @todo We must compose the codepoints in the string here. We get file names 84 * in normalization form D so we'll end up with normalization form C 85 * whatever approach we take. */ 86 int rc = RTStrValidateEncodingEx(pszNativePath, RTSTR_MAX, 0 /*fFlags*/); 87 if (RT_SUCCESS(rc)) 88 rc = RTStrCopyEx(pszPath, cbPath, pszNativePath, RTSTR_MAX); 89 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 90 return rc; 91 } 92 -
trunk/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp
r28800 r28915 49 49 AssertReturn(pszImageName, VERR_INTERNAL_ERROR); 50 50 51 char *pszTmp; 52 int rc = rtPathFromNative(&pszTmp, pszImageName); 51 int rc = rtPathFromNativeCopy(pszPath, cchPath, pszImageName, NULL); 53 52 AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhsx\n", rc, pszPath, strlen(pszImageName), pszPath), rc); 54 55 size_t cch = strlen(pszTmp);56 AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW);57 58 memcpy(pszPath, pszTmp, cch + 1);59 RTStrFree(pszTmp);60 53 61 54 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.