commit 675f1170266f7659530c495fbbe1f1cc6445b405
parent 96389a015e2b8b4a36a0c4399dda8ce9597bb056
Author: Kris Maglione <kris@suckless.org>
Date: Mon, 16 Aug 2010 19:38:17 -0400
[wmiir] Use stat rater than lstat for proglist. Fixes issue #215.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmd/wmiir.c b/cmd/wmiir.c
@@ -434,7 +434,7 @@ static int
xproglist(int argc, char *argv[]) {
DIR *d;
struct dirent *de;
- struct stat stat;
+ struct stat st;
char *dir, *cwd;
int i;
@@ -454,8 +454,8 @@ xproglist(int argc, char *argv[]) {
/* Don't use Blprint. wimenu expects UTF-8. */
if(!chdir(cwd) && !chdir(dir) && (d = opendir(dir))) {
while((de = readdir(d))) {
- lstat(de->d_name, &stat);
- if(S_ISREG(stat.st_mode) && !access(de->d_name, X_OK))
+ stat(de->d_name, &st);
+ if(S_ISREG(st.st_mode) && !access(de->d_name, X_OK))
Bprint(outbuf, "%q\n", de->d_name);
}
closedir(d);