tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Tristan Le Guern <tristan.leguern@gmail.com>, tech@mdocml.bsd.lv
Cc: espie@nerim.net
Subject: PATCH: .de macro name may end in tab
Date: Tue, 5 Apr 2011 23:48:36 +0200	[thread overview]
Message-ID: <20110405214836.GD30791@iris.usta.de> (raw)
In-Reply-To: <BANLkTikhhbH8zwcSYpZWoa0k7Ua2FWTRYA@mail.gmail.com>

Hi Tristan,

Tristan Le Guern wrote on Tue, Apr 05, 2011 at 05:25:22PM +0200:

> i notice some indentation errors in fvwm man page in
> 'THE VIRTUAL DESKTOP' section.

That's a bug in mandoc(1), thanks for reporting!
The page has this:

  .de<space>EX<tab><tab>\"Begin example

Searching for a space, mandoc misses the end of the EX macro name
and ends up defining a macro with a wrong name.

Here is a fix; OK?

Yours,
  Ingo


Index: roff.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/roff.c,v
retrieving revision 1.32
diff -u -p -r1.32 roff.c
--- roff.c	20 Mar 2011 23:36:42 -0000	1.32
+++ roff.c	5 Apr 2011 21:33:48 -0000
@@ -745,10 +745,10 @@ roff_block(ROFF_ARGS)
 			(*r->msg)(MANDOCERR_REQUEST, r->data, ln, ppos,
 			    roffs[tok].name);
 
-		while ((*bufp)[pos] && ' ' != (*bufp)[pos])
+		while ((*bufp)[pos] && !isspace((*bufp)[pos]))
 			pos++;
 
-		while (' ' == (*bufp)[pos])
+		while (isspace((*bufp)[pos]))
 			(*bufp)[pos++] = '\0';
 	}
 
@@ -769,9 +769,7 @@ roff_block(ROFF_ARGS)
 	/* If present, process the custom end-of-line marker. */
 
 	sv = pos;
-	while ((*bufp)[pos] &&
-			' ' != (*bufp)[pos] && 
-			'\t' != (*bufp)[pos])
+	while ((*bufp)[pos] && !isspace((*bufp)[pos]))
 		pos++;
 
 	/*
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

       reply	other threads:[~2011-04-05 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTinjovRu1FBDD4on1TuLczHEZ7Nfug@mail.gmail.com>
     [not found] ` <BANLkTikhhbH8zwcSYpZWoa0k7Ua2FWTRYA@mail.gmail.com>
2011-04-05 21:48   ` Ingo Schwarze [this message]
2011-04-05 22:02     ` Kristaps Dzonsons
2011-04-05 22:34       ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110405214836.GD30791@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=espie@nerim.net \
    --cc=tech@mdocml.bsd.lv \
    --cc=tristan.leguern@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).