Fossil SCM

Avoid panic on opening a repository lacking .fossil-settings/allow-symlinks or .fossil-settings/allow-symlinks.no-warn . Probably want to reconsider the way historical_version_of_file() handles error codes.

andygoth 2015-05-02 20:54 UTC andygoth-versioned-open
Commit 90c03442758222be52cb72f52f3d51a4a17cc10b
1 file changed +2 -2
+2 -2
--- src/db.c
+++ src/db.c
@@ -1923,19 +1923,19 @@
19231923
g.zLocalRoot, zName);
19241924
if( !g.localOpen ){
19251925
Blob noWarnFile;
19261926
if( historical_version_of_file(g.zOpenRevision,
19271927
blob_str(&versionedPathname),
1928
- &setting, 0, 0, 0, -1)>0 ){
1928
+ &setting, 0, 0, 0, 2)!=2 ){
19291929
found = 1;
19301930
}
19311931
/* See if there's a no-warn flag */
19321932
blob_append(&versionedPathname, ".no-warn", -1);
19331933
blob_zero(&noWarnFile);
19341934
if( historical_version_of_file(g.zOpenRevision,
19351935
blob_str(&versionedPathname),
1936
- &noWarnFile, 0, 0, 0, -1)>0 ){
1936
+ &noWarnFile, 0, 0, 0, 2)!=2 ){
19371937
noWarn = 1;
19381938
}
19391939
blob_reset(&noWarnFile);
19401940
}else if( file_size(blob_str(&versionedPathname))>=0 ){
19411941
/* File exists, and contains the value for this setting. Load from
19421942
--- src/db.c
+++ src/db.c
@@ -1923,19 +1923,19 @@
1923 g.zLocalRoot, zName);
1924 if( !g.localOpen ){
1925 Blob noWarnFile;
1926 if( historical_version_of_file(g.zOpenRevision,
1927 blob_str(&versionedPathname),
1928 &setting, 0, 0, 0, -1)>0 ){
1929 found = 1;
1930 }
1931 /* See if there's a no-warn flag */
1932 blob_append(&versionedPathname, ".no-warn", -1);
1933 blob_zero(&noWarnFile);
1934 if( historical_version_of_file(g.zOpenRevision,
1935 blob_str(&versionedPathname),
1936 &noWarnFile, 0, 0, 0, -1)>0 ){
1937 noWarn = 1;
1938 }
1939 blob_reset(&noWarnFile);
1940 }else if( file_size(blob_str(&versionedPathname))>=0 ){
1941 /* File exists, and contains the value for this setting. Load from
1942
--- src/db.c
+++ src/db.c
@@ -1923,19 +1923,19 @@
1923 g.zLocalRoot, zName);
1924 if( !g.localOpen ){
1925 Blob noWarnFile;
1926 if( historical_version_of_file(g.zOpenRevision,
1927 blob_str(&versionedPathname),
1928 &setting, 0, 0, 0, 2)!=2 ){
1929 found = 1;
1930 }
1931 /* See if there's a no-warn flag */
1932 blob_append(&versionedPathname, ".no-warn", -1);
1933 blob_zero(&noWarnFile);
1934 if( historical_version_of_file(g.zOpenRevision,
1935 blob_str(&versionedPathname),
1936 &noWarnFile, 0, 0, 0, 2)!=2 ){
1937 noWarn = 1;
1938 }
1939 blob_reset(&noWarnFile);
1940 }else if( file_size(blob_str(&versionedPathname))>=0 ){
1941 /* File exists, and contains the value for this setting. Load from
1942

Keyboard Shortcuts

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