Skip to content

Commit 953ba06

Browse files
benpeartdscho
authored andcommitted
virtualfilesystem: fix bug with symlinks being ignored
The virtual file system code incorrectly treated symlinks as directories instead of regular files. This meant symlinks were not included even if they are listed in the list of files returned by the core.virtualFilesystem hook proc. Fixes #25 Signed-off-by: Ben Peart <[email protected]>
1 parent a574b94 commit 953ba06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

virtualfilesystem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
225225
if (dtype != DT_REG && dtype != DT_DIR && dtype != DT_LNK)
226226
die(_("is_excluded_from_virtualfilesystem passed unhandled dtype"));
227227

228-
if (dtype == DT_REG) {
228+
if (dtype == DT_REG || dtype == DT_LNK) {
229229
int ret = is_included_in_virtualfilesystem(pathname, pathlen);
230230
if (ret > 0)
231231
return 0;
@@ -234,7 +234,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
234234
return ret;
235235
}
236236

237-
if (dtype == DT_DIR || dtype == DT_LNK) {
237+
if (dtype == DT_DIR) {
238238
if (!parent_directory_hashmap.tablesize && virtual_filesystem_data.len)
239239
initialize_parent_directory_hashmap(&parent_directory_hashmap, &virtual_filesystem_data);
240240
if (!parent_directory_hashmap.tablesize)

0 commit comments

Comments
 (0)