Print this page
9718 update mandoc to 1.14.4

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/mandoc.c
          +++ new/usr/src/cmd/mandoc/mandoc.c
   1      -/*      $Id: mandoc.c,v 1.103 2017/07/03 13:40:19 schwarze Exp $ */
        1 +/*      $Id: mandoc.c,v 1.104 2018/07/28 18:34:15 schwarze Exp $ */
   2    2  /*
   3    3   * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
   4      - * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
        4 + * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
   5    5   *
   6    6   * Permission to use, copy, modify, and distribute this software for any
   7    7   * purpose with or without fee is hereby granted, provided that the above
   8    8   * copyright notice and this permission notice appear in all copies.
   9    9   *
  10   10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  11   11   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12   12   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  13   13   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14   14   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
↓ open down ↓ 519 lines elided ↑ open up ↑
 534  534          }
 535  535  
 536  536          /* Valid mdoc(7) date format. */
 537  537  
 538  538          if (a2time(&t, "$" "Mdocdate: %b %d %Y $", in) ||
 539  539              a2time(&t, "%b %d, %Y", in)) {
 540  540                  cp = time2a(t);
 541  541                  if (t > time(NULL) + 86400)
 542  542                          mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse,
 543  543                              ln, pos, cp);
      544 +                else if (*in != '$' && strcmp(in, cp) != 0)
      545 +                        mandoc_msg(MANDOCERR_DATE_NORM, man->parse,
      546 +                            ln, pos, cp);
 544  547                  return cp;
 545  548          }
 546  549  
 547  550          /* In man(7), do not warn about the legacy format. */
 548  551  
 549  552          if (a2time(&t, "%Y-%m-%d", in) == 0)
 550  553                  mandoc_msg(MANDOCERR_DATE_BAD, man->parse, ln, pos, in);
 551  554          else if (t > time(NULL) + 86400)
 552  555                  mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, ln, pos, in);
 553  556          else if (man->macroset == MACROSET_MDOC)
↓ open down ↓ 77 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX