Fossil SCM
When searching for a repository to open based on the request URI, do not mistake directories whose names end with ".fossil" as repositories. This resolves the issue mentioned in [forum:/forumpost/3724e6175b7f6163|forum post 3724e6175b].
Commit
dc21949fa3091428bd852d6b5f59634d8ad6319fd3729468314fb4182567ee5e
Parent
c23741ac5de4298…
1 file changed
+5
+5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1849,10 +1849,15 @@ | ||
| 1849 | 1849 | ** not exist. |
| 1850 | 1850 | */ |
| 1851 | 1851 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1852 | 1852 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1853 | 1853 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1854 | + if( szFile>0 && !file_isfile(zCleanRepo, ExtFILE) ){ | |
| 1855 | + /* Only let szFile be non-negative if zCleanRepo really is a file | |
| 1856 | + ** and not a directory or some other filesystem object. */ | |
| 1857 | + szFile = -1; | |
| 1858 | + } | |
| 1854 | 1859 | if( g.fHttpTrace ){ |
| 1855 | 1860 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1856 | 1861 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1857 | 1862 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1858 | 1863 | } |
| 1859 | 1864 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1849,10 +1849,15 @@ | |
| 1849 | ** not exist. |
| 1850 | */ |
| 1851 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1852 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1853 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1854 | if( g.fHttpTrace ){ |
| 1855 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1856 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1857 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1858 | } |
| 1859 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1849,10 +1849,15 @@ | |
| 1849 | ** not exist. |
| 1850 | */ |
| 1851 | zCleanRepo = file_cleanup_fullpath(zRepo); |
| 1852 | if( szFile==0 && sqlite3_strglob("*/.fossil",zRepo)!=0 ){ |
| 1853 | szFile = file_size(zCleanRepo, ExtFILE); |
| 1854 | if( szFile>0 && !file_isfile(zCleanRepo, ExtFILE) ){ |
| 1855 | /* Only let szFile be non-negative if zCleanRepo really is a file |
| 1856 | ** and not a directory or some other filesystem object. */ |
| 1857 | szFile = -1; |
| 1858 | } |
| 1859 | if( g.fHttpTrace ){ |
| 1860 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", szFile); |
| 1861 | @ <!-- file_size(%h(zCleanRepo)) is %s(zBuf) --> |
| 1862 | fprintf(stderr, "# file_size(%s) = %s\n", zCleanRepo, zBuf); |
| 1863 | } |
| 1864 |