mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
parent
11d9fb521d
commit
914d521090
2 changed files with 43 additions and 0 deletions
|
@ -55,6 +55,19 @@ textwindows size_t __normntpath(char16_t *p, size_t n) {
|
|||
// matched "/../" or "/..$"
|
||||
while (j && p[j - 1] == '\\')
|
||||
--j;
|
||||
if (j && p[j - 1] == '.') {
|
||||
// matched "." before
|
||||
if (j >= 2 && p[j - 2] == '.' && //
|
||||
(j == 2 || p[j - 3] == '\\')) {
|
||||
// matched "^.." or "/.." before
|
||||
p[++j] = '.';
|
||||
++j;
|
||||
continue;
|
||||
} else if (j == 1 || p[j - 2] == '\\') {
|
||||
// matched "^." or "/." before
|
||||
continue;
|
||||
}
|
||||
}
|
||||
while (j && p[j - 1] != '\\')
|
||||
--j;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue