From owner-svn-ports-head@freebsd.org Wed Oct 28 21:10:47 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 414CA450670; Wed, 28 Oct 2020 21:10:47 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CM1Sl0ycZz4bCG; Wed, 28 Oct 2020 21:10:47 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045272280B; Wed, 28 Oct 2020 21:10:47 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09SLAkOM037319; Wed, 28 Oct 2020 21:10:46 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09SLAkkr037318; Wed, 28 Oct 2020 21:10:46 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010282110.09SLAkkr037318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 28 Oct 2020 21:10:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r553563 - head/deskutils/calendar/files X-SVN-Group: ports-head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/deskutils/calendar/files X-SVN-Commit-Revision: 553563 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 21:10:47 -0000 Author: se Date: Wed Oct 28 21:10:46 2020 New Revision: 553563 URL: https://svnweb.freebsd.org/changeset/ports/553563 Log: Upgrade to FreeBSD base SVN version r367108 This version add support for nested conditionals, #ifdef and #else. Modified: head/deskutils/calendar/files/patch-io.c Modified: head/deskutils/calendar/files/patch-io.c ============================================================================== --- head/deskutils/calendar/files/patch-io.c Wed Oct 28 21:07:18 2020 (r553562) +++ head/deskutils/calendar/files/patch-io.c Wed Oct 28 21:10:46 2020 (r553563) @@ -1,20 +1,112 @@ ---- io.c.orig 2020-10-18 03:01:26 UTC +--- io.c.orig 2020-10-28 20:58:10 UTC +++ io.c -@@ -42,7 +42,7 @@ static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) - #endif +@@ -134,18 +134,66 @@ cal_fopen(const char *file) + } - #include --__FBSDID("$FreeBSD$"); -+__FBSDID("$FreeBSD: head/usr.bin/calendar/io.c 366962 2020-10-23 09:22:23Z se $"); + static int +-token(char *line, FILE *out, bool *skip) ++token(char *line, FILE *out, int *skip) + { + char *walk, c, a; - #include - #include -@@ -71,7 +71,7 @@ enum { - }; + if (strncmp(line, "endif", 5) == 0) { +- *skip = false; ++ if (*skip > 0) ++ --*skip; + return (T_OK); + } - const char *calendarFile = "calendar"; /* default calendar file */ --static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ -+static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, _PATH_INCLUDE}; /* HOME */ - static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ +- if (*skip) ++ if (strncmp(line, "ifdef", 5) == 0) { ++ walk = line + 5; ++ trimlr(&walk); ++ ++ if (*walk == '\0') { ++ warnx("Expecting arguments after #ifdef"); ++ return (T_ERR); ++ } ++ ++ if (*skip != 0 || definitions == NULL || sl_find(definitions, walk) == NULL) ++ ++*skip; ++ + return (T_OK); ++ } - static char path[MAXPATHLEN]; ++ if (strncmp(line, "ifndef", 6) == 0) { ++ walk = line + 6; ++ trimlr(&walk); ++ ++ if (*walk == '\0') { ++ warnx("Expecting arguments after #ifndef"); ++ return (T_ERR); ++ } ++ ++ if (*skip != 0 || (definitions != NULL && sl_find(definitions, walk) != NULL)) ++ ++*skip; ++ ++ return (T_OK); ++ } ++ ++ if (strncmp(line, "else", 4) == 0) { ++ walk = line + 4; ++ trimlr(&walk); ++ ++ if (*walk != '\0') { ++ warnx("Expecting no arguments after #else"); ++ return (T_ERR); ++ } ++ ++ if (*skip == 0) ++ *skip = 1; ++ else if (*skip == 1) ++ *skip = 0; ++ ++ return (T_OK); ++ } ++ ++ if (*skip != 0) ++ return (T_OK); ++ + if (strncmp(line, "include", 7) == 0) { + walk = line + 7; + +@@ -206,21 +254,6 @@ token(char *line, FILE *out, bool *skip) + return (T_OK); + } + +- if (strncmp(line, "ifndef", 6) == 0) { +- walk = line + 6; +- trimlr(&walk); +- +- if (*walk == '\0') { +- warnx("Expecting arguments after #ifndef"); +- return (T_ERR); +- } +- +- if (definitions != NULL && sl_find(definitions, walk) != NULL) +- *skip = true; +- +- return (T_OK); +- } +- + return (T_PROCESS); + + } +@@ -248,7 +281,7 @@ cal_parse(FILE *in, FILE *out) + int month[MAXCOUNT]; + int day[MAXCOUNT]; + int year[MAXCOUNT]; +- bool skip = false; ++ int skip = 0; + char dbuf[80]; + char *pp, p; + struct tm tm; +@@ -278,7 +311,7 @@ cal_parse(FILE *in, FILE *out) + } + } + +- if (skip) ++ if (skip != 0) + continue; + + buf = line;