Fossil SCM

Allow up to two // characters at the beginning of a pathname since this is important on windows.

drh 2011-03-18 02:13 UTC trunk
Commit f1173da7d51859103f1de0c89b261daa81aa8483
1 file changed +3 -2
+3 -2
--- src/file.c
+++ src/file.c
@@ -299,12 +299,13 @@
299299
#endif
300300
301301
/* Removing trailing "/" characters */
302302
while( n>1 && z[n-1]=='/' ){ n--; }
303303
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++){
306307
z[j++] = z[i];
307308
while( z[i]=='/' && i<n-1 && z[i+1]=='/' ) i++;
308309
}
309310
n = j;
310311
311312
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button