From 33e6dc56151b70e65d24adda8a3ca8b09bc7518b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 15 May 2010 15:58:57 +0000 Subject: merge bsd.lv 1.63: fix stripping of whitespace before trailing comments; by Joerg Sonnenberger --- usr.bin/mandoc/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/mandoc') diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index a9f0e5b5dcb..1d8a79c58bd 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.25 2010/05/14 01:54:37 schwarze Exp $ */ +/* $Id: main.c,v 1.26 2010/05/15 15:58:56 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -363,9 +363,9 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp) comment = 1; pos -= 2; for (; pos > 0; --pos) { - if (ln->buf[pos] != ' ') + if (ln->buf[pos - 1] != ' ') break; - if (ln->buf[pos - 1] == '\\') + if (pos > 2 && ln->buf[pos - 2] == '\\') break; } continue; -- cgit v1.2.3