From ec63698ce2acba9c5e8040c32a0317ca1037b124 Mon Sep 17 00:00:00 2001 From: jozan Date: Sun, 15 Nov 2020 18:22:15 +0000 Subject: no chdir, yeye FossilOrigin-Name: fb7c8f30bd334f8b102126291f7a115647566f90c0a5e8212beac3504599f307 --- src/c_lfiles.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/c_lfiles.c') diff --git a/src/c_lfiles.c b/src/c_lfiles.c index b420373..f22fed0 100644 --- a/src/c_lfiles.c +++ b/src/c_lfiles.c @@ -116,7 +116,7 @@ c_lfiles_new } struct lfiles_s* -c_lfiles_gather(void) +c_lfiles_gather(const char dir[]) { DIR* dirp; struct dirent* dp; @@ -125,7 +125,7 @@ c_lfiles_gather(void) head = NULL; link = NULL; - dirp = opendir("."); + dirp = opendir(dir); if (dirp == NULL) { u_dump_errno(); return (NULL); @@ -134,12 +134,12 @@ c_lfiles_gather(void) if ( strncmp(dp->d_name, ".", 2 * sizeof(char)) == 0 || strncmp(dp->d_name, "..", 3 * sizeof(char)) == 0 - ) { + ) { continue; } link = c_lfiles_new(dp->d_name, dp->d_type); if (link == NULL) { - u_dump_errno(); + u_dump_errno_path(dir); c_lfiles_clear(&head); return (NULL); } -- cgit v1.2.3