[BACK]Return to manpath.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/manpath.c between version 1.37 and 1.38

version 1.37, 2018/11/22 11:30:23 version 1.38, 2019/05/03 18:23:53
Line 235  manconf_output(struct manoutput *conf, const char *cp,
Line 235  manconf_output(struct manoutput *conf, const char *cp,
             "includes", "man", "paper", "style", "indent", "width",              "includes", "man", "paper", "style", "indent", "width",
             "tag", "fragment", "mdoc", "noval", "toc"              "tag", "fragment", "mdoc", "noval", "toc"
         };          };
           const size_t ntoks = sizeof(toks) / sizeof(toks[0]);
   
         const char      *errstr;          const char      *errstr;
         char            *oldval;          char            *oldval;
         size_t           len, tok;          size_t           len, tok;
   
         for (tok = 0; tok < sizeof(toks)/sizeof(toks[0]); tok++) {          for (tok = 0; tok < ntoks; tok++) {
                 len = strlen(toks[tok]);                  len = strlen(toks[tok]);
                 if ( ! strncmp(cp, toks[tok], len) &&                  if ( ! strncmp(cp, toks[tok], len) &&
                     strchr(" =  ", cp[len]) != NULL) {                      strchr(" =  ", cp[len]) != NULL) {
Line 257  manconf_output(struct manoutput *conf, const char *cp,
Line 258  manconf_output(struct manoutput *conf, const char *cp,
                 warnx("-O %s=?: Missing argument value", toks[tok]);                  warnx("-O %s=?: Missing argument value", toks[tok]);
                 return -1;                  return -1;
         }          }
         if (tok > 6 && *cp != '\0') {          if (tok > 6 && tok < ntoks && *cp != '\0') {
                 warnx("-O %s: Does not take a value: %s", toks[tok], cp);                  warnx("-O %s: Does not take a value: %s", toks[tok], cp);
                 return -1;                  return -1;
         }          }

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

CVSweb