Fossil SCM
Fix a crash if the test-file-environment command is called from outside a check-out (introduced with [106de276ee]).
Commit
38930fbabe9b35ad97ab7c5c7fdb6931334f62781922c46e02909fb50a0a0476
Parent
106de276eec32ea…
1 file changed
+1
+1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1656,10 +1656,11 @@ | ||
| 1656 | 1656 | g.allowSymlinks = !is_false(zAllow); |
| 1657 | 1657 | } |
| 1658 | 1658 | if( zRoot==0 ) zRoot = g.zLocalRoot==0 ? "" : g.zLocalRoot; |
| 1659 | 1659 | fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks()); |
| 1660 | 1660 | fossil_print("local-root = [%s]\n", zRoot); |
| 1661 | + if( g.db==0 ) sqlite3_open(":memory:", &g.db); | |
| 1661 | 1662 | sqlite3_create_function(g.db, "inode", 1, SQLITE_UTF8, 0, |
| 1662 | 1663 | file_inode_sql_func, 0, 0); |
| 1663 | 1664 | for(i=2; i<g.argc; i++){ |
| 1664 | 1665 | char *z; |
| 1665 | 1666 | emitFileStat(g.argv[i], slashFlag, resetFlag); |
| 1666 | 1667 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1656,10 +1656,11 @@ | |
| 1656 | g.allowSymlinks = !is_false(zAllow); |
| 1657 | } |
| 1658 | if( zRoot==0 ) zRoot = g.zLocalRoot==0 ? "" : g.zLocalRoot; |
| 1659 | fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks()); |
| 1660 | fossil_print("local-root = [%s]\n", zRoot); |
| 1661 | sqlite3_create_function(g.db, "inode", 1, SQLITE_UTF8, 0, |
| 1662 | file_inode_sql_func, 0, 0); |
| 1663 | for(i=2; i<g.argc; i++){ |
| 1664 | char *z; |
| 1665 | emitFileStat(g.argv[i], slashFlag, resetFlag); |
| 1666 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1656,10 +1656,11 @@ | |
| 1656 | g.allowSymlinks = !is_false(zAllow); |
| 1657 | } |
| 1658 | if( zRoot==0 ) zRoot = g.zLocalRoot==0 ? "" : g.zLocalRoot; |
| 1659 | fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks()); |
| 1660 | fossil_print("local-root = [%s]\n", zRoot); |
| 1661 | if( g.db==0 ) sqlite3_open(":memory:", &g.db); |
| 1662 | sqlite3_create_function(g.db, "inode", 1, SQLITE_UTF8, 0, |
| 1663 | file_inode_sql_func, 0, 0); |
| 1664 | for(i=2; i<g.argc; i++){ |
| 1665 | char *z; |
| 1666 | emitFileStat(g.argv[i], slashFlag, resetFlag); |
| 1667 |