version 1.76, 2018/10/25 01:21:30 |
version 1.77, 2018/12/14 05:17:45 |
|
|
|
|
/* Quoted argument without a closing quote. */ |
/* Quoted argument without a closing quote. */ |
if (1 == quoted) |
if (1 == quoted) |
mandoc_msg(MANDOCERR_ARG_QUOTE, parse, ln, *pos, NULL); |
mandoc_msg(MANDOCERR_ARG_QUOTE, ln, *pos, NULL); |
|
|
/* NUL-terminate this argument and move to the next one. */ |
/* NUL-terminate this argument and move to the next one. */ |
if (pairs) |
if (pairs) |
|
|
*cpp = cp; |
*cpp = cp; |
|
|
if ('\0' == *cp && (white || ' ' == cp[-1])) |
if ('\0' == *cp && (white || ' ' == cp[-1])) |
mandoc_msg(MANDOCERR_SPACE_EOL, parse, ln, *pos, NULL); |
mandoc_msg(MANDOCERR_SPACE_EOL, ln, *pos, NULL); |
|
|
return start; |
return start; |
} |
} |
|
|
/* No date specified: use today's date. */ |
/* No date specified: use today's date. */ |
|
|
if (in == NULL || *in == '\0' || strcmp(in, "$" "Mdocdate$") == 0) { |
if (in == NULL || *in == '\0' || strcmp(in, "$" "Mdocdate$") == 0) { |
mandoc_msg(MANDOCERR_DATE_MISSING, man->parse, ln, pos, NULL); |
mandoc_msg(MANDOCERR_DATE_MISSING, ln, pos, NULL); |
return time2a(time(NULL)); |
return time2a(time(NULL)); |
} |
} |
|
|
|
|
a2time(&t, "%b %d, %Y", in)) { |
a2time(&t, "%b %d, %Y", in)) { |
cp = time2a(t); |
cp = time2a(t); |
if (t > time(NULL) + 86400) |
if (t > time(NULL) + 86400) |
mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, |
mandoc_msg(MANDOCERR_DATE_FUTURE, ln, pos, "%s", cp); |
ln, pos, cp); |
|
else if (*in != '$' && strcmp(in, cp) != 0) |
else if (*in != '$' && strcmp(in, cp) != 0) |
mandoc_msg(MANDOCERR_DATE_NORM, man->parse, |
mandoc_msg(MANDOCERR_DATE_NORM, ln, pos, "%s", cp); |
ln, pos, cp); |
|
return cp; |
return cp; |
} |
} |
|
|
/* In man(7), do not warn about the legacy format. */ |
/* In man(7), do not warn about the legacy format. */ |
|
|
if (a2time(&t, "%Y-%m-%d", in) == 0) |
if (a2time(&t, "%Y-%m-%d", in) == 0) |
mandoc_msg(MANDOCERR_DATE_BAD, man->parse, ln, pos, in); |
mandoc_msg(MANDOCERR_DATE_BAD, ln, pos, "%s", in); |
else if (t > time(NULL) + 86400) |
else if (t > time(NULL) + 86400) |
mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, ln, pos, in); |
mandoc_msg(MANDOCERR_DATE_FUTURE, ln, pos, "%s", in); |
else if (man->macroset == MACROSET_MDOC) |
else if (man->macroset == MACROSET_MDOC) |
mandoc_vmsg(MANDOCERR_DATE_LEGACY, man->parse, |
mandoc_msg(MANDOCERR_DATE_LEGACY, ln, pos, "Dd %s", in); |
ln, pos, "Dd %s", in); |
|
|
|
/* Use any non-mdoc(7) date verbatim. */ |
/* Use any non-mdoc(7) date verbatim. */ |
|
|