rh

Check-in [2e4bd9935a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add -0 for rooting through filenames with spaces.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:2e4bd9935a55c1a7806948c7586ac8710db354865d602117c6902dd12c362916
User & Date: vandyswa@gmail.com 2017-04-24 20:38:29
Context
2017-04-29
14:49
hassubdir() broken on fuse filesystems. check-in: 8434e47cb5 user: vandyswa@gmail.com tags: master, trunk
2017-04-24
20:38
Add -0 for rooting through filenames with spaces. check-in: 2e4bd9935a user: vandyswa@gmail.com tags: master, trunk
20:26
My private rhrc macros check-in: 7aea832c71 user: vandyswa@gmail.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rh.c.

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
125
126
127
128
129
130
131

132
133
134
135
136
137
138
...
393
394
395
396
397
398
399

400



401
402

403
404
405
406
407
408
409
...
902
903
904
905
906
907
908




909
910
911
912
913
914
915
...
927
928
929
930
931
932
933

934
935
936
937
938
939
940

int		Trace = 0;
#endif

#if defined(S_IFLNK)

#if defined(DEBUG)
#define SWITCHES "CDFLTUVWXYZbcde:f:hilp:qrstvwx:"
#else
#define SWITCHES "CDFLVbcde:f:hilp:qrstvwx:"
#endif

static char *usage =
    "Usage: %s [-CDFLVbcdhilqrsvw] [-f filename] [-e expression]\n"
    "\t\t[-p format] [-x command] [directory/file ...]\n";

#else

#if defined(DEBUG)
#define SWITCHES "CTUVWXYZbcde:f:hilp:qrstvwx:"
#else
#define SWITCHES "CVbcde:f:hilp:qrstvwx:"
#endif

static char *usage = 
    "Usage: %s [-CVbcdhilqrsvw] [-f filename] [-e expression]\n"
    "\t\t[-p format] [-x command] [directory/file ...]\n";
#endif

 
/*
 * printhelp:
 *	Print out the help screen. The string 's' is argv[0].
................................................................................
		   "\t-q\tdisplay non-graphic characters in filenames as ?\n"
		   "\t-r\tdo not go down the directory tree (non-recursive)\n"
		   "\t-s\tprint users/groups as strings instead of numbers\n"
		   "\t-t\tprint full date/time instead of ls(1) type date/time\n"
		   "\t-v\tverbose output\n"
		   "\t-w\tdisplay warning messages\n"
		   "\t-x command\texecute 'command' for matching files\n"

		   "\nvalid symbols:\n"
		   );
		   
    for (i = 1, p = Symbol_table; p != (symbol *) NULL; p = p->next, i++) {
	(void) fprintf(stderr, "%12s%s", p->name,
		      (((i - 1) % 5) == 4
		       || p->next == (symbol *) NULL) ? "\n" : " ");
................................................................................
 */

/* print file out by itself */

static void exam1(void)
{
    if (execute()) {

	(void) printf("%s\n", attr.graphic ? graphic(attr.fname) : attr.fname);



    }
    return;

}

/* long output of file */

static void exam2(void)
{
    if (execute()) {
................................................................................
	case 'x': 
	    if (attr.command != (char *) NULL) {
		error("only one -x option is allowed");
	    }
	    examptr = exam4;
	    attr.command = optarg;
	    break;




	    
#if defined(DEBUG)
	case 'T':
	    ++Trace;
	    break;

	case 'U':
................................................................................
	case 'Y':
	    ++rh_debug;
	    break;

	case 'Z':
	    ++yy_flex_debug;
	    break;

#endif

	default:
	    warning("use -h for help");
	    exit(1);
	}
	







|

|



|





|

|



|







 







>







 







>
|
>
>
>
|
<
>







 







>
>
>
>







 







>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
394
395
396
397
398
399
400
401
402
403
404
405
406

407
408
409
410
411
412
413
414
...
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
...
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950

int		Trace = 0;
#endif

#if defined(S_IFLNK)

#if defined(DEBUG)
#define SWITCHES "0CDFLTUVWXYZbcde:f:hilp:qrstvwx:"
#else
#define SWITCHES "0CDFLVbcde:f:hilp:qrstvwx:"
#endif

static char *usage =
    "Usage: %s [-0CDFLVbcdhilqrsvw] [-f filename] [-e expression]\n"
    "\t\t[-p format] [-x command] [directory/file ...]\n";

#else

#if defined(DEBUG)
#define SWITCHES "0CTUVWXYZbcde:f:hilp:qrstvwx:"
#else
#define SWITCHES "0CVbcde:f:hilp:qrstvwx:"
#endif

static char *usage = 
    "Usage: %s [-0CVbcdhilqrsvw] [-f filename] [-e expression]\n"
    "\t\t[-p format] [-x command] [directory/file ...]\n";
#endif

 
/*
 * printhelp:
 *	Print out the help screen. The string 's' is argv[0].
................................................................................
		   "\t-q\tdisplay non-graphic characters in filenames as ?\n"
		   "\t-r\tdo not go down the directory tree (non-recursive)\n"
		   "\t-s\tprint users/groups as strings instead of numbers\n"
		   "\t-t\tprint full date/time instead of ls(1) type date/time\n"
		   "\t-v\tverbose output\n"
		   "\t-w\tdisplay warning messages\n"
		   "\t-x command\texecute 'command' for matching files\n"
		   "\t-0\tseparate filenames by null char, not newline\n"
		   "\nvalid symbols:\n"
		   );
		   
    for (i = 1, p = Symbol_table; p != (symbol *) NULL; p = p->next, i++) {
	(void) fprintf(stderr, "%12s%s", p->name,
		      (((i - 1) % 5) == 4
		       || p->next == (symbol *) NULL) ? "\n" : " ");
................................................................................
 */

/* print file out by itself */

static void exam1(void)
{
    if (execute()) {
	(void) printf("%s%c",
	    attr.graphic ? graphic(attr.fname) : attr.fname,
	    attr.zero_term ? '\0' : '\n');
	if (attr.zero_term) {
	    (void)fflush(stdout);
	}

    }
}

/* long output of file */

static void exam2(void)
{
    if (execute()) {
................................................................................
	case 'x': 
	    if (attr.command != (char *) NULL) {
		error("only one -x option is allowed");
	    }
	    examptr = exam4;
	    attr.command = optarg;
	    break;

	case '0':
	    attr.zero_term = TRUE;
	    break;
	    
#if defined(DEBUG)
	case 'T':
	    ++Trace;
	    break;

	case 'U':
................................................................................
	case 'Y':
	    ++rh_debug;
	    break;

	case 'Z':
	    ++yy_flex_debug;
	    break;

#endif

	default:
	    warning("use -h for help");
	    exit(1);
	}
	

Changes to rh.h.

249
250
251
252
253
254
255

256
   char			graphic;	/* display non-graphic characters in filenames as ? */
   char			ignore_case;	/* ignore case when comparing filenames */
   char			prune;		/* flag to indicate prunning */
   char			stat_all;	/* stat() all files */
   char			str_owner;	/* print user/group strings instead of numbers */
   char			verbose;	/* used by the (*func)() routine */
   char			full_date;	/* print full date instead of ls(1) type date */

};







>

249
250
251
252
253
254
255
256
257
   char			graphic;	/* display non-graphic characters in filenames as ? */
   char			ignore_case;	/* ignore case when comparing filenames */
   char			prune;		/* flag to indicate prunning */
   char			stat_all;	/* stat() all files */
   char			str_owner;	/* print user/group strings instead of numbers */
   char			verbose;	/* used by the (*func)() routine */
   char			full_date;	/* print full date instead of ls(1) type date */
   char			zero_term;	/* flag separate files by \0 */
};