svn commit: r259152 - head/usr.bin/calendar
Eitan Adler
eadler at FreeBSD.org
Tue Dec 10 01:39:22 UTC 2013
Author: eadler
Date: Tue Dec 10 01:39:22 2013
New Revision: 259152
URL: http://svnweb.freebsd.org/changeset/base/259152
Log:
calendar(1): Add support for #include with absolute paths
Prior to the addition of cpp support into calendar itself
#include </usr/share/calendar/calendar.all>
was a legal construction in a calendar file.
Permit this again
Modified:
head/usr.bin/calendar/calcpp.c
Modified: head/usr.bin/calendar/calcpp.c
==============================================================================
--- head/usr.bin/calendar/calcpp.c Tue Dec 10 00:35:33 2013 (r259151)
+++ head/usr.bin/calendar/calcpp.c Tue Dec 10 01:39:22 2013 (r259152)
@@ -155,8 +155,11 @@ tokenscpp(char *buf, char *string)
s = p+1;
if ((p = strchr(s, '>')) != NULL)
*p = '\0';
- snprintf (string, MAXPATHLEN, "%s/%s",
- _PATH_INCLUDE, s);
+ if (*s != '/')
+ snprintf (string, MAXPATHLEN, "%s/%s",
+ _PATH_INCLUDE, s);
+ else
+ strncpy(string, s, MAXPATHLEN);
} else if (*p == '(') {
s = p+1;
if ((p = strchr(p, '>')) != NULL)
More information about the svn-src-head
mailing list