[BACK]Return to docmd.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rdist

Diff for /src/usr.bin/rdist/docmd.c between version 1.13 and 1.14

version 1.13, 2003/04/19 17:22:29 version 1.14, 2003/05/06 22:10:11
Line 836 
Line 836 
                 }                  }
                 if (sc->sc_type == PATTERN) {                  if (sc->sc_type == PATTERN) {
                         for (nl = sc->sc_args; nl != NULL; nl = nl->n_next) {                          for (nl = sc->sc_args; nl != NULL; nl = nl->n_next) {
                                 char *cp, *re_comp();                                  char ebuf[BUFSIZ];
                                   int ecode = 0;
   
                                 if ((cp = re_comp(nl->n_name)) != NULL) {                                  /* allocate and compile n_regex as needed */
                                   if (nl->n_regex == NULL) {
                                           nl->n_regex = (regex_t *)
                                               xmalloc(sizeof(regex_t));
                                           ecode = regcomp(nl->n_regex, nl->n_name,
                                                           REG_NOSUB);
                                   }
                                   if (ecode == 0) {
                                           ecode = regexec(nl->n_regex, file, 0,
                                               NULL, 0);
                                   }
                                   switch (ecode) {
                                   case REG_NOMATCH:
                                           break;
                                   case 0:
                                           return(1);      /* match! */
                                   default:
                                           regerror(ecode, nl->n_regex, ebuf,
                                                    sizeof(ebuf));
                                         error("Regex error \"%s\" for \"%s\".",                                          error("Regex error \"%s\" for \"%s\".",
                                               cp, nl->n_name);                                                ebuf, nl->n_name);
                                         return(0);  
                                 }                                  }
                                 if (re_exec(file) > 0)  
                                         return(1);  
                         }                          }
                 }                  }
         }          }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14