Fossil SCM

Fossil does not handle absolute paths without disk drives in Windows.

Fixed

cdd360438de1331… · opened 16 years, 6 months ago

Type
Code_Defect
Priority
Severity
Minor
Resolution
Fixed
Subsystem
Created
Sept. 13, 2009 6:14 a.m.

Attempt #1 to open a repository in Windows:

e:\source\c\fossil>fossil open \Source\Repositories\fossil.fsl
fossil: repository does not exist or is in an unreadable directory: E:/Source/C/fossil/Source/Repositories/fossil.fsl

Attempt #2:

e:\source\c\fossil>fossil open E:\Source\Repositories\fossil.fsl
BUILD.txt
COPYRIGHT-GPL2.txt
Makefile
Makefile.w32
art/CollRev1.dia
art/CollRev2.dia
art/CollRev3.dia
art/CollRev4.dia
art/branching.odp
.
.
.

It bizarrely assumes that a path with an opening backslash is relative to the current path instead of relative to the drive root like it should.

It seems fossil only recognizes a full path specification if it includes device names. This is a Bad Idea. It makes me wonder how it handles UNC or UNCW paths as well:

\\Computer\SharedFolder\Path\To\Destination\File
\\?\UNC\Computer\SharedFolder\Path\To\Destination\File.

(I have no way of testing that at the moment as the Windows machine I'm using is not on a network with any other Windows machines.)


drh added on 2009-09-13 11:47:15:
I think that the following patch may be sufficient to fix this:


--- src/file.c
+++ src/file.c
@@ -244,10 +244,11 @@
 ** Convert /A/../ to just /
 */
 void file_canonical_name(const char *zOrigName, Blob *pOut){
   if( zOrigName[0]=='/'
 #ifdef __MINGW32__
+      || zOrigName[0]=='\\'
       || (strlen(zOrigName)>3 && zOrigName[1]==':'
            && (zOrigName[2]=='\\' || zOrigName[2]=='/'))
 #endif
   ){
     blob_set(pOut, zOrigName);

I will strive to boot up a copy of windows this afternoon and try it out. In the meantime, a work-around might be to use forward slashes ("/") instead of backslashes ("\") in the pathname, at least for the first character of an absolute pathname.


drh added on 2009-09-13 16:21:13:
The patch shown above turns out to work.
Fixed by check-in [42bf80978d9740dbac8c762033348fbb1da9b0de].

Keyboard Shortcuts

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