aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/calendar
Commit message (Collapse)AuthorAgeFilesLines
* Source repo changes to add new committer Rajesh Kumar M ARajesh Kumar M A2021-02-161-0/+1
| | | | | | Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28586
* Complete Steps 5 and 9 from the Committer's guideLewis Cook2021-01-221-0/+1
| | | | | | | | | | | | | | | Summary: Steps 5 and 9: - Update Mentor and Mentee Information - Update Ports with Personal Information Reviewers: tcberner, fernape Reviewed By: fernape Subscribers: imp Differential Revision: https://reviews.freebsd.org/D28281
* Replace strcat, strcpy and snprintf with bounds checking versionsStefan Eßer2020-12-311-46/+48
|
* Make calendarhome buffer staticStefan Eßer2020-12-301-1/+1
| | | | the value may be used in error messages after leaving this function.
* Complete steps 5 and 9 from Committer's guideJuraj Lutter2020-12-161-0/+1
| | | | | | | | | Reviewed by: osa (mentor) Approved by: osa (mentor) Differential Revision: https://reviews.freebsd.org/D27632 Notes: svn path=/head/; revision=368701
* Fix WITHOUT_ICONV buildStefan Eßer2020-12-131-1/+1
| | | | | | | | | | | | Move the include of langinfo.h out of the WITH_ICONV condition block, since it is not dependent on ICONV. This was correct when nl_langinfo() had only been called in the WITH_ICONV case, but that is no longer the case. Submitted by: yuripv Notes: svn path=/head/; revision=368611
* Revert r368606Stefan Eßer2020-12-131-4/+0
| | | | | | | | | The issue will be fixed in a different way. Reported by: yuripv Notes: svn path=/head/; revision=368610
* Fix WITHOUT_ICONV buildStefan Eßer2020-12-131-0/+4
| | | | | | | | | | There was an unprotected use of nl_langinfo() to determine the order of day vs. month in the generated output. When building without ICONV support, the order will be: month, day. Notes: svn path=/head/; revision=368606
* Use getlocalbase() instead of compiled in LOCALBASE to locate calendarsStefan Eßer2020-12-122-3/+9
| | | | Notes: svn path=/head/; revision=368578
* Install 2 forgotten shell scripts required to run the testsStefan Eßer2020-12-111-0/+2
| | | | | | | | Submitted by: arichardson (Alexander Richardson) Differential Revision: https://reviews.freebsd.org/D27568 Notes: svn path=/head/; revision=368551
* Restrict locale settings to the file they occur inStefan Eßer2020-11-054-32/+63
| | | | | | | | | | | | | | | This prevents LANG= in an included file from affecting the interpretation of month and day names in the including file. Make the internal pre-processor accept white space between the "#" at the start of the line and the keyword for better compatibility with cpp. Add support for the cpp keywords #warning and #error. MFC after: 3 days Notes: svn path=/head/; revision=367364
* Add regression tests for conditions and commentsStefan Eßer2020-11-0414-54/+213
| | | | | | | | | | | | | | | | | Fix one case where #else was not corerctly processed and simplify the conditions logic. Fix parsing of day and month names in the locale specified in the calendar file. The previous version would expect those names to match the locale of the user. Mention that comments are now correctly processed and that // is supported in addition to /* ... */. MFC after: 3 days Notes: svn path=/head/; revision=367350
* Update man-page to document changes made to the calendar program.Stefan Eßer2020-11-031-6/+14
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367308
* Consistently print calendar dates in the locale of the userStefan Eßer2020-11-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | Calendar files that specify LANG=... to specify their character encoding did also set the date format defined for that locale, resulting in output like: Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924 4 nov. N'oubliez pas les Charles ! After this commit the output is always printed in a consistent format according to the user's current locale, e.g.: Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924 Nov 4 N'oubliez pas les Charles ! I'll open a review asking for opinions whether this format change should be merged to -STABLE. Relnotes: yes Notes: svn path=/head/; revision=367293
* Check that #ifdef, #ifndef, and #undef are used with a single nameStefan Eßer2020-11-031-13/+38
| | | | | | | | | | This restores the parameter validation that has been peformed by cpp for defining and testing of names used in conditions. MFC after: 3 days Notes: svn path=/head/; revision=367292
* Fix psoition reporting for calendar data file in system directoryStefan Eßer2020-11-011-2/+14
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367255
* Improve calendar file parsing and consistency testsStefan Eßer2020-10-311-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | Add line number information to more warning and error messages. Detect #else and #endif without corresponing #ifdef/#ifndef as error. Detect missing #endif at end of file and print warning but continue. Support for #undef has been added to reverse the effect of a prior #define. It is no error if the argument value has not been defined before. These changes may cause error aborts on malformed input files (e.g. with spurious #else or #endif), but no such errors exist in the calendar files in the FreeBSD base system and the calendar-data port and all tests pass. More tests will be added in a follow-up commit to detect regressions that might affect the newly added features. This commit ends a series of updates that enhance the pre-processor and make it behave much more like prior versions of the calendar progarm that called cpp to pre-process the data files. MFC after: 3 days Relnotes: yes Notes: svn path=/head/; revision=367207
* Add file names and line numbers to debug messagesStefan Eßer2020-10-311-2/+4
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367204
* Add file names and line numbers to calendar format error messagesStefan Eßer2020-10-312-13/+37
| | | | | | | | | | Without file name and line number it is very cumbersum to identify the locations of errors in calendar files. MFC after: 3 days Notes: svn path=/head/; revision=367203
* Print calendar entries in the order they occurStefan Eßer2020-10-302-3/+9
| | | | | | | | | | | | | The calendar program used to output entries in reverse order, due to the way an internal linked list was built up. A regression test with 2 entries for the same day has been adapted to the now non-reversed order. MFC after: 3 days Notes: svn path=/head/; revision=367173
* Revert debug output committed in r367166 by accidentStefan Eßer2020-10-301-6/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367167
* Fix length calculation in memmoveStefan Eßer2020-10-302-3/+10
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=367166
* Re-implement comment parsing missing in the internal pre-processorStefan Eßer2020-10-301-11/+51
| | | | | | | | | | | | | | | | | | | | | The internal pre-processor ignored lines that did not parse a calendar entries, but did not support multi-line comments in the way the external cpp did. The calendar files distributed with the base system (now in a port) do use comments, though. Implement comment processing for single-line (//) and multi-line comments (/* */) with same semantics as in a standard C pre-processor. All tests pass with this version, but there are no tests that specifically verify comment processing. Reported by: jhs@berklix.com (Julian H. Stacey) MFC after: 3 days Notes: svn path=/head/; revision=367161
* Update the due date of the quarterly status reportLi-Wen Hsu2020-10-291-4/+4
| | | | | | | | | | | | While here, move the date to keep 2 weeks ahead notificaion and fix the part of speech. Reviewed by: debdrup Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26998 Notes: svn path=/head/; revision=367131
* Simplify test for closing delimiter of #include argument (no functionalStefan Eßer2020-10-292-19/+6
| | | | | | | | | | | | change). While here: Fix invalid parameters of a commented-out debug printf() found when testing with this code enabled. MFC after: 3 days Notes: svn path=/head/; revision=367127
* Fix calendar -a processing of files included in the user's home directoryStefan Eßer2020-10-291-0/+1
| | | | | | | | | | | | | | | | | The existing code performed a chdir() into the home directory, but the parser fell back to using the invoking user's home directory as the base directory for the search for an include file. Since use of the -a option is limited to UID==0, the directory searched was typically ~root/.calendar, not the .calendar directory of the user whose file is being processed. PR: 205580 Reported by: greg.bal4@gmail.com (Greg Balfour) MFC after: 3 days Notes: svn path=/head/; revision=367126
* Add support for nested conditionalsStefan Eßer2020-10-282-40/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous behavior was to support nested #ifdef and #ifndef, but to return to unconditional parsing after the next #endif, independently of the number of previously parsed conditions. E.g. after "#ifdef A / #ifdef B / #endif" the following lines were unconditially parsed again, independently of A and/or B being defined. The new behavior is to count the level of false conditions and to only restart parsing of calendar entries when the corresponding number of #endif tokens have been seen. In addition to the above, an #else directive has been added, to toggle between parsing and ignoring of the following lines. No validation of the correct use of the condition directives is made. #endif without prior #define or #ifndef is ignored and #else toggles between parsing and skipping of entries. The MFC period has been set to 1 month to allow for a review of the changes and for a discussion, whether these modifications should not be merged at all. No correct input file is parsed differently than before, but if calendar data files are published that use these new features, those data files will not parse correctly on prior versions of this program. MFC after: 1 month Notes: svn path=/head/; revision=367108
* Fix off-by-one error in processing of #ifdef linesStefan Eßer2020-10-281-1/+1
| | | | | | | | | | | | | The convention in this program is to parse the line immediately starting after the token (e.g. #defineA and #ifdefA define respectively look-up "A"), and this commit restores this behavior instead of skipping an assumed white-space character following #ifdef. Reported by: kevans MFC after: 3 days Notes: svn path=/head/; revision=367104
* Fix parsing of #ifdef in calendar filesStefan Eßer2020-10-282-5/+18
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=367103
* Correct calendar entry for myselfScott Long2020-10-261-1/+1
| | | | Notes: svn path=/head/; revision=367053
* calendar: remove all datafiles except freebsd oneWarner Losh2020-10-2667-6809/+12
| | | | | | | | | | | | | Move all the data files for the calendar(1) program, except calendar.freebsd to the calendar-data package. When a file can't be found, and /usr/local/share/calendar doesn't exist provide a helpful hint to install this package. Reviewed by: se@ Differential Revision: https://reviews.freebsd.org/D26926 Notes: svn path=/head/; revision=367051
* calendar.1: Fix locale of the month in Dd ;)Mateusz Piotrowski2020-10-251-1/+1
| | | | Notes: svn path=/head/; revision=367040
* Udpate calendar man-page to mention the search path added in r366962.Stefan Eßer2020-10-231-1/+9
| | | | | | | | | | | | Calendar files in /usr/lcoal/share/calendar take precedence over files in the base system. They can be provided by a port or package, but since such a port has not been committed, yet, no specific port name is suggested. In fact, multiple ports could exist (e.g. per locale) without conflicting with each other. Notes: svn path=/head/; revision=366963
* Add search of LOCALBASE/share/calendar for calendars supplied by a port.Stefan Eßer2020-10-232-1/+2
| | | | | | | | | | | | | | | | | Calendar files in LOCALBASE override similarily named ones in the base system. This could easily be changed if the base system calendars should have precedence, but it could lead to a violation of POLA since then the port's files were ignored unless those in base have been deleted. There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease a consistent modification of this prefix. Reviewed by: imp, pfg Differential Revision: https://reviews.freebsd.org/D26882 Notes: svn path=/head/; revision=366962
* Correct location and date of the Boston Shoemakers' organization,Greg Lehey2020-10-181-1/+1
| | | | | | | | | which significantly predated the USA. Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html Notes: svn path=/head/; revision=366805
* Bump manual page date after 366243Mateusz Piotrowski2020-09-291-3/+3
| | | | | | | While here, address mandoc warnings. Notes: svn path=/head/; revision=366249
* Document the fact (bug?) that the -a option will normally processGreg Lehey2020-09-291-2/+17
| | | | | | | | | | | | | | root's calendar files three times, once each for root, toor and daemon. This relates to bug 246943, but does not solve it. See discussion in bug report for more details. PR: 246943 Reported by: wcarson.bugzilla@disillusion.net Notes: svn path=/head/; revision=366243
* Remove claim that Allied Forces created "West Germany" in 1953. I canGreg Lehey2020-09-211-1/+0
| | | | | | | | | find no historic substantiation for such a claim. The Federal Republic of Germany was created by Germans on 23 May 1949, as also noted in this file. Notes: svn path=/head/; revision=365984
* Update Hong Kong Liberation Day (hah!)Greg Lehey2020-08-271-1/+1
| | | | Notes: svn path=/head/; revision=364854
* Correct date for Nagasaki bombing.Greg Lehey2020-08-091-1/+1
| | | | Notes: svn path=/head/; revision=364057
* Remove incorrect duplicate.Greg Lehey2020-08-091-1/+0
| | | | Notes: svn path=/head/; revision=364056
* Add my entry to the calendar fileDaniel Ebdrup Jensen2020-07-291-0/+1
| | | | | | | | | | | | As part of onboarding, ensure that I'm listed in the FreeBSD calendar file, while listening to Don't Take Away The Music by Tavares. Reviewed by: 0mp, bcr Approved by: 0mp (mentor), allanjude (mentor) Differential Revision: D25856 Notes: svn path=/head/; revision=363662
* Be more precise about Percy Grainger's place of birth.Greg Lehey2020-07-081-1/+1
| | | | Notes: svn path=/head/; revision=363000
* Use canonical description for Schlacht bei Königgrätz, add year.Greg Lehey2020-07-021-1/+1
| | | | Notes: svn path=/head/; revision=362901
* Add myself (gbe) to committers-doc.dot and calendar.freebsdGordon Bergling2020-06-121-0/+1
| | | | | | | | | Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25241 Notes: svn path=/head/; revision=362089
* Tidy up syntax and punctuation of some entries.Greg Lehey2020-04-171-3/+3
| | | | Notes: svn path=/head/; revision=360057
* Add my birthdayHiroki Tagato2020-04-151-0/+1
| | | | | | | Approved by: ehaupt (mentor) Notes: svn path=/head/; revision=359962
* Install expected output file of test missed in r359585Li-Wen Hsu2020-04-131-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=359862
* Remove hardcoded US Election Day from calendar.usholidayOleksandr Tymoshenko2020-04-031-1/+0
| | | | | | | | | | | | | calendar(1) syntax is not capable of representing the rules for the US Election Day. The hardcoded date was set in r15066 in 1996 and hasn't changed since then. PR: 173389 Reported by: Steve Ames <steve@energistic.com> MFC after: 1 week Notes: svn path=/head/; revision=359587
* Fix calculation of the recurring weekdaysOleksandr Tymoshenko2020-04-034-4/+15
| | | | | | | | | | | | | | | Both the result of the first_dayofweek_of_year and the target weekday are zero-based (0 fo sunday) while the target month-day or year-day is 1-based. Adjust logic accordingly. Also add testcase for this PR to the kyua test suite PR: 201062 Submitted by: Richard Narron <comet.berkeley@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=359585