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

Diff for /mandoc/main.c between version 1.165 and 1.166

version 1.165, 2011/10/06 22:29:12 version 1.166, 2012/05/27 17:48:57
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 85  main(int argc, char *argv[])
Line 85  main(int argc, char *argv[])
         struct curparse  curp;          struct curparse  curp;
         enum mparset     type;          enum mparset     type;
         enum mandoclevel rc;          enum mandoclevel rc;
           char            *defos;
   
         progname = strrchr(argv[0], '/');          progname = strrchr(argv[0], '/');
         if (progname == NULL)          if (progname == NULL)
Line 97  main(int argc, char *argv[])
Line 98  main(int argc, char *argv[])
         type = MPARSE_AUTO;          type = MPARSE_AUTO;
         curp.outtype = OUTT_ASCII;          curp.outtype = OUTT_ASCII;
         curp.wlevel  = MANDOCLEVEL_FATAL;          curp.wlevel  = MANDOCLEVEL_FATAL;
           defos = NULL;
   
         /* LINTED */          /* LINTED */
         while (-1 != (c = getopt(argc, argv, "m:O:T:VW:")))          while (-1 != (c = getopt(argc, argv, "I:m:O:T:VW:")))
                 switch (c) {                  switch (c) {
                   case ('I'):
                           if (strncmp(optarg, "os=", 3)) {
                                   fprintf(stderr, "-I%s: Bad argument\n",
                                                   optarg);
                                   return((int)MANDOCLEVEL_BADARG);
                           }
                           if (defos) {
                                   fprintf(stderr, "-I%s: Duplicate argument\n",
                                                   optarg);
                                   return((int)MANDOCLEVEL_BADARG);
                           }
                           defos = mandoc_strdup(optarg + 3);
                           break;
                 case ('m'):                  case ('m'):
                         if ( ! moptions(&type, optarg))                          if ( ! moptions(&type, optarg))
                                 return((int)MANDOCLEVEL_BADARG);                                  return((int)MANDOCLEVEL_BADARG);
Line 125  main(int argc, char *argv[])
Line 140  main(int argc, char *argv[])
                         /* NOTREACHED */                          /* NOTREACHED */
                 }                  }
   
         curp.mp = mparse_alloc(type, curp.wlevel, mmsg, &curp);          curp.mp = mparse_alloc(type, curp.wlevel, mmsg, &curp, defos);
   
         /*          /*
          * Conditionally start up the lookaside buffer before parsing.           * Conditionally start up the lookaside buffer before parsing.
Line 152  main(int argc, char *argv[])
Line 167  main(int argc, char *argv[])
                 (*curp.outfree)(curp.outdata);                  (*curp.outfree)(curp.outdata);
         if (curp.mp)          if (curp.mp)
                 mparse_free(curp.mp);                  mparse_free(curp.mp);
           free(defos);
   
         return((int)rc);          return((int)rc);
 }  }

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

CVSweb