Commit Graph

31 Commits

Author SHA1 Message Date
Alan Somers
90de1ffbdb at(1): annotate some intended switch-case fallthroughs
Reported by:	Coverity
CID:		1008191
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2017-12-08 17:15:20 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Martin Cracauer
93a2fe45a6 Allow time offsets to be negative, e.g. at 1530 - 15 minutes.
This is useful if you have been given some time for some event in some
format and you want your computer to do something to prepare for it.
Without having to do time arithmetic in a shellscript.

The syntax matches what the at(1) usually used on Linux supports.
2012-10-05 17:54:27 +00:00
Ed Schouten
f64efe8b60 Add missing static keywords to at(1).
While there, tidy up the privs.h part, where at.c has to #define to
declare some globals. Also group static and non-static global variables
in at.c.
2011-11-06 17:32:29 +00:00
Stefan Farfeleder
4ed7018006 While revision 1.26 fixed the code to really subtract 3600 due to
daylight-saving, this was actually wrong because mktime() already does that for
us.
2005-08-18 08:18:02 +00:00
Stefan Farfeleder
3dc44a8992 Don't throw away the adjusted `runtimer' value. 2005-08-05 08:07:02 +00:00
David Malone
9f5b04e925 Style improvements recommended by Bruce as a follow up to some
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.
2001-12-10 21:13:08 +00:00
Mark Murray
51e2220c27 Use __FBSDID() 2001-12-02 20:23:02 +00:00
Mark Murray
3ce6c35745 WARNS=2 fixup. 2001-12-02 12:26:18 +00:00
Brian Somers
bafdc304b0 Allow an ``at now'' specification.
PR:		32242
Submitted by:	Alan E <alane@geeksrus.net>
MFC after:	3 weeks
2001-11-24 10:43:53 +00:00
David E. O'Brien
a9be9be874 Expland `mymalloc' with malloc + error checking. 2001-07-24 14:15:51 +00:00
Sheldon Hearn
f4510294cb Y2K fix. at(1) would die with 'garbled time' when assign_date() was
pased a year > 99.  This change fixes the conversion of 2-digit years
into tm_year format.

This change is differs from the OpenBSD fix because of differences
in our assign_date().

PR:		15872
Reported by:	"Crist J. Clark" <cjclark@home.com>
Submitted by:	"Sergey N. Voronkov" <serg@dor.zaural.ru>
Obtained from:	OpenBSD
2000-03-27 09:32:23 +00:00
Philippe Charnier
81c8c7a454 Correct use of .Nm, .Em, .Ev
Add rcsid. Use errx instead of fprintf + exit.
Various spelling fixes.
1999-12-05 19:57:14 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Nick Sayer
b6c989ff40 1. Add support for months and years in relative time spec (now + 1 year)
2. Rip out dateadd() and re-do the plus operator handler to use mktime()
instead (per wollman).

Reviewed by:	wollman
1999-08-26 16:18:38 +00:00
Archie Cobbs
5f618f92e3 Eliminate compiler warnings from -Wall 1998-12-06 07:42:09 +00:00
Steve Price
3297b869e3 Typo fix: garbeld -> garbled
PR:		7784
Submitted by:	Kris Kennaway <kkennawa@physics.adelaide.edu.au>
1998-08-30 17:33:05 +00:00
Alexander Langer
1f939e3414 Year is sometimes set to -1 when assign_date() is called. Check for -1
before Y2K processing.

PR:		7524
1998-08-08 14:02:06 +00:00
Dag-Erling Smørgrav
b9dd99f2f5 Recognize long month names in addition to short ones.
PR:		bin/7228
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-07-09 22:51:59 +00:00
Alexander Langer
1dbfc421b6 Permit double digit year values to be used in the next millenium. 1998-05-05 01:53:15 +00:00
Philippe Charnier
e5e5da15e2 Revert part of previous commit. I didn't see rcsid string in the middle of
the file. Put includes in alphabetical order.
1997-06-24 06:26:32 +00:00
Philippe Charnier
12d20ef97d Use err(3).
Simplification: if(a == 12) a -= 12 -> if(a == 12) a = 0.
1997-06-23 06:44:18 +00:00
Peter Wemm
c115df18cd Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
John Polstra
9b2ea11c98 Fix botches in the handling of "AM" and "PM":
12:xx PM is 12:xx, not 24:xx.
    12:xx AM is 00:xx, not 12:xx.
1996-07-19 00:44:55 +00:00
Andrey A. Chernov
ddcf802236 Upgrade to 2.9 1995-08-21 12:34:18 +00:00
Joerg Wunsch
29eaad36e5 Make parsetime.c more consistent by using the (already declared) enum
type instead of int all over the place.  (Cosmetic, enhances
debugging.)

Point out that a date specification _must_ follow the time of day
spec, in the man page.  This clarifies the last point PR # of bin/483:
"at doesn't seem to ..." (the remainder has already been fixed with
version 1.3 of parsetime.c).
1995-06-24 17:15:56 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Andrey A. Chernov
b89321a57d Upgrade. 1995-04-12 02:42:39 +00:00
Bruce Evans
68abb9f9db Fix off by one error in calculation of `mday' (months start at 1).
Jan 31 gave Jan 30, often for next year.
1995-01-31 17:54:39 +00:00
Nate Williams
d78e98d22e Added at/atrm/atq/batch from Linux as hacked by Chris Demetriou. 1994-01-05 01:09:14 +00:00