summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar/io.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r303541, r303542, r303543, r303545, r303546, r303547, r304225, r304226, ↵araujo2016-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304605, r304676, r305212, r305863: r303541: Use nitems() from sys/param.h. Sponsored by: gandi.net (BSD Day Taiwan) MFC after: 2 weeks. r303542: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303543: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303545: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303546: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r303547: Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) r304225: Use nitems() from sys/param.h. MFC after: 2 weeks. r304226: Use nitems() from sys/param.h. MFC after: 2 weeks. r304605: Fix calloc(3) argument order. Reviewed by: trasz MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7532 r304676: Fix calloc(3) argument order. MFC after: 4 weeks. r305212: - Invert calloc(3) argument order. MFC after: 4 weeks r305863: Invert calloc(3) argument order. Reviewed by: ed. MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7902
* Cleanup unnecessary semicolons from utilities we all love.pfg2016-04-151-1/+1
|
* Fix trimming spaces writing at index -1 if an empty string is passedbapt2015-07-151-2/+7
| | | | Submitted by: Gennady Proskurin <gprspb@mail.ru>
* calendar: remove useless checkeadler2015-04-191-3/+0
| | | | | | | | lineline checked for 0 in the while loop condition. There is no need to check for it additionally in the body. CID: 1288959 MFC After: 1 week
* Rework calendar(1) parserbapt2015-03-041-51/+218
| | | | | | | | | | Support includes surrounded by '"' or '<' '>' Print warnings about bad syntax Correctly navigate through include directories to find calendar files Correctly support multiple includes Tested by: gjb MFC after: 1 week
* - calendar uses cpp internally, this diff removes this usage anddb2013-09-191-56/+30
| | | | | | | substitutes a limited subset cpp processor internally. PR: src/178463 Approved by: re (gjb)
* Handle some expression regressions.grog2013-06-121-1/+1
| | | | | | | | | | | | Explicitly use GNU cpp for preprocessing. Remove explicit debugging code. Change some variable names to be less confusing. Improve some comments. Improve indentation. PR: 162211 168785 MFC after: 2 weeks
* More -Wmissing-variable-declarations fixes.ed2012-10-191-3/+3
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Tidy up command line processing:grog2011-11-091-1/+2
| | | | | | | | | | | | | | - Add ? option to optstring. - Sort options alphabetically. - Vertical space. Tidy up usage() function. Bring man page in sync with source. Ensure that debug code is only executed with the -d option. Submitted by: Christiane Yeardley
* Pass correct size to write(2).jh2011-06-061-1/+1
| | | | | | PR: bin/155915 Submitted by: John Levine MFC after: 2 weeks
* Fix memory-leak at the processing of multiple calendars.edwin2010-06-051-1/+4
| | | | | Found with: Coverity Prevent(tm) CID: 7085
* Properly check the return value of chdir, even if it is a "thisedwin2010-06-051-1/+2
| | | | | | | should not happen" case. Found with: Coverity Prevent(tm) CID: 4932
* While I am here, add more missing (unsigned char) casts to ctype() macrosache2010-05-061-1/+1
|
* Fix recent space skipping:ache2010-05-061-2/+2
| | | | | 1) add missing (unsigned char) cast to ctype() macro 2) fix off-by-one error causing last letter always doubled
* On request of joel@:edwin2010-03-301-4/+0
| | | | | | - Remove the 3rd clause of the UC Berkeley copyrighted files. - For the files added copyrighted by me, move the "All rights reserved" to the next line.
* Long awaited update to the calendar system:edwin2010-03-291-263/+105
| | | | | | | | | | | | - Repeating events which span multiple years (because of -A, -B or just the three days before the end of the year). - Support for lunar events (full moon, new moon) and solar events (equinox and solstice, chinese new year). Because of this, the options -U (UTC offset) and -l (longitude) are available to compensate if reality doesn't match the calculated values. MFC after: 1 month
* rewind(3) is already declared to return 'void', so no need for an explicit castrse2009-12-171-1/+1
|
* Move functions which are only locally used into their C files andedwin2008-08-051-3/+20
| | | | | | | | | | make them static. usage() in calendar.c event_*() in io.c PR: bin/118644 Approved by: bde@ (mentor)
* style(9)ify usr.bin/calendaredwin2008-08-051-55/+92
| | | | | | PR: bin/118644 Approved by: bde@ (mentor) MFC after: 1 week
* style(9)grog2007-12-301-1/+1
|
* If we can't open a calendar file, don't guess why. Check the errorgrog2007-12-301-1/+2
| | | | | | | return and print a useful message. Prior to this commit, access problems could give rise to messages that the file didn't exist.
* Never use getenv("HOME") without checking for NULL and non-zerokevlo2007-10-301-1/+4
| | | | Obtained from: OpenBSD
* Sort events by date.grog2007-06-091-10/+99
| | | | | | | | | Correct long-standing off-by-one error in -W option. Submitted by: edwin@ Shorten some long lines. These files are still not completely style(9) compliant.
* ANSIfy function definitions.dwmalone2007-05-071-7/+4
| | | | | Move some extern declarations to a header file. Remove an unneeded extern declaration for optarg.
* Search the include path for the argument to -f, to make lives easier forjmallett2002-07-281-6/+13
| | | | | | | | | those of us who want to figure out how old Jim Mock is, but only want to type 'calendar -f calendar.freebsd'. This is done in a way that should be totally backwards compatible with no noticable differences, at all. Reviewed by: mux MFC after: 4 weeks
* Style improvements recommended by Bruce as a follow up to somedwmalone2001-12-101-5/+6
| | | | | | | | of the recent WARNS commits. The idea is: 1) FreeBSD id tags should follow vendor tags. 2) Vendor tags should not be compiled (though copyrights probably should). 3) There should be no blank line between including cdefs and __FBSDIF.
* WARNS=2 fixup (mostly. Some are Hard To Fix(tm), so NO_WERROR is set)markm2001-12-021-18/+20
| | | | | Use __FBSDID(). Sort some headers.
* Fix the type of the NULL arg to execl()brian2001-07-091-2/+2
| | | | Idea from: Theo de Raadt <deraadt@openbsd.org>
* Don't attempt to parse %c, use nl_langinfo insteadache2001-03-211-5/+10
|
* MAXPATHLEN includes the trailing NUL character, so there's no need to add 1imp2001-03-011-1/+1
| | | | to it for the size of path.
* Adapt to the new `ccp' now that the traditional-behaving /usr/bin/cppobrien2000-01-101-1/+3
| | | | | | | | script is gone. PR: 15932 Submitted by: Jos Backus <Jos.Backus@nl.origin-it.com> Tested by: brian, Manfred Antar <mantar@pacbell.net>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Missed one in the previous commit.des1998-10-131-3/+3
|
* Use err(3). Abort if strdup() returns NULL.charnier1997-06-231-13/+14
|
* Don't call sendmail with "-f root" when run with "-a". Thismpp1997-02-161-1/+1
| | | | | | | eliminates the "X-authentication-warning" header line that has been coming out since I made it so that sendmail is run totally as the user whose calendar file is currently being processed.
* Fix a couple of typos.mpp1997-02-111-4/+4
| | | | Submitted by: bde
* Really fix calendar to drop all permissions whenmpp1997-02-091-4/+28
| | | | | | | run with "calendar -a". Also don't ignore the return values from the setuid/setgid calls. Thanks to bde for making me this about this.
* Initialize the group list when we switch uids when run asmpp1997-02-061-0/+4
| | | | | | | root with "calendar -a". Drop all privs when execing other programs. Obtained from: OpenBSD
* Localize even more.ache1996-05-101-3/+17
| | | | | FIx Orthodox Easter calculation Better debug output
* Allow to configure national Easter names.ache1996-05-101-0/+16
| | | | Speedup my national months/days handling code.
* Localize itache1996-05-101-16/+31
| | | | | Handle Orthodox Eastern -Wall cleanup
* Change calendar to report the actual date for variable day events.mpp1996-04-061-4/+15
| | | | | | | | | | | | | | | | | | | | | | | E.g. for Easter, and entries like "04/SunFirst" calendar will now report: 04/05* Good Friday (2 days before easter) 04/07* First Sunday... instead of: Easter-2 Good Friday... 04/SunFirst First Sunday... I also modified the calendar files to use the variable day format for a lot of events so that they will be reported correctly. E.g. U.S. daylight savings time is now listed as: 04/SunFirst Daylight savings time... There are still a lot of wrong dates in there for some events that move from year to year, but I don't have a good calendar handy right now that I can use for reference.
* - handle events that move around from year to year, i.e.,wosch1996-02-021-0/+271
``the last Monday in April' - handle easter new options -f calendarfile -A days -B days Calendar HOME directory ~/.calendar don't sent mail if ~/.calendar/nomail exist
OpenPOWER on IntegriCloud