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
This commit is contained in:
Eitan Adler 2013-12-10 01:39:22 +00:00
parent ac68deae6d
commit 37a5f28043
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259152

View File

@ -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)