=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.188 retrieving revision 1.189 diff -c -r1.188 -r1.189 *** src/usr.bin/mandoc/main.c 2017/03/03 14:21:41 1.188 --- src/usr.bin/mandoc/main.c 2017/03/20 14:30:43 1.189 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.188 2017/03/03 14:21:41 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.189 2017/03/20 14:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze *************** *** 87,93 **** const struct manpaths *, int, char**, struct manpage **, size_t *); static int koptions(int *, char *); ! static int moptions(int *, char *); static void mmsg(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); static void outdata_alloc(struct curparse *); --- 87,93 ---- const struct manpaths *, int, char**, struct manpage **, size_t *); static int koptions(int *, char *); ! static void moptions(int *, char *); static void mmsg(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); static void outdata_alloc(struct curparse *); *************** *** 412,419 **** err((int)MANDOCLEVEL_SYSERR, "pledge"); } ! if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) ! return (int)MANDOCLEVEL_BADARG; mchars_alloc(); curp.mp = mparse_alloc(options, curp.wlevel, mmsg, defos); --- 412,419 ---- err((int)MANDOCLEVEL_SYSERR, "pledge"); } ! if (search.argmode == ARG_FILE) ! moptions(&options, auxpaths); mchars_alloc(); curp.mp = mparse_alloc(options, curp.wlevel, mmsg, defos); *************** *** 889,912 **** return 1; } ! static int moptions(int *options, char *arg) { if (arg == NULL) ! /* nothing to do */; ! else if (0 == strcmp(arg, "doc")) *options |= MPARSE_MDOC; ! else if (0 == strcmp(arg, "andoc")) ! /* nothing to do */; ! else if (0 == strcmp(arg, "an")) *options |= MPARSE_MAN; - else { - warnx("-m %s: Bad argument", arg); - return 0; - } - - return 1; } static int --- 889,904 ---- return 1; } ! static void moptions(int *options, char *arg) { if (arg == NULL) ! return; ! if (strcmp(arg, "doc") == 0) *options |= MPARSE_MDOC; ! else if (strcmp(arg, "an") == 0) *options |= MPARSE_MAN; } static int