Subject: bin/14662: Calendar cpp interaction problem
To: None <gnats-bugs@gnats.netbsd.org>
From: maximum entropy <entropy@tappedin.com>
List: netbsd-bugs
Date: 11/21/2001 10:19:56
>Number:         14662
>Category:       bin
>Synopsis:       calendar(1) doesn't interact properly with new cpp(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 21 07:21:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     maximum entropy
>Release:        NetBSD 1.5Y
>Organization:
entropy -- it's not just a good idea, it's the second law.
>Environment:
	
	
System: NetBSD zippy.local 1.5Y NetBSD 1.5Y (ZIPPY) #0: Fri Nov 16 22:56:11 EST 2001 entropy@zippy.local:/usr/src/sys/arch/i386/compile/ZIPPY i386
Architecture: i386
Machine: i386
>Description:
	
When calling the current version of cpp(1), calendar(1) needs to specify the
"-traditional" flag.  Otherwise, any lines in the calendar input file that
contain single quotes will result in annoying warnings:
:1: unterminated character constant
:7: unterminated character constant
:10: unterminated character constant
:15: unterminated character constant
:16: unterminated character constant
:21: unterminated character constant
:26: unterminated character constant
:49: unterminated character constant
:60: unterminated character constant


>How-To-Repeat:
	
[505]entropy@nutmeg:~ $ cd /tmp
[506]entropy@nutmeg:/tmp $ cat >foo <<EOF
> 1/1 test
> 1/2 it's a test
> EOF
[507]entropy@nutmeg:/tmp $ calendar -f foo
:2: unterminated character constant

>Fix:
	

Index: calendar.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/calendar/calendar.c,v
retrieving revision 1.25
diff -u -u -r1.25 calendar.c
--- calendar.c	2001/02/19 23:03:44	1.25
+++ calendar.c	2001/11/21 15:13:28
@@ -342,7 +342,7 @@
 			(void)close(pdes[1]);
 		}
 		(void)close(pdes[0]);
-		execl(_PATH_CPP, "cpp", "-P", "-I.", "-I" _PATH_CALENDARS, NULL);
+		execl(_PATH_CPP, "cpp", "-traditional", "-P", "-I.", "-I" _PATH_CALENDARS, NULL);
 		warn("execl: %s", _PATH_CPP);
 		_exit(1);
 	}
>Release-Note:
>Audit-Trail:
>Unformatted: