[hackers] [wmii] [wmiir] Use stat rater than lstat for proglist. Fixes issue #215. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Mon, 16 Aug 2010 23:40:02 +0000 (UTC)

changeset: 2778:b767f9a84346
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Mon Aug 16 19:38:17 2010 -0400
files: cmd/wmiir.c
description:
[wmiir] Use stat rater than lstat for proglist. Fixes issue #215.

diff -r eff0e75864cd -r b767f9a84346 cmd/wmiir.c
--- a/cmd/wmiir.c Thu Aug 12 20:10:13 2010 -0400
+++ b/cmd/wmiir.c Mon Aug 16 19:38:17 2010 -0400
@@ -434,7 +434,7 @@
 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 @@
                 /* 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);
Received on Tue Aug 17 2010 - 01:40:02 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 17 2010 - 01:48:04 CEST