[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.39

version 1.37, 2018/11/22 11:30:23 version 1.39, 2019/05/03 18:39:34
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;
         }          }
Line 331  manconf_output(struct manoutput *conf, const char *cp,
Line 332  manconf_output(struct manoutput *conf, const char *cp,
                 conf->toc = 1;                  conf->toc = 1;
                 return 0;                  return 0;
         default:          default:
                 if (fromfile)                  warnx("-O %s: Bad argument", cp);
                         warnx("-O %s: Bad argument", cp);  
                 return -1;                  return -1;
         }          }
         if (fromfile == 0)          if (fromfile == 0)

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

CVSweb