all repos — dmenu @ 5ed5e90bfb7760f24661281cf7156087afbe49d3

my build of dmenu

applied Martin Kühl's inverse matching flag to stest
Anselm R Garbe anselm@garbe.us
Tue, 13 Aug 2013 19:15:04 +0200
commit

5ed5e90bfb7760f24661281cf7156087afbe49d3

parent

13f787306f46a5f838987e3b546d85d1bb1c3c01

2 files changed, 7 insertions(+), 4 deletions(-)

jump to
M stest.1stest.1

@@ -67,6 +67,9 @@ .TP

.B \-u Test that files have their set-user-ID flag set. .TP +.B \-v +Invert the sense of tests, only failing files pass. +.TP .B \-w Test that files are writable. .TP
M stest.cstest.c

@@ -22,7 +22,7 @@ char buf[BUFSIZ], *p;

DIR *dir; int opt; - while((opt = getopt(argc, argv, "abcdefghln:o:pqrsuwx")) != -1) + while((opt = getopt(argc, argv, "abcdefghln:o:pqrsuvwx")) != -1) switch(opt) { case 'n': /* newer than file */ case 'o': /* older than file */

@@ -33,7 +33,7 @@ default: /* miscellaneous operators */

FLAG(opt) = true; break; case '?': /* error: unknown flag */ - fprintf(stderr, "usage: %s [-abcdefghlpqrsuwx] [-n file] [-o file] [file...]\n", argv[0]); + fprintf(stderr, "usage: %s [-abcdefghlpqrsuvwx] [-n file] [-o file] [file...]\n", argv[0]); exit(2); } if(optind == argc)

@@ -60,7 +60,7 @@ void

test(const char *path, const char *name) { struct stat st, ln; - if(!stat(path, &st) && (FLAG('a') || name[0] != '.') /* hidden files */ + if((!stat(path, &st) && (FLAG('a') || name[0] != '.') /* hidden files */ && (!FLAG('b') || S_ISBLK(st.st_mode)) /* block special */ && (!FLAG('c') || S_ISCHR(st.st_mode)) /* character special */ && (!FLAG('d') || S_ISDIR(st.st_mode)) /* directory */

@@ -75,7 +75,7 @@ && (!FLAG('r') || access(path, R_OK) == 0) /* readable */

&& (!FLAG('s') || st.st_size > 0) /* not empty */ && (!FLAG('u') || st.st_mode & S_ISUID) /* set-user-id flag */ && (!FLAG('w') || access(path, W_OK) == 0) /* writable */ - && (!FLAG('x') || access(path, X_OK) == 0)) { /* executable */ + && (!FLAG('x') || access(path, X_OK) == 0)) != FLAG('v')) { /* executable */ if(FLAG('q')) exit(0); match = true;