Commit Graph

58 Commits

Author SHA1 Message Date
ginsbach 3219a72f94 Don't attempt to set TM_ZONE (name) for 'J' as isdst isn't known. 2015-10-31 03:42:00 +00:00
christos 3c0ef4294c make %Z and %z understand the same strings. 2015-10-31 02:14:08 +00:00
ginsbach fb679626c8 Add 'J' (Juliett) as military time zone name meaning the local time zone. 2015-10-30 21:36:25 +00:00
christos eff9b12acf drop stray #endif 2015-10-30 18:20:16 +00:00
christos 5ba7c63c3a revert timezone() ifdef; it is wrong (pointed out by ginsbach) 2015-10-30 18:04:42 +00:00
ginsbach 862d86e79e ISO 8601 and RFC 3339 specify that an offset can be up to 23:59 and
not 12:00 east/west.  Just proves that one shouldn't use other
implementations as a canonical reference.  Thanks to all who pointed
this out.
2015-10-30 03:18:10 +00:00
ginsbach a5eaa096be Reject timezone offsets more than 12 hours (east or west). 2015-10-30 01:49:36 +00:00
christos 5eac10702e - use #defined constants (from gisbach)
- back to setting tm_zone to NULL when we don't know.
2015-10-29 19:18:19 +00:00
christos 4ba084a19e PR/50380: Balazs Scheidler: strptime() returns incorrect values in tm_gmtoff
- Always offset in seconds.
- Handle arbitrary timezones.
2015-10-29 17:54:49 +00:00
christos f9589d4feb Release 2015g - 2015-10-01 00:39:51 -0700
Changes affecting code

    localtime no longer mishandles America/Anchorage after 2037.
    (Thanks to Bradley White for reporting the bug.)

    The localtime module allows the variables 'timezone', 'daylight',
    and 'altzone' to be in common storage shared with other modules,
    and declares them in case the system <time.h> does not.
    (Problems reported by Kees Dekker.)

    On platforms with tm_zone, strftime.c now assumes it is not NULL.
    This simplifies the code and is consistent with zdump.c.
    (Problem reported by Christos Zoulas.)

  Changes affecting documentation

   The tzfile man page now documents that transition times denote the
   starts (not the ends) of the corresponding time periods.
   (Ambiguity reported by Bill Seymour.)
2015-10-09 17:21:45 +00:00
ginsbach b6db50f38d Only apply am/pm adjustment to tm_hour when it has actually been parsed. 2015-07-29 20:32:54 +00:00
ginsbach 8b0d942b48 More KNF style changes -- consistent use of whitespace in #defines. 2015-07-22 13:33:59 +00:00
ginsbach 2cacd9205d KNF and additional comments 2015-07-20 14:37:11 +00:00
ginsbach f7bfe448b0 Don't set state when parsing any timezone (%z) information. The '+' in
this case isn't the same as the FreeBSD '%+' str[fp]time() (GNU) extension.
2015-07-15 13:54:38 +00:00
ginsbach d2fb39874a Set S_WDAY state for %u (same as it is set for %w). 2015-07-14 18:07:17 +00:00
ginsbach ad43142fb9 Switch to using isleap() and isleap_sum() macros from <tzfile.h> to be
consistent with strftime.c and localtime.c.
2015-07-13 17:45:16 +00:00
ginsbach 700896bffd Add macros to clarify what (parse) state is needed to calculate 'missing'
tm fields.
2015-07-08 19:48:20 +00:00
ginsbach 6d93b92ef8 Rename flags to state since that is really what flags tracks (parse state). 2015-07-08 18:44:09 +00:00
christos dacd5c569a PR/50009: David CARLIER: Enhance strptime to fill out more fields when it
can. From FreeBSD.
2015-07-03 13:06:54 +00:00
ginsbach 08257a48e9 Add UTC as a synonym for GMT (%Z). [from FreeBSD] 2015-04-06 14:38:22 +00:00
joerg e0ac190e1e Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
2013-05-17 12:55:56 +00:00
joerg 99fac95b50 Store time-specific locale data directly in the locale.
Ad dstrftime_l, strftime_lz and strptime_l.
2013-04-21 17:45:46 +00:00
christos c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
matt f3848e2eb2 Back errant change due to botched merge. 2009-12-14 20:45:02 +00:00
matt c7af27854b Suppress a warning if time_t is __int64_t 2009-12-14 05:51:56 +00:00
ginsbach 98fa92ea04 Add %s to strptime(3) to make symmetric with strftime(3). 2009-05-24 02:25:43 +00:00
ginsbach 8f7e60d3bc Extend %z to support all RFC-2822 timezone formats. 2009-05-01 20:15:05 +00:00
christos 9f012c8aed don't forget to use neg. 2008-11-04 21:08:33 +00:00
christos 2844d6eadc we don't need * 2008-11-04 20:17:56 +00:00
christos b4be570207 Our new syslogd seems to want to depend on %z which is a gnu extension.
- While here, add all the rest of gnu extensions: %g, %G, %u.
- Fix long standing bug where %Z would not work because "private.h" was
  not included. (Hi Brian!)
2008-11-04 18:37:28 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ginsbach b876d7a7df Add %F the ISO 8601 date format which is equivalent to %Y-%m-%d. This
format character is supported for reasons of symmetry with strftime(3).
FreeBSD and GNU versions of strptime(3) both support %F.
2008-04-25 20:51:10 +00:00
ginsbach 43e9d46aab Add support for %Z ala FreeBSD and some other strptime(3) implementations.
Reviewed by christos.
2008-04-24 21:34:48 +00:00
christos 03256c6e55 WARNS=4 2005-11-29 03:11:58 +00:00
dsl 8476342d19 Some more optimisations - I must stop looking at this file!
Update copyright to include 2005
(I have a compleetly different version, but it is only a few 100 bytes
smaller due to a 560 byte data area.)
2005-03-05 14:07:15 +00:00
dsl 3fa8666b4f A going-over with the optimiser, save over 500 bytes.
I think this is enough to get rescue_tiny to fit again.
While there fix some bugs:
- %y failed to subtract 1900 from tm_year
- %p (am/pm) only worked at the end of the string
- %E% was treated at %% (ie match a % character)
regression test being added....
2005-03-04 21:41:42 +00:00
christos 52b46a0f13 fix u_char -> char and char -> u_char casts. 2000-12-20 20:56:34 +00:00
cgd b2b63ed4f4 Newer GCCs give warnings when the result of preprocessor token pasting
is not itself a valid (single) preprocessor token.  In other words, don't
use __CONCAT() to add a structure member name to a pointer dereference.
2000-12-19 22:20:48 +00:00
itohy 7daefc5a5a Passing "char" values to ctype(3) functions is problematic.
If an argument of a ctype function is outside "unsigned char"
and if it is not EOF, the behavior is undefined.

The isascii(3) is the sole exception of above and it was used to
be used to check a value was valid for other ctype functions in
ancient systems.  On modern systems, the ctype functions take
all values of "unsigned char", and this check is obsolete and
even wrong for non-ASCII systems.  However, we leave the isascii()
untouched for now, so as not to change the current behavior.
2000-07-07 08:03:36 +00:00
mycroft 605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
tv d6b5fedecb Use correct number of digits as described in lib/7001. This brings us
pretty close to UNIX98, but %U and %W still don't work.
1999-04-29 02:58:30 +00:00
christos f4c1479174 delint 1998-11-15 17:10:30 +00:00
kleink 16afbbecd6 Cosmetical changes, and squash some lint. 1998-09-07 14:11:37 +00:00
veego 13e0e871f8 Fix new egcs warnings (might be used uninitialized). 1998-08-20 13:36:25 +00:00
tv db7189d433 As inspired by PR #5268 from jpo@easterngraphics.com:
- make string comparisons case-insensitive
- add description of whitespace in the format string
- note that %t and %n match no whitespace as well as some whitespace
- change wording of standard to say "includes all requirements of"
  instead of "conforms to" XPG4 as our %y is extended beyond XPG4
1998-05-05 14:15:32 +00:00
tv 3c5e426d70 Fixes from PRs 5056 and 5161, partly rethought:
- %C and %y can be used in conjunction properly, though %y can have its
  old behaviour if used without %C
- %I formats hous 0..11 with 0 representing "12"; this is correct both
  with and without am/pm (%p rule fixed to compensate)
- %j fixed for range [0..365] in struct tm
- %m fixed for range [0..11] in struct tm
- %S fixed for range [0..61] in struct tm
1998-03-19 16:21:35 +00:00
mycroft b7728ce9c9 Pull in tzfile.h. 1998-01-20 21:39:40 +00:00
mycroft a5f873989a Update dates. 1998-01-20 21:10:08 +00:00
mycroft 7f0df00dd7 The rollover for the previous is 1969, not 1970. 1998-01-20 20:47:46 +00:00
mycroft 13156da2e5 Fix an old comment 1998-01-20 20:41:49 +00:00