Check if there's a parent directory to go to on .. in NormalizePath.

This commit is contained in:
Bartosz Taudul
2026-08-03 18:26:49 +02:00
parent d0ffd8dc86
commit d91769b72e
+6 -3
View File
@@ -1283,9 +1283,12 @@ char* NormalizePath( const char* path )
case 2:
if( memcmp( ptr, "..", 2 ) == 0 )
{
const char* back = res + rsz - 1;
while( back > res && *back != '/' ) back--;
rsz = back - res;
if( rsz > 0 )
{
const char* back = res + rsz - 1;
while( back > res && *back != '/' ) back--;
rsz = back - res;
}
ptr = next + 1;
continue;
}