calendar (1) - patch to correct error description

Julian H. Stacey jhs at berklix.com
Wed Oct 28 12:02:27 UTC 2020


man calendar states:
  "The calendar internal cpp does not correctly do #ifndef and will discard
  the rest of the file if a #ifndef is triggered."
That is wrong, as proved by test file:
---
// Test data for ~/.calendar/calendar 
*	bla0
#ifdef DEBUG1
* 28	bla1
#endif
#ifdef DEBUG2
* 28	bla2
#endif
#ifndef DEBUG3
* 28	bla3
#endif
#define DEBUG4 TRUE
#ifndef DEBUG4
* 28	bla4
#endif
* 28	bla5
---
Produces:
---
Oct 28 	bla5
Oct 28 	bla4
Oct 28 	bla3
Oct 28 	bla2
Oct 28 	bla1
---
Correction:
  The calendar internal cpp ignores directives #ifdef , #ifndef and #endif ,
  and simply including intervening text regardless.
Patch built Wed Oct 28 12:39:27 CET 2020
on .ctm_status src-12 914 .svn_revision 366896 :
---
http://www.berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/usr.bin/calendar/calendar.1.ifdef.REL=12.2-STABLE.diff
*** 12.2-STABLE/src/usr.bin/calendar/calendar.1	Wed Oct 21 01:14:23 2020
--- new-generic/src/usr.bin/calendar/calendar.1	Wed Oct 28 12:33:12 2020
***************
*** 323,330 ****
  .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.
--- 323,330 ----
  .Sh BUGS
  The
  .Nm
! internal cpp ignores directives #ifdef , #ifndef and #endif ,
! and simply including intervening text regardless.
  It also has a maximum of 50 include file and/or 100 #defines
  and only recognises #include, #define and
  #ifndef.
---

Later I could file this with send-pr, but before that I'm chasing
another calendar cpp error (maybe which cpp is used may need to be
considered, & that might reflect into discussion of which cpp used
on which BSDs)

Cheers,
-- 
Julian Stacey, Consultant Sys. Eng. BSD Linux Unix, http://berklix.com/jhs/cv/
Crash Brexit profits financial speculators in cabinet damaging Britain.
UK stole 3.7 million votes from Brits abroad 700 K in EU http://stolenvotes.uk


More information about the freebsd-stable mailing list