diff options
author | jozan <jozan@noemail.net> | 2020-11-15 18:22:15 +0000 |
---|---|---|
committer | jozan <jozan@noemail.net> | 2020-11-15 18:22:15 +0000 |
commit | ec63698ce2acba9c5e8040c32a0317ca1037b124 (patch) | |
tree | 127e0122010b71acbc526741cd645a62ce08b1de /src/c_lfiles.c | |
parent | Create new branch named "no-chdir" (diff) | |
download | unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.gz unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.bz2 unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.xz unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.tar.zst unixize-ec63698ce2acba9c5e8040c32a0317ca1037b124.zip |
no chdir, yeyeno-chdir
FossilOrigin-Name: fb7c8f30bd334f8b102126291f7a115647566f90c0a5e8212beac3504599f307
Diffstat (limited to 'src/c_lfiles.c')
-rw-r--r-- | src/c_lfiles.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |