summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rw-r--r--mdoc_argv.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/TODO b/TODO
index e4e224d2..d4aff2c0 100644
--- a/TODO
+++ b/TODO
@@ -203,11 +203,6 @@ None known.
- a column list with blank `Ta' cells triggers a spurrious
start-with-whitespace printing of a newline
-- double quotes inside double quotes are escaped by doubling them
- implement this in mdoc(7), too
- so far, we only have it in roff(7) and man(7)
- reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
-
- In .Bl -column,
.It Em Authentication<tab>Key Length
ought to render "Key Length" with emphasis, too,
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 55ecdc4a..d191858e 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -447,6 +447,7 @@ args(struct mdoc *mdoc, int line, int *pos,
char *buf, enum argsflag fl, char **v)
{
char *p, *pp;
+ int pairs;
enum margserr rc;
if ('\0' == buf[*pos]) {
@@ -540,6 +541,8 @@ args(struct mdoc *mdoc, int line, int *pos,
/*
* Process a quoted literal. A quote begins with a double-quote
* and ends with a double-quote NOT preceded by a double-quote.
+ * Null-terminate the literal in place.
+ * Collapse pairs of quotes inside quoted literals.
* Whitespace is NOT involved in literal termination.
*/
@@ -550,13 +553,22 @@ args(struct mdoc *mdoc, int line, int *pos,
if (MDOC_PPHRASE & mdoc->flags)
mdoc->flags |= MDOC_PHRASELIT;
+ pairs = 0;
for ( ; buf[*pos]; (*pos)++) {
+ /* Move following text left after quoted quotes. */
+ if (pairs)
+ buf[*pos - pairs] = buf[*pos];
if ('\"' != buf[*pos])
continue;
+ /* Unquoted quotes end quoted args. */
if ('\"' != buf[*pos + 1])
break;
+ /* Quoted quotes collapse. */
+ pairs++;
(*pos)++;
}
+ if (pairs)
+ buf[*pos - pairs] = '\0';
if ('\0' == buf[*pos]) {
if (MDOC_PPHRASE & mdoc->flags)