Changeset 61959 in vbox for trunk/src/VBox/Runtime/common/path/comparepaths.cpp
- Timestamp:
- Jun 30, 2016 3:11:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/path/comparepaths.cpp
r57358 r61959 55 55 56 56 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 57 PRTUNICP puszPath1;58 int rc = RTStrToUni(pszPath1, &puszPath1);59 if (RT_FAILURE(rc))60 return -1;61 PRTUNICP puszPath2;62 rc = RTStrToUni(pszPath2, &puszPath2);63 if (RT_FAILURE(rc))64 {65 RTUniFree(puszPath1);66 return 1;67 }68 69 int iDiff = 0;70 PRTUNICP puszTmpPath1 = puszPath1;71 PRTUNICP puszTmpPath2 = puszPath2;72 57 for (;;) 73 58 { 74 register RTUNICP uc1 = *puszTmpPath1;75 register RTUNICP uc2 = *puszTmpPath2;76 if ( uc1 != uc2)59 RTUNICP uc1; 60 int rc = RTStrGetCpEx(&pszPath1, &uc1); 61 if (RT_SUCCESS(rc)) 77 62 { 78 if (uc1 == '\\') 79 uc1 = '/'; 63 RTUNICP uc2; 64 rc = RTStrGetCpEx(&pszPath2, &uc2); 65 if (RT_SUCCESS(rc)) 66 { 67 if (uc1 == uc2) 68 { 69 if (uc1) 70 { /* likely */ } 71 else 72 return 0; 73 } 74 else 75 { 76 if (uc1 == '\\') 77 uc1 = '/'; 78 else 79 uc1 = RTUniCpToUpper(uc1); 80 if (uc2 == '\\') 81 uc2 = '/'; 82 else 83 uc2 = RTUniCpToUpper(uc2); 84 if (uc1 != uc2) 85 { 86 if (fLimit && uc2 == '\0') 87 return 0; 88 return uc1 > uc2 ? 1 : -1; /* (overflow/underflow paranoia) */ 89 } 90 } 91 } 80 92 else 81 uc1 = RTUniCpToUpper(uc1); 82 if (uc2 == '\\') 83 uc2 = '/'; 84 else 85 uc2 = RTUniCpToUpper(uc2); 86 if (uc1 != uc2) 87 { 88 iDiff = uc1 > uc2 ? 1 : -1; /* (overflow/underflow paranoia) */ 89 if (fLimit && uc2 == '\0') 90 iDiff = 0; 91 break; 92 } 93 return 1; 93 94 } 94 if (!uc1) 95 break; 96 puszTmpPath1++; 97 puszTmpPath2++; 98 95 else 96 return -1; 99 97 } 100 101 RTUniFree(puszPath2);102 RTUniFree(puszPath1);103 return iDiff;104 105 98 #else 106 99 if (!fLimit)
Note:
See TracChangeset
for help on using the changeset viewer.