Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2020 13:30:24 +0000 (UTC)
From:      =?UTF-8?Q?Stefan_E=c3=9fer?= <se@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367104 - head/usr.bin/calendar
Message-ID:  <202010281330.09SDUOhX052973@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: se
Date: Wed Oct 28 13:30:24 2020
New Revision: 367104
URL: https://svnweb.freebsd.org/changeset/base/367104

Log:
  Fix off-by-one error in processing of #ifdef lines
  
  The convention in this program is to parse the line immediately starting
  after the token (e.g. #defineA and #ifdefA define respectively look-up "A"),
  and this commit restores this behavior instead of skipping an assumed
  white-space character following #ifdef.
  
  Reported by:	kevans
  MFC after:	3 days

Modified:
  head/usr.bin/calendar/io.c

Modified: head/usr.bin/calendar/io.c
==============================================================================
--- head/usr.bin/calendar/io.c	Wed Oct 28 13:06:39 2020	(r367103)
+++ head/usr.bin/calendar/io.c	Wed Oct 28 13:30:24 2020	(r367104)
@@ -213,7 +213,7 @@ token(char *line, FILE *out, bool *skip)
 	}
 
 	if (strncmp(line, "ifdef", 5) == 0) {
-		walk = line + 6;
+		walk = line + 5;
 		trimlr(&walk);
 
 		if (*walk == '\0') {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010281330.09SDUOhX052973>