tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* PATCH: .de macro name may end in tab
       [not found] ` <BANLkTikhhbH8zwcSYpZWoa0k7Ua2FWTRYA@mail.gmail.com>
@ 2011-04-05 21:48   ` Ingo Schwarze
  2011-04-05 22:02     ` Kristaps Dzonsons
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Schwarze @ 2011-04-05 21:48 UTC (permalink / raw)
  To: Tristan Le Guern, tech; +Cc: espie

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: .de macro name may end in tab
  2011-04-05 21:48   ` PATCH: .de macro name may end in tab Ingo Schwarze
@ 2011-04-05 22:02     ` Kristaps Dzonsons
  2011-04-05 22:34       ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Kristaps Dzonsons @ 2011-04-05 22:02 UTC (permalink / raw)
  To: tech; +Cc: Ingo Schwarze, Tristan Le Guern, espie

On 05/04/2011 23:48, Ingo Schwarze wrote:
> 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?

Ingo, I'm Ok with this (do we stipulated spaces in any of the existing 
documentation?), but please cast to unsigned char for each of those 
isspace() calls.  Also, and this is really nit-picking, can you put a 
space around the "!"?  I always miss the bang, otherwise...

Thanks!

Kristaps

--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: .de macro name may end in tab
  2011-04-05 22:02     ` Kristaps Dzonsons
@ 2011-04-05 22:34       ` Ingo Schwarze
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Schwarze @ 2011-04-05 22:34 UTC (permalink / raw)
  To: tech; +Cc: tristan.leguern, espie

Hi Kristaps,

Kristaps Dzonsons wrote on Wed, Apr 06, 2011 at 12:02:27AM +0200:

> Ingo, I'm Ok with this (do we stipulated spaces in any of the
> existing documentation?),

We have this in roff(7):

  REQUEST SYNTAX
     A request or macro line consists of:
     1.   the control character `.' or `'' at the beginning of the line,
     2.   optionally an arbitrary amount of whitespace,
     3.   the name of the request or the macro, which is one word of arbitrary
          length, terminated by whitespace,
     4.   and zero or more arguments delimited by whitespace.

So the manual seems ok, only the implementation was wrong.

Thanks for your feedback!
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-05 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BANLkTinjovRu1FBDD4on1TuLczHEZ7Nfug@mail.gmail.com>
     [not found] ` <BANLkTikhhbH8zwcSYpZWoa0k7Ua2FWTRYA@mail.gmail.com>
2011-04-05 21:48   ` PATCH: .de macro name may end in tab Ingo Schwarze
2011-04-05 22:02     ` Kristaps Dzonsons
2011-04-05 22:34       ` Ingo Schwarze

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).