Fossil SCM
Allow up to two // characters at the beginning of a pathname since this is important on windows.
Commit
f1173da7d51859103f1de0c89b261daa81aa8483
Parent
7e995f54ff0d54b…
1 file changed
+3
-2
+3
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -299,12 +299,13 @@ | ||
| 299 | 299 | #endif |
| 300 | 300 | |
| 301 | 301 | /* Removing trailing "/" characters */ |
| 302 | 302 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 303 | 303 | |
| 304 | - /* Remove duplicate '/' characters */ | |
| 305 | - for(i=j=0; i<n; i++){ | |
| 304 | + /* Remove duplicate '/' characters. Except, two // at the beginning | |
| 305 | + ** of a pathname is allowed since this is important on windows. */ | |
| 306 | + for(i=j=1; i<n; i++){ | |
| 306 | 307 | z[j++] = z[i]; |
| 307 | 308 | while( z[i]=='/' && i<n-1 && z[i+1]=='/' ) i++; |
| 308 | 309 | } |
| 309 | 310 | n = j; |
| 310 | 311 | |
| 311 | 312 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -299,12 +299,13 @@ | |
| 299 | #endif |
| 300 | |
| 301 | /* Removing trailing "/" characters */ |
| 302 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 303 | |
| 304 | /* Remove duplicate '/' characters */ |
| 305 | for(i=j=0; i<n; i++){ |
| 306 | z[j++] = z[i]; |
| 307 | while( z[i]=='/' && i<n-1 && z[i+1]=='/' ) i++; |
| 308 | } |
| 309 | n = j; |
| 310 | |
| 311 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -299,12 +299,13 @@ | |
| 299 | #endif |
| 300 | |
| 301 | /* Removing trailing "/" characters */ |
| 302 | while( n>1 && z[n-1]=='/' ){ n--; } |
| 303 | |
| 304 | /* Remove duplicate '/' characters. Except, two // at the beginning |
| 305 | ** of a pathname is allowed since this is important on windows. */ |
| 306 | for(i=j=1; i<n; i++){ |
| 307 | z[j++] = z[i]; |
| 308 | while( z[i]=='/' && i<n-1 && z[i+1]=='/' ) i++; |
| 309 | } |
| 310 | n = j; |
| 311 | |
| 312 |