diff options
| author | tjg <tjg> | 2002-07-25 12:19:17 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:22 +0100 |
| commit | 15524157755d0d1452624d1e66659dba2bf6a7c3 (patch) | |
| tree | 0d36dae9dcf7411723006d62b957dc60f2ae7187 /glob.c | |
| parent | 3616be790d722e6037bd436c654d9a2c0c48a7e7 (diff) | |
Bug: fix globbing of broken symlinks.
Diffstat (limited to 'glob.c')
| -rw-r--r-- | glob.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* glob.c: rc's (ugly) globber. This code is not elegant, but it works */ #include "rc.h" -#include <sys/stat.h> +#include "stat.h" /* Lifted from autoconf documentation.*/ #if HAVE_DIRENT_H @@ -86,7 +86,7 @@ extern List *glob(List *s) { /* Matches a pattern p against the contents of directory d */ static List *dmatch(char *d, char *p, char *m) { - bool matched = FALSE; + bool matched; List *top, *r; static DIR *dirp; static struct dirent *dp; @@ -107,7 +107,7 @@ static List *dmatch(char *d, char *p, char *m) { if (matched) { char *path = nprint("%s/%s", d, p); - if (stat(path, &s) < 0) + if (lstat(path, &s) < 0) return NULL; r = nnew(List); r->w = ncpy(p); |