Changeset 52842 in vbox
- Timestamp:
- Sep 24, 2014 1:44:42 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 96253
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r51628 r52842 2360 2360 2361 2361 char *pszNewRoot = RTStrDup(pszSource); 2362 AssertPtrReturn(pszNewRoot, VERR_NO_MEMORY); 2362 if (!pszNewRoot) 2363 return VERR_NO_MEMORY; 2363 2364 2364 2365 size_t lenRoot = strlen(pszNewRoot); 2365 2366 if ( lenRoot 2366 && pszNewRoot[lenRoot - 1] == '/' 2367 && pszNewRoot[lenRoot - 1] == '\\' 2368 && lenRoot > 1 2369 && pszNewRoot[lenRoot - 2] == '/' 2370 && pszNewRoot[lenRoot - 2] == '\\') 2371 { 2372 *ppszSourceRoot = pszNewRoot; 2373 if (lenRoot > 1) 2374 *ppszSourceRoot[lenRoot - 2] = '\0'; 2375 *ppszSourceRoot[lenRoot - 1] = '\0'; 2376 } 2377 else 2367 && ( pszNewRoot[lenRoot - 1] == '/' 2368 || pszNewRoot[lenRoot - 1] == '\\') 2369 ) 2370 { 2371 pszNewRoot[lenRoot - 1] = '\0'; 2372 } 2373 2374 if ( lenRoot > 1 2375 && ( pszNewRoot[lenRoot - 2] == '/' 2376 || pszNewRoot[lenRoot - 2] == '\\') 2377 ) 2378 { 2379 pszNewRoot[lenRoot - 2] = '\0'; 2380 } 2381 2382 if (!lenRoot) 2378 2383 { 2379 2384 /* If there's anything (like a file name or a filter), 2380 2385 * strip it! */ 2381 2386 RTPathStripFilename(pszNewRoot); 2382 *ppszSourceRoot = pszNewRoot; 2383 } 2387 } 2388 2389 *ppszSourceRoot = pszNewRoot; 2384 2390 2385 2391 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.