Patch from J.W. Schultz to have --include-from and --exclude-from on
[rsync/rsync.git] / exclude.c
index 27dd303..23ee743 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -220,8 +220,14 @@ struct exclude_struct **make_exclude_list(const char *fname,
                                          int fatal, int include)
 {
        struct exclude_struct **list=list1;
-       FILE *f = fopen(fname,"r");
+       FILE *f;
        char line[MAXPATHLEN];
+
+       if (strcmp(fname, "-")) {
+               f = fopen(fname,"r");
+       } else {
+               f = fdopen(0, "r");
+       }
        if (!f) {
                if (fatal) {
                        rsyserr(FERROR, errno,
@@ -335,7 +341,7 @@ char *get_exclude_tok(char *p)
                return(NULL);
 
        /* Skip over any initial spaces */
-       while(isspace((int) *s))
+       while (isspace(* (unsigned char *) s))
                s++;
 
        /* Are we at the end of the string? */
@@ -348,7 +354,7 @@ char *get_exclude_tok(char *p)
                        s+=2;
        
                /* Skip to the next space or the end of the string */
-               while(!isspace((int) *s) && *s != '\0')
+               while (!isspace(* (unsigned char *) s) && *s != '\0')
                        s++;
        } else {
                t=NULL;