From a8abc3fbebee0c90a4f19d6803e0f90d313ba868 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 14 May 2010 16:02:29 +0000 Subject: "Warn on unknown argument for .At and print it like [new] groff." (patch by Joerg Sonnenberger, ed. Kristaps) Keep short-log of commits in index.sgml. Document compatibility with new/old groff in mdoc.7. --- index.sgml | 7 ++++++- mdoc.7 | 6 ++++++ mdoc_action.c | 22 +++++++++++++++++----- mdoc_validate.c | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/index.sgml b/index.sgml index 767caf18..efbae229 100644 --- a/index.sgml +++ b/index.sgml @@ -241,7 +241,12 @@ xx-05-2010 - + Day 1 of Rostock hackathon: proper handling of quotations in tab-separated + column lists, finished patching of SYNOPSIS breaking (1.9.25), fixed pre-comment + white-space stripping, added end-of-sentence spacing to black partial-implicit + macros, relaxed column warnings, relaxed acceptence of bad standards arguments, + significant documentation of lists in mdoc(7). + Version: 1.9.26. diff --git a/mdoc.7 b/mdoc.7 index bb9f8cb0..3f25dff3 100644 --- a/mdoc.7 +++ b/mdoc.7 @@ -1960,6 +1960,12 @@ and .Sx \&Ex macros were stipulated only to occur in certain manual sections. mandoc does not have these restrictions. +.It +Newer groff and mandoc print +.Qq AT&T UNIX +prior to unknown arguments of +.Sx \&At ; +older groff did nothing. .El .Sh SEE ALSO .Xr mandoc 1 , diff --git a/mdoc_action.c b/mdoc_action.c index 4739e0b6..9d2a3420 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -382,15 +382,27 @@ post_st(POST_ARGS) static int post_at(POST_ARGS) { - struct mdoc_node *nn; - const char *p; + struct mdoc_node *nn; + const char *p, *q; + char *buf; + size_t sz; if (n->child) { assert(MDOC_TEXT == n->child->type); p = mdoc_a2att(n->child->string); - assert(p); - free(n->child->string); - n->child->string = mandoc_strdup(p); + if (p) { + free(n->child->string); + n->child->string = mandoc_strdup(p); + } else { + p = "AT&T UNIX "; + q = n->child->string; + sz = strlen(p) + strlen(q) + 1; + buf = mandoc_malloc(sz); + strlcpy(buf, p, sz); + strlcat(buf, q, sz); + free(n->child->string); + n->child->string = buf; + } return(1); } diff --git a/mdoc_validate.c b/mdoc_validate.c index ad33b1f4..a8c6b956 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -921,7 +921,7 @@ post_at(POST_ARGS) return(mdoc_nerr(mdoc, mdoc->last, EATT)); if (mdoc_a2att(mdoc->last->child->string)) return(1); - return(mdoc_nerr(mdoc, mdoc->last, EATT)); + return(mdoc_nwarn(mdoc, mdoc->last, EATT)); } -- cgit