Fossil SCM
On windows builds, understand both "C:/" and "C:\" as the beginning of an absolute pathname.
Commit
becc24e4e9238cd6ccdace0c8047ae7c5fded6e3
Parent
adaa8411d9f4421…
1 file changed
+5
-1
+5
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -204,11 +204,15 @@ | ||
| 204 | 204 | ** Remove all /./ path elements. |
| 205 | 205 | ** Convert /A/../ to just / |
| 206 | 206 | */ |
| 207 | 207 | void file_canonical_name(const char *zOrigName, Blob *pOut){ |
| 208 | 208 | if( zOrigName[0]=='/' |
| 209 | - || (strlen(zOrigName)>3 && zOrigName[1]==':' && zOrigName[2]=='\\') ){ | |
| 209 | +#ifdef __MINGW32__ | |
| 210 | + || (strlen(zOrigName)>3 && zOrigName[1]==':' | |
| 211 | + && (zOrigName[2]=='\\' || zOrigName[2]=='/')) | |
| 212 | +#endif | |
| 213 | + ){ | |
| 210 | 214 | blob_set(pOut, zOrigName); |
| 211 | 215 | blob_materialize(pOut); |
| 212 | 216 | }else{ |
| 213 | 217 | char zPwd[2000]; |
| 214 | 218 | if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){ |
| 215 | 219 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -204,11 +204,15 @@ | |
| 204 | ** Remove all /./ path elements. |
| 205 | ** Convert /A/../ to just / |
| 206 | */ |
| 207 | void file_canonical_name(const char *zOrigName, Blob *pOut){ |
| 208 | if( zOrigName[0]=='/' |
| 209 | || (strlen(zOrigName)>3 && zOrigName[1]==':' && zOrigName[2]=='\\') ){ |
| 210 | blob_set(pOut, zOrigName); |
| 211 | blob_materialize(pOut); |
| 212 | }else{ |
| 213 | char zPwd[2000]; |
| 214 | if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){ |
| 215 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -204,11 +204,15 @@ | |
| 204 | ** Remove all /./ path elements. |
| 205 | ** Convert /A/../ to just / |
| 206 | */ |
| 207 | void file_canonical_name(const char *zOrigName, Blob *pOut){ |
| 208 | if( zOrigName[0]=='/' |
| 209 | #ifdef __MINGW32__ |
| 210 | || (strlen(zOrigName)>3 && zOrigName[1]==':' |
| 211 | && (zOrigName[2]=='\\' || zOrigName[2]=='/')) |
| 212 | #endif |
| 213 | ){ |
| 214 | blob_set(pOut, zOrigName); |
| 215 | blob_materialize(pOut); |
| 216 | }else{ |
| 217 | char zPwd[2000]; |
| 218 | if( getcwd(zPwd, sizeof(zPwd)-20)==0 ){ |
| 219 |