=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/mandoc/main.c 2009/06/18 23:34:53 1.5 --- src/usr.bin/mandoc/main.c 2009/06/18 23:51:12 1.6 *************** *** 1,4 **** ! /* $Id: main.c,v 1.5 2009/06/18 23:34:53 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: main.c,v 1.6 2009/06/18 23:51:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 61,72 **** #define NO_IGN_ESCAPE (1 << 1) /* Don't ignore bad escapes. */ #define NO_IGN_MACRO (1 << 2) /* Don't ignore bad macros. */ #define NO_IGN_CHARS (1 << 3) /* Don't ignore bad chars. */ ! enum intt inttype; /* Input parsers. */ struct man *man; struct man *lastman; struct mdoc *mdoc; struct mdoc *lastmdoc; ! enum outt outtype; /* Output devices. */ out_mdoc outmdoc; out_man outman; out_free outfree; --- 61,72 ---- #define NO_IGN_ESCAPE (1 << 1) /* Don't ignore bad escapes. */ #define NO_IGN_MACRO (1 << 2) /* Don't ignore bad macros. */ #define NO_IGN_CHARS (1 << 3) /* Don't ignore bad chars. */ ! enum intt inttype; /* Input parsers... */ struct man *man; struct man *lastman; struct mdoc *mdoc; struct mdoc *lastmdoc; ! enum outt outtype; /* Output devices... */ out_mdoc outmdoc; out_man outman; out_free outfree; *************** *** 146,153 **** argc -= optind; argv += optind; - /* Configure buffers. */ - bzero(&ln, sizeof(struct buf)); bzero(&blk, sizeof(struct buf)); --- 146,151 ---- *************** *** 177,184 **** free(blk.buf); if (ln.buf) free(ln.buf); - - /* TODO: have a curp_free routine. */ if (curp.outfree) (*curp.outfree)(curp.outdata); if (curp.mdoc) --- 175,180 ---- *************** *** 220,234 **** mancb.man_err = merr; mancb.man_warn = manwarn; ! /* ! * Default behaviour is to ignore unknown macros. This is ! * specified in mandoc.1. ! */ pflags = MAN_IGN_MACRO; - /* Override default behaviour... */ - if (curp->fflags & NO_IGN_MACRO) pflags &= ~MAN_IGN_MACRO; --- 216,225 ---- mancb.man_err = merr; mancb.man_warn = manwarn; ! /* Defaults from mandoc.1. */ pflags = MAN_IGN_MACRO; if (curp->fflags & NO_IGN_MACRO) pflags &= ~MAN_IGN_MACRO; *************** *** 249,264 **** mdoccb.mdoc_err = merr; mdoccb.mdoc_warn = mdocwarn; ! /* ! * Default behaviour is to ignore unknown macros, escape ! * sequences and characters (very liberal). This is specified ! * in mandoc.1. ! */ pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS; - /* Override default behaviour... */ - if (curp->fflags & IGN_SCOPE) pflags |= MDOC_IGN_SCOPE; if (curp->fflags & NO_IGN_ESCAPE) --- 240,249 ---- mdoccb.mdoc_err = merr; mdoccb.mdoc_warn = mdocwarn; ! /* Defaults from mandoc.1. */ pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS; if (curp->fflags & IGN_SCOPE) pflags |= MDOC_IGN_SCOPE; if (curp->fflags & NO_IGN_ESCAPE) *************** *** 558,567 **** } - /* - * Parse out the options for [-fopt...] setting compiler options. These - * can be comma-delimited or called again. - */ static int foptions(int *fflags, char *arg) { --- 543,548 ---- *************** *** 602,611 **** } - /* - * Parse out the options for [-Werr...], which sets warning modes. - * These can be comma-delimited or called again. - */ static int woptions(int *wflags, char *arg) { --- 583,588 ---- *************** *** 651,657 **** warnx("%s:%d: error: %s (column %d)", curp->file, line, msg, col); - /* Always exit on errors... */ return(0); } --- 628,633 ---- *************** *** 686,698 **** if ( ! (curp->wflags & WARN_WERR)) return(1); ! /* ! * If the -Werror flag is passed in, as in gcc, then all ! * warnings are considered as errors. ! */ ! ! warnx("%s: considering warnings as errors", ! __progname); return(0); } --- 662,668 ---- if ( ! (curp->wflags & WARN_WERR)) return(1); ! warnx("considering warnings as errors"); return(0); } *************** *** 713,724 **** if ( ! (curp->wflags & WARN_WERR)) return(1); ! /* ! * If the -Werror flag is passed in, as in gcc, then all ! * warnings are considered as errors. ! */ ! ! warnx("%s: considering warnings as errors", ! __progname); return(0); } --- 683,688 ---- if ( ! (curp->wflags & WARN_WERR)) return(1); ! warnx("considering warnings as errors"); return(0); }