mirror of
https://github.com/0intro/wmii
synced 2024-11-28 16:43:08 +03:00
[wmiir] Use stat rater than lstat for proglist. Fixes issue #215.
This commit is contained in:
parent
96389a015e
commit
675f117026
@ -434,7 +434,7 @@ static int
|
|||||||
xproglist(int argc, char *argv[]) {
|
xproglist(int argc, char *argv[]) {
|
||||||
DIR *d;
|
DIR *d;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
struct stat stat;
|
struct stat st;
|
||||||
char *dir, *cwd;
|
char *dir, *cwd;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -454,8 +454,8 @@ xproglist(int argc, char *argv[]) {
|
|||||||
/* Don't use Blprint. wimenu expects UTF-8. */
|
/* Don't use Blprint. wimenu expects UTF-8. */
|
||||||
if(!chdir(cwd) && !chdir(dir) && (d = opendir(dir))) {
|
if(!chdir(cwd) && !chdir(dir) && (d = opendir(dir))) {
|
||||||
while((de = readdir(d))) {
|
while((de = readdir(d))) {
|
||||||
lstat(de->d_name, &stat);
|
stat(de->d_name, &st);
|
||||||
if(S_ISREG(stat.st_mode) && !access(de->d_name, X_OK))
|
if(S_ISREG(st.st_mode) && !access(de->d_name, X_OK))
|
||||||
Bprint(outbuf, "%q\n", de->d_name);
|
Bprint(outbuf, "%q\n", de->d_name);
|
||||||
}
|
}
|
||||||
closedir(d);
|
closedir(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user