Fossil SCM
When walking the filesystem in order to construct a repository list, avoid walking into any directory name "proc". See [forum:/forumpost/d9553c52fc|forum thread d9553c52fc] for rationale.
Commit
a8c96a64c4ddebc43f0a25c50ab8d3c14d5c2f491028464c35d9e1626372256d
Parent
ca5ecf2223e7b2e…
1 file changed
+4
-1
+4
-1
| --- src/repolist.c | ||
| +++ src/repolist.c | ||
| @@ -157,17 +157,20 @@ | ||
| 157 | 157 | allRepo = 1; |
| 158 | 158 | }else{ |
| 159 | 159 | /* The default case: All repositories under the g.zRepositoryName |
| 160 | 160 | ** directory. |
| 161 | 161 | */ |
| 162 | + Glob *pExclude; | |
| 162 | 163 | blob_init(&base, g.zRepositoryName, -1); |
| 163 | 164 | db_close(0); |
| 164 | 165 | assert( g.db==0 ); |
| 165 | 166 | sqlite3_open(":memory:", &g.db); |
| 166 | 167 | db_multi_exec("CREATE TABLE sfile(pathname TEXT);"); |
| 167 | 168 | db_multi_exec("CREATE TABLE vfile(pathname);"); |
| 168 | - vfile_scan(&base, blob_size(&base), 0, 0, 0, ExtFILE); | |
| 169 | + pExclude = glob_create("*/proc,proc"); | |
| 170 | + vfile_scan(&base, blob_size(&base), 0, pExclude, 0, ExtFILE); | |
| 171 | + glob_free(pExclude); | |
| 169 | 172 | db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'" |
| 170 | 173 | #if USE_SEE |
| 171 | 174 | " AND pathname NOT GLOB '*[^/].efossil'" |
| 172 | 175 | #endif |
| 173 | 176 | ); |
| 174 | 177 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -157,17 +157,20 @@ | |
| 157 | allRepo = 1; |
| 158 | }else{ |
| 159 | /* The default case: All repositories under the g.zRepositoryName |
| 160 | ** directory. |
| 161 | */ |
| 162 | blob_init(&base, g.zRepositoryName, -1); |
| 163 | db_close(0); |
| 164 | assert( g.db==0 ); |
| 165 | sqlite3_open(":memory:", &g.db); |
| 166 | db_multi_exec("CREATE TABLE sfile(pathname TEXT);"); |
| 167 | db_multi_exec("CREATE TABLE vfile(pathname);"); |
| 168 | vfile_scan(&base, blob_size(&base), 0, 0, 0, ExtFILE); |
| 169 | db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'" |
| 170 | #if USE_SEE |
| 171 | " AND pathname NOT GLOB '*[^/].efossil'" |
| 172 | #endif |
| 173 | ); |
| 174 |
| --- src/repolist.c | |
| +++ src/repolist.c | |
| @@ -157,17 +157,20 @@ | |
| 157 | allRepo = 1; |
| 158 | }else{ |
| 159 | /* The default case: All repositories under the g.zRepositoryName |
| 160 | ** directory. |
| 161 | */ |
| 162 | Glob *pExclude; |
| 163 | blob_init(&base, g.zRepositoryName, -1); |
| 164 | db_close(0); |
| 165 | assert( g.db==0 ); |
| 166 | sqlite3_open(":memory:", &g.db); |
| 167 | db_multi_exec("CREATE TABLE sfile(pathname TEXT);"); |
| 168 | db_multi_exec("CREATE TABLE vfile(pathname);"); |
| 169 | pExclude = glob_create("*/proc,proc"); |
| 170 | vfile_scan(&base, blob_size(&base), 0, pExclude, 0, ExtFILE); |
| 171 | glob_free(pExclude); |
| 172 | db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'" |
| 173 | #if USE_SEE |
| 174 | " AND pathname NOT GLOB '*[^/].efossil'" |
| 175 | #endif |
| 176 | ); |
| 177 |