aboutsummaryrefslogtreecommitdiff
path: root/lsx.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2011-06-13 21:50:31 +0100
committerConnor Lane Smith <cls@lubutu.com>2011-06-13 21:50:31 +0100
commiteadf090413c530e69e8568492ebeb4b4087bd2ad (patch)
treecce8671f1d59e40a0bdc0be6c9ef379812ff8010 /lsx.c
parent8ec1b41cacb33be39bc53fc67a4fe51d2d3ab3a0 (diff)
downloaddmenu-eadf090413c530e69e8568492ebeb4b4087bd2ad.tar.gz
dmenu-eadf090413c530e69e8568492ebeb4b4087bd2ad.tar.bz2
dmenu-eadf090413c530e69e8568492ebeb4b4087bd2ad.zip
new dmenu_run
Diffstat (limited to 'lsx.c')
-rw-r--r--lsx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lsx.c b/lsx.c
index 7b84acc..325c508 100644
--- a/lsx.c
+++ b/lsx.c
@@ -6,7 +6,7 @@
#include <unistd.h>
#include <sys/stat.h>
-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);