From eadf090413c530e69e8568492ebeb4b4087bd2ad Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Mon, 13 Jun 2011 21:50:31 +0100 Subject: new dmenu_run --- lsx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lsx.c') diff --git a/lsx.c b/lsx.c index 7b84acc..325c508 100644 --- a/lsx.c +++ b/lsx.c @@ -6,7 +6,7 @@ #include #include -static void lsx(const char *s); +static void lsx(const char *dir); int main(int argc, char *argv[]) { @@ -34,9 +34,7 @@ lsx(const char *dir) { } while((d = readdir(dp))) { snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name); - if(stat(buf, &st) == -1) - perror(buf); - else if(S_ISREG(st.st_mode) && access(buf, X_OK) == 0) + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) puts(d->d_name); } closedir(dp); -- cgit v1.2.3-13-gbd6f