@@ -22,7 +22,7 @@ main(int argc, char *argv[]) {
22
22
DIR * dir ;
23
23
int opt ;
24
24
25
- while ((opt = getopt (argc , argv , "abcdefghln:o:pqrsuwx " )) != -1 )
25
+ while ((opt = getopt (argc , argv , "abcdefghln:o:pqrsuvwx " )) != -1 )
26
26
switch (opt ) {
27
27
case 'n' : /* newer than file */
28
28
case 'o' : /* older than file */
@@ -33,7 +33,7 @@ main(int argc, char *argv[]) {
33
33
FLAG (opt ) = true;
34
34
break ;
35
35
case '?' : /* error: unknown flag */
36
- fprintf (stderr , "usage: %s [-abcdefghlpqrsuwx ] [-n file] [-o file] [file...]\n" , argv [0 ]);
36
+ fprintf (stderr , "usage: %s [-abcdefghlpqrsuvwx ] [-n file] [-o file] [file...]\n" , argv [0 ]);
37
37
exit (2 );
38
38
}
39
39
if (optind == argc )
60
60
test (const char * path , const char * name ) {
61
61
struct stat st , ln ;
62
62
63
- if (!stat (path , & st ) && (FLAG ('a' ) || name [0 ] != '.' ) /* hidden files */
63
+ if (( !stat (path , & st ) && (FLAG ('a' ) || name [0 ] != '.' ) /* hidden files */
64
64
&& (!FLAG ('b' ) || S_ISBLK (st .st_mode )) /* block special */
65
65
&& (!FLAG ('c' ) || S_ISCHR (st .st_mode )) /* character special */
66
66
&& (!FLAG ('d' ) || S_ISDIR (st .st_mode )) /* directory */
@@ -75,7 +75,7 @@ test(const char *path, const char *name) {
75
75
&& (!FLAG ('s' ) || st .st_size > 0 ) /* not empty */
76
76
&& (!FLAG ('u' ) || st .st_mode & S_ISUID ) /* set-user-id flag */
77
77
&& (!FLAG ('w' ) || access (path , W_OK ) == 0 ) /* writable */
78
- && (!FLAG ('x' ) || access (path , X_OK ) == 0 )) { /* executable */
78
+ && (!FLAG ('x' ) || access (path , X_OK ) == 0 )) != FLAG ( 'v' )) { /* executable */
79
79
if (FLAG ('q' ))
80
80
exit (0 );
81
81
match = true;
0 commit comments