Skip to content

Commit 1735457

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 8042372 commit 1735457

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
@@ -226,7 +226,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
226226
if (dtype != DT_REG && dtype != DT_DIR && dtype != DT_LNK)
227227
die(_("is_excluded_from_virtualfilesystem passed unhandled dtype"));
228228

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

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

0 commit comments

Comments
 (0)