Changeset 85028 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Jul 1, 2020 2:37:53 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138929
- Location:
- trunk/src/VBox/GuestHost/DragAndDrop
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp
r85027 r85028 179 179 } 180 180 181 rc = DnDPathSanitize Filename(szTime, sizeof(szTime));181 rc = DnDPathSanitize(szTime, sizeof(szTime)); 182 182 if (RT_FAILURE(rc)) 183 183 break; -
trunk/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp
r85003 r85028 31 31 32 32 /** 33 * Sanitizes the file name component so that unsupported characters 34 * will be replaced by an underscore ("_"). 33 * Sanitizes a path so that unsupported characters will be replaced by an underscore ("_"). 35 34 * 36 35 * @return IPRT status code. … … 38 37 * @param cbPath Size (in bytes) of path to sanitize. 39 38 */ 40 int DnDPathSanitize Filename(char *pszPath, size_t cbPath)39 int DnDPathSanitize(char *pszPath, size_t cbPath) 41 40 { 41 if (!pszPath) /* No path given? Bail out early. */ 42 return VINF_SUCCESS; 43 44 AssertReturn(cbPath, VERR_INVALID_PARAMETER); 45 42 46 int rc = VINF_SUCCESS; 43 47 #ifdef RT_OS_WINDOWS … … 57 61 '\0' 58 62 }; 59 char *pszFilename = RTPathFilename(pszPath); 60 if (pszFilename) 61 { 62 ssize_t cReplaced = RTStrPurgeComplementSet(pszFilename, s_uszValidRangePairs, '_' /* chReplacement */); 63 if (cReplaced < 0) 64 rc = VERR_INVALID_UTF8_ENCODING; 65 } 66 else 67 rc = VERR_INVALID_PARAMETER; 63 64 ssize_t cReplaced = RTStrPurgeComplementSet(pszPath, s_uszValidRangePairs, '_' /* chReplacement */); 65 if (cReplaced < 0) 66 rc = VERR_INVALID_UTF8_ENCODING; 68 67 #else 69 68 RT_NOREF2(pszPath, cbPath);
Note:
See TracChangeset
for help on using the changeset viewer.