Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 01:39:22 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259152 - head/usr.bin/calendar
Message-ID:  <201312100139.rBA1dMK3088861@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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