=================================================================== RCS file: /cvs/mandoc/mandoc.c,v retrieving revision 1.60 retrieving revision 1.63 diff -u -p -r1.60 -r1.63 --- mandoc/mandoc.c 2011/10/24 20:30:57 1.60 +++ mandoc/mandoc.c 2012/05/31 22:29:13 1.63 @@ -1,7 +1,7 @@ -/* $Id: mandoc.c,v 1.60 2011/10/24 20:30:57 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.63 2012/05/31 22:29:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2011 Ingo Schwarze + * Copyright (c) 2011, 2012 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -143,6 +143,16 @@ mandoc_escape(const char **end, const char **start, in break; /* + * The \z escape is supposed to output the following + * character without advancing the cursor position. + * Since we are mostly dealing with terminal mode, + * let us just skip the next character. + */ + case ('z'): + (*end)++; + return(ESCAPE_SKIPCHAR); + + /* * Handle all triggers matching \X(xy, \Xx, and \X[xxxx], where * 'X' is the trigger. These have opaque sub-strings. */ @@ -369,8 +379,15 @@ out: switch (gly) { case (ESCAPE_FONT): - if (1 != rlim) + /* + * Pretend that the constant-width font modes are the + * same as the regular font modes. + */ + if (2 == rlim && 'C' == *rstart) + rstart++; + else if (1 != rlim) break; + switch (*rstart) { case ('3'): /* FALLTHROUGH */ @@ -616,9 +633,10 @@ mandoc_normdate(struct mparse *parse, char *in, int ln mandoc_msg(MANDOCERR_NODATE, parse, ln, pos, NULL); time(&t); } + else if (a2time(&t, "%Y-%m-%d", in)) + t = 0; else if (!a2time(&t, "$" "Mdocdate: %b %d %Y $", in) && - !a2time(&t, "%b %d, %Y", in) && - !a2time(&t, "%Y-%m-%d", in)) { + !a2time(&t, "%b %d, %Y", in)) { mandoc_msg(MANDOCERR_BADDATE, parse, ln, pos, NULL); t = 0; }