[hackers] [dmenu] simpler lsx || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Sat, 18 Jun 2011 08:50:59 +0200 (CEST)

changeset: 418:fa3702a421d0
branch: lsx
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Sat Jun 18 07:50:46 2011 +0100
files: dmenu.1 lsx.1 lsx.c
description:
simpler lsx

diff -r e2349b5ba352 -r fa3702a421d0 dmenu.1
--- a/dmenu.1 Mon Jun 13 21:50:31 2011 +0100
+++ b/dmenu.1 Sat Jun 18 07:50:46 2011 +0100
@@ -95,4 +95,5 @@
 .B Ctrl\-y
 Paste the current X selection into the input field.
 .SH SEE ALSO
-.IR dwm (1)
+.IR dwm (1),
+.IR lsx (1)
diff -r e2349b5ba352 -r fa3702a421d0 lsx.1
--- a/lsx.1 Mon Jun 13 21:50:31 2011 +0100
+++ b/lsx.1 Sat Jun 18 07:50:46 2011 +0100
@@ -3,13 +3,9 @@
 lsx \- list executables
 .SH SYNOPSIS
 .B lsx
-.RB [ \-v ]
 .RI [ directory ...]
 .SH DESCRIPTION
 .B lsx
-lists the executables in each directory. If no directories are given the current
-working directory is used.
-.SH OPTIONS
-.TP
-.B \-v
-prints version information to stdout, then exits.
+lists the executables in each
+.IR directory .
+If none are given the current working directory is used.
diff -r e2349b5ba352 -r fa3702a421d0 lsx.c
--- a/lsx.c Mon Jun 13 21:50:31 2011 +0100
+++ b/lsx.c Sat Jun 18 07:50:46 2011 +0100
@@ -14,8 +14,6 @@
 
         if(argc < 2)
                 lsx(".");
- else if(!strcmp(argv[1], "-v"))
- puts("lsx-0.2, © 2006-2011 dmenu engineers, see LICENSE for details");
         else for(i = 1; i < argc; i++)
                 lsx(argv[i]);
         return EXIT_SUCCESS;
@@ -34,7 +32,7 @@
         }
         while((d = readdir(dp))) {
                 snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name);
- if(stat(buf, &st) == 0 && S_ISREG(st.st_mode) && access(buf, X_OK) == 0)
+ if(!stat(buf, &st) && S_ISREG(st.st_mode) && access(buf, X_OK) == 0)
                         puts(d->d_name);
         }
         closedir(dp);
Received on Sat Jun 18 2011 - 08:50:59 CEST

This archive was generated by hypermail 2.2.0 : Sat Jun 18 2011 - 09:00:08 CEST