From 15524157755d0d1452624d1e66659dba2bf6a7c3 Mon Sep 17 00:00:00 2001 From: tjg Date: Thu, 25 Jul 2002 12:19:17 +0000 Subject: Bug: fix globbing of broken symlinks. --- glob.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glob.c') diff --git a/glob.c b/glob.c index ac26203..b472af9 100644 --- a/glob.c +++ b/glob.c @@ -1,7 +1,7 @@ /* glob.c: rc's (ugly) globber. This code is not elegant, but it works */ #include "rc.h" -#include +#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); -- cgit v1.2.3