Changeset 1368 in kBuild for trunk/src/lib/nt_fullpath.c
- Timestamp:
- Dec 7, 2007 7:36:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/nt_fullpath.c
r1265 r1368 113 113 char *pszLast = &s_szLast[psz - pszPath]; 114 114 char *pszCur = psz; 115 char *pszSrc0 = pszLast; 116 char *pszDst0 = pszCur; 115 117 for (;;) 116 118 { … … 119 121 if ( ch1 != ch2 120 122 && (ch1 != '\\' || ch2 != '/') 121 && (ch1 != '/' || ch2 != '\\')) 122 { 123 if ( tolower(ch1) != tolower(ch2) 124 && toupper(ch1) != toupper(ch2)) 125 break; 126 /* optimistic, component mismatch will be corrected in the next loop. */ 127 *pszCur = ch2; 128 } 123 && (ch1 != '/' || ch2 != '\\') 124 && tolower(ch1) != tolower(ch2) 125 && toupper(ch1) != toupper(ch2)) 126 break; 129 127 if (ch1 == '/' || ch1 == '\\') 130 psz = pszCur + 1; 128 { 129 psz = pszCur + 1; 130 *pszLast = ch1; /* preserve the slashes */ 131 } 131 132 else if (ch1 == '\0') 132 133 { … … 137 138 pszLast++; 138 139 } 140 if (psz != pszDst0) 141 memcpy(pszDst0, pszSrc0, psz - pszDst0); 139 142 } 140 143
Note:
See TracChangeset
for help on using the changeset viewer.