making --exclude-from=- read from stdin
jw schultz
jw at pegasys.ws
Mon Nov 4 03:40:03 EST 2002
On Mon, Nov 04, 2002 at 04:31:38AM +0100, Christian wrote:
> --- exclude.c.org 2002-11-04 04:17:05.000000000 +0100
> +++ exclude.c 2002-11-04 04:21:13.000000000 +0100
> @@ -219,8 +219,15 @@
> int fatal, int include)
> {
> struct exclude_struct **list=list1;
> - FILE *f = fopen(fname,"r");
> + FILE *f;
> char line[MAXPATHLEN];
> +
> + if( fname[0]=='-' && fname[1]=='\0'){
> + f= stdin;
> + }
> + else {
> + f= fopen(fname,"r");
> + }
> if (!f) {
> if (fatal) {
> rsyserr(FERROR, errno,
> @@ -243,7 +250,9 @@
> add_exclude_list(line,&list,include);
> }
> }
> - fclose(f);
> + if( ! (fname[0]=='-' && fname[1]=='\0' )) {
> + fclose(f);
> + }
> return list;
> }
Already done and in CVS.
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw at pegasys.ws
Remember Cernan and Schmitt
More information about the rsync
mailing list