From owner-svn-src-all@freebsd.org Wed Oct 28 13:12:26 2020 Return-Path: Delivered-To: svn-src-all@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 C135A4469C6; Wed, 28 Oct 2020 13:12:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CLprp4kQGz460P; Wed, 28 Oct 2020 13:12:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 85B7B18535; Wed, 28 Oct 2020 13:12:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-vs1-f50.google.com with SMTP id n18so2809548vsl.2; Wed, 28 Oct 2020 06:12:26 -0700 (PDT) X-Gm-Message-State: AOAM532TDviHwsCOfVNG5WunMQQvqqoEV0LrEiGxa69y91d+KX4eh/DV DgEIm51285CZVM74Y2kSDPClQtdCSdy0OoKfekc= X-Google-Smtp-Source: ABdhPJwb8VewXPIT8q3998mK55t8eHM+tBrSU1OwfolkB1E+ee2lOQPi4ivMRlCfGCTR/W1c8kFXls3ID2lCkvFSBw0= X-Received: by 2002:a67:804a:: with SMTP id b71mr4996489vsd.60.1603890745843; Wed, 28 Oct 2020 06:12:25 -0700 (PDT) MIME-Version: 1.0 References: <202010281306.09SD6dgf040611@repo.freebsd.org> In-Reply-To: <202010281306.09SD6dgf040611@repo.freebsd.org> From: Kyle Evans Date: Wed, 28 Oct 2020 08:12:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r367103 - head/usr.bin/calendar To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 13:12:26 -0000 On Wed, Oct 28, 2020 at 8:06 AM Stefan E=C3=9Fer wrote: > > Author: se > Date: Wed Oct 28 13:06:39 2020 > New Revision: 367103 > URL: https://svnweb.freebsd.org/changeset/base/367103 > > Log: > Fix parsing of #ifdef in calendar files > > There was code to process an #ifndef tokens, but none for #ifdef. > The #ifdef token was mentioned as unsupported in the BUGS section, > but no reason was given and I do not see why it should stay omitted. > > Misleading information in The BUGS section of the man-page regarding > the maximum number of #define and #include statements supported has > been removed. These limits might have applied to a prior version of > this program, but do not seem to apply to the current implementation. > > I have not tried to test for the existence of the limits, but the > include file processing just recursively calls the parser (without > counting the recursion depth) and the stringlist functions do not > impose a limit on the number of entries. > > Reported by: jhs@berklix.com > MFC after: 3 days > > Modified: > head/usr.bin/calendar/calendar.1 > head/usr.bin/calendar/io.c > > Modified: head/usr.bin/calendar/calendar.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/calendar/calendar.1 Wed Oct 28 11:54:09 2020 (= r367102) > +++ head/usr.bin/calendar/calendar.1 Wed Oct 28 13:06:39 2020 (= r367103) > @@ -346,11 +346,9 @@ double-check the start and end time of solar and lun= ar > .Sh BUGS > The > .Nm > -internal cpp does not correctly do #ifndef and will discard the rest > -of the file if a #ifndef is triggered. > -It also has a maximum of 50 include file and/or 100 #defines > -and only recognises #include, #define and > -#ifndef. > +internal cpp does not support nested conditions and will continue > +parsing of the input file on the next #endif even in nested contexts. > +It does only recognise #include, #define, #ifdef and #ifndef. > .Pp > There is no possibility to properly specify the local position > needed for solar and lunar calculations. > > Modified: head/usr.bin/calendar/io.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/calendar/io.c Wed Oct 28 11:54:09 2020 (r367102) > +++ head/usr.bin/calendar/io.c Wed Oct 28 13:06:39 2020 (r367103) > @@ -212,6 +212,21 @@ token(char *line, FILE *out, bool *skip) > return (T_OK); > } > > + if (strncmp(line, "ifdef", 5) =3D=3D 0) { > + walk =3D line + 6; > + trimlr(&walk); > + I think you wanted to step walk forward 5 instead of 6 here