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.
Commit
90c03442758222be52cb72f52f3d51a4a17cc10b
Parent
1b01c1ad264e91d…
1 file changed
+2
-2
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1923,19 +1923,19 @@ | ||
| 1923 | 1923 | g.zLocalRoot, zName); |
| 1924 | 1924 | if( !g.localOpen ){ |
| 1925 | 1925 | Blob noWarnFile; |
| 1926 | 1926 | if( historical_version_of_file(g.zOpenRevision, |
| 1927 | 1927 | blob_str(&versionedPathname), |
| 1928 | - &setting, 0, 0, 0, -1)>0 ){ | |
| 1928 | + &setting, 0, 0, 0, 2)!=2 ){ | |
| 1929 | 1929 | found = 1; |
| 1930 | 1930 | } |
| 1931 | 1931 | /* See if there's a no-warn flag */ |
| 1932 | 1932 | blob_append(&versionedPathname, ".no-warn", -1); |
| 1933 | 1933 | blob_zero(&noWarnFile); |
| 1934 | 1934 | if( historical_version_of_file(g.zOpenRevision, |
| 1935 | 1935 | blob_str(&versionedPathname), |
| 1936 | - &noWarnFile, 0, 0, 0, -1)>0 ){ | |
| 1936 | + &noWarnFile, 0, 0, 0, 2)!=2 ){ | |
| 1937 | 1937 | noWarn = 1; |
| 1938 | 1938 | } |
| 1939 | 1939 | blob_reset(&noWarnFile); |
| 1940 | 1940 | }else if( file_size(blob_str(&versionedPathname))>=0 ){ |
| 1941 | 1941 | /* File exists, and contains the value for this setting. Load from |
| 1942 | 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, -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 |