Index: lib/rtl/path.c =================================================================== --- lib/rtl/path.c (révision 59145) +++ lib/rtl/path.c (copie de travail) @@ -141,7 +141,7 @@ { /* Stop if we hit something else than a space or period */ c = PathCopy.Buffer[PathChars - 1]; - if ((c != '.') && (c != ' ')) break; + if ((c != L'.') && (c != L' ')) break; /* Fixup the lengths */ PathCopy.Length -= sizeof(WCHAR); @@ -160,7 +160,7 @@ { /* Check if the character is a path or drive separator */ c = *End; - if ((c == '\\') || (c == '/') || ((c == ':') && (End == PathCopy.Buffer + 1))) + if ((c == L'\\') || (c == L'/') || ((c == L':') && (End == PathCopy.Buffer + 1))) { /* Get the next lower case character */ End++; @@ -168,7 +168,7 @@ /* Check if it's a DOS device (LPT, COM, PRN, AUX, or NUL) */ if ((End < &PathCopy.Buffer[OriginalLength / sizeof(WCHAR)]) && - ((c == 'l') || (c == 'c') || (c == 'p') || (c == 'a') || (c == 'n'))) + ((c == L'l') || (c == L'c') || (c == L'p') || (c == L'a') || (c == L'n'))) { /* Calculate the offset */ ReturnOffset = (USHORT)((PCHAR)End - (PCHAR)PathCopy.Buffer); @@ -191,7 +191,7 @@ /* Get the next lower case character and check if it's a DOS device */ c = *PathCopy.Buffer | ' '; // ' ' == ('z' - 'Z') - if ((c != 'l') && (c != 'c') && (c != 'p') && (c != 'a') && (c != 'n')) + if ((c != L'l') && (c != L'c') && (c != L'p') && (c != L'a') && (c != L'n')) { /* Not LPT, COM, PRN, AUX, or NUL */ return 0; @@ -204,12 +204,12 @@ while (Start < End) { c = *Start; - if ((c == '.') || (c == ':')) break; + if ((c == L'.') || (c == L':')) break; Start++; } /* And then go backwards to get rid of spaces */ - while ((Start > PathCopy.Buffer) && (Start[-1] == ' ')) --Start; + while ((Start > PathCopy.Buffer) && (Start[-1] == L' ')) --Start; /* Finally see how many characters are left, and that's our size */ PathChars = (USHORT)(Start - PathCopy.Buffer); @@ -217,7 +217,7 @@ /* Check if this is a COM or LPT port, which has a digit after it */ if ((PathChars == 4) && - (iswdigit(PathCopy.Buffer[3]) && (PathCopy.Buffer[3] != '0'))) + (iswdigit(PathCopy.Buffer[3]) && (PathCopy.Buffer[3] != L'0'))) { /* Don't compare the number part, just check for LPT or COM */ PathCopy.Length -= sizeof(WCHAR); @@ -423,7 +423,7 @@ { /* Loop from the back until we find a path separator */ p = &NewBuffer[(DosLength - 1) / sizeof (WCHAR)]; - while (p > NewBuffer) if (*p-- == '\\') break; + while (p > NewBuffer) if (*p-- == L'\\') break; /* Was one found? */ if (p > NewBuffer) @@ -1202,11 +1202,11 @@ WCHAR *p, *next; /* convert every / into a \ */ - for (p = path; *p; p++) if (*p == '/') *p = '\\'; + for (p = path; *p; p++) if (*p == L'/') *p = L'\\'; /* collapse duplicate backslashes */ next = path + max( 1, mark ); - for (p = next; *p; p++) if (*p != '\\' || next[-1] != '\\') *next++ = *p; + for (p = next; *p; p++) if (*p != L'\\' || next[-1] != L'\\') *next++ = *p; *next = 0; p = path + mark; @@ -1216,7 +1216,7 @@ { switch(p[1]) { - case '\\': /* .\ component */ + case L'\\': /* .\ component */ next = p + 2; memmove( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); continue; @@ -1224,14 +1224,14 @@ if (p > path + mark) p--; *p = 0; continue; - case '.': - if (p[2] == '\\') /* ..\ component */ + case L'.': + if (p[2] == L'\\') /* ..\ component */ { next = p + 3; if (p > path + mark) { p--; - while (p > path + mark && p[-1] != '\\') p--; + while (p > path + mark && p[-1] != L'\\') p--; } memmove( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); continue; @@ -1241,7 +1241,7 @@ if (p > path + mark) { p--; - while (p > path + mark && p[-1] != '\\') p--; + while (p > path + mark && p[-1] != L'\\') p--; if (p > path + mark) p--; } *p = 0; @@ -1251,17 +1251,17 @@ } } /* skip to the next component */ - while (*p && *p != '\\') p++; - if (*p == '\\') + while (*p && *p != L'\\') p++; + if (*p == L'\\') { /* remove last dot in previous dir name */ - if (p > path + mark && p[-1] == '.') memmove( p-1, p, (wcslen(p) + 1) * sizeof(WCHAR) ); + if (p > path + mark && p[-1] == L'.') memmove( p-1, p, (wcslen(p) + 1) * sizeof(WCHAR) ); else p++; } } /* remove trailing spaces and dots (yes, Windows really does that, don't ask) */ - while (p > path + mark && (p[-1] == ' ' || p[-1] == '.')) p--; + while (p > path + mark && (p[-1] == L' ' || p[-1] == L'.')) p--; *p = 0; } @@ -1301,7 +1301,7 @@ WCHAR tmp[4]; /* return error if name only consists of spaces */ - for (ptr = name; *ptr; ptr++) if (*ptr != ' ') break; + for (ptr = name; *ptr; ptr++) if (*ptr != L' ') break; if (!*ptr) return 0; RtlAcquirePebLock(); @@ -1330,14 +1330,14 @@ case RtlPathTypeDriveRelative: /* c:foo */ dep = 2; - if (towupper(name[0]) != towupper(cd->Buffer[0]) || cd->Buffer[1] != ':') + if (towupper(name[0]) != towupper(cd->Buffer[0]) || cd->Buffer[1] != L':') { UNICODE_STRING var, val; - tmp[0] = '='; + tmp[0] = L'='; tmp[1] = name[0]; - tmp[2] = ':'; - tmp[3] = '\0'; + tmp[2] = L':'; + tmp[3] = L'\0'; var.Length = 3 * sizeof(WCHAR); var.MaximumLength = 4 * sizeof(WCHAR); var.Buffer = tmp; @@ -1361,14 +1361,14 @@ /* fall thru */ case STATUS_BUFFER_TOO_SMALL: reqsize = val.Length + sizeof(WCHAR); /* append trailing '\\' */ - val.Buffer[val.Length / sizeof(WCHAR)] = '\\'; + val.Buffer[val.Length / sizeof(WCHAR)] = L'\\'; ins_str = val.Buffer; break; case STATUS_VARIABLE_NOT_FOUND: reqsize = 3 * sizeof(WCHAR); tmp[0] = name[0]; - tmp[1] = ':'; - tmp[2] = '\\'; + tmp[1] = L':'; + tmp[2] = L'\\'; ins_str = tmp; RtlFreeHeap(RtlGetProcessHeap(), 0, val.Buffer); break; @@ -1385,7 +1385,7 @@ case RtlPathTypeRelative: /* foo */ reqsize = cd->Length; ins_str = cd->Buffer; - if (cd->Buffer[1] != ':') + if (cd->Buffer[1] != L':') { ptr = skip_unc_prefix( cd->Buffer ); mark = ptr - cd->Buffer; @@ -1395,16 +1395,16 @@ case RtlPathTypeRooted: /* \xxx */ #ifdef __WINE__ - if (name[0] == '/') /* may be a Unix path */ + if (name[0] == L'/') /* may be a Unix path */ { const WCHAR *ptr = name; int drive = find_drive_root( &ptr ); if (drive != -1) { reqsize = 3 * sizeof(WCHAR); - tmp[0] = 'A' + drive; - tmp[1] = ':'; - tmp[2] = '\\'; + tmp[0] = L'A' + drive; + tmp[1] = L':'; + tmp[2] = L'\\'; ins_str = tmp; mark = 3; dep = ptr - name; @@ -1412,11 +1412,11 @@ } } #endif - if (cd->Buffer[1] == ':') + if (cd->Buffer[1] == L':') { reqsize = 2 * sizeof(WCHAR); tmp[0] = cd->Buffer[0]; - tmp[1] = ':'; + tmp[1] = L':'; ins_str = tmp; mark = 3; } @@ -1432,10 +1432,10 @@ case RtlPathTypeRootLocalDevice: /* \\. */ reqsize = 4 * sizeof(WCHAR); dep = 3; - tmp[0] = '\\'; - tmp[1] = '\\'; - tmp[2] = '.'; - tmp[3] = '\\'; + tmp[0] = L'\\'; + tmp[1] = L'\\'; + tmp[2] = L'.'; + tmp[3] = L'\\'; ins_str = tmp; mark = 4; break; @@ -1507,7 +1507,7 @@ if (8 + sz + 2 > size) return sz + 10; wcscpy(buffer, DeviceRootW); memmove(buffer + 4, name + offset, sz); - buffer[4 + sz / sizeof(WCHAR)] = '\0'; + buffer[4 + sz / sizeof(WCHAR)] = L'\0'; /* file_part isn't set in this case */ return sz + 8; } @@ -1529,7 +1529,7 @@ } /* find file part */ - if (file_part && (ptr = wcsrchr(buffer, '\\')) != NULL && ptr >= buffer + 2 && *++ptr) + if (file_part && (ptr = wcsrchr(buffer, L'\\')) != NULL && ptr >= buffer + 2 && *++ptr) *file_part = ptr; return reqsize; } @@ -1658,7 +1658,7 @@ while (*p) { /* Looking for an extension */ - if (*p == '.') + if (*p == L'.') { /* No extension string needed -- it's part of the filename */ Extension = NULL; @@ -1716,7 +1716,7 @@ if (*Path) { /* Loop as long as there's no semicolon */ - while (*Path != ';') + while (*Path != L';') { /* Copy the next character */ *BufferStart++ = *Path++; @@ -1724,13 +1724,13 @@ } /* We found a semi-colon, to stop path processing on this loop */ - if (*Path == ';') ++Path; + if (*Path == L';') ++Path; } /* Add a terminating slash if needed */ - if ((BufferStart != NewBuffer) && (BufferStart[-1] != '\\')) + if ((BufferStart != NewBuffer) && (BufferStart[-1] != L'\\')) { - *BufferStart++ = '\\'; + *BufferStart++ = L'\\'; } /* Bail out if we reached the end */