--- 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; }
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@pegasys.ws Remember Cernan and Schmitt
On Sun, Nov 03, 2002 at 07:36:40PM -0800, jw schultz wrote:> 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 @@> Already done and in CVS.What happens when you want to --include from stdin? Tim.
On Sun, Nov 03, 2002 at 07:42:46PM -0800, Tim Potter wrote:> On Sun, Nov 03, 2002 at 07:36:40PM -0800, jw schultz wrote: > > > 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 @@ > > > Already done and in CVS. > > What happens when you want to --include from stdin?That works too. Same functions with a flag. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt