mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-09-12 03:31:58 +00:00
tzalloc should scrub abbreviations, compatibly with tzset.
* localtime.c (settzname): Move scrubbing into ... (scrub_abbrs): ... this new function. (zoneinit): Use it here, rather than in settzname. * NEWS: Document this.
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
News for the tz database
|
||||
|
||||
Unreleased, experimental changes
|
||||
|
||||
Changes affecting code
|
||||
|
||||
tzalloc now scrubs time zone abbreviations compatibly with the way
|
||||
that tzset always has, by replacing invalid bytes with '_' and by
|
||||
shortening too-long abbreviations.
|
||||
|
||||
|
||||
Release 2014j - 2014-11-10 17:37:11 -0800
|
||||
|
||||
Changes affecting current and future time stamps
|
||||
|
||||
+9
-2
@@ -284,8 +284,13 @@ settzname(void)
|
||||
daylight = 1;
|
||||
#endif /* defined USG_COMPAT */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
scrub_abbrs(struct state *sp)
|
||||
{
|
||||
int i;
|
||||
/*
|
||||
** Finally, scrub the abbreviations.
|
||||
** First, replace bogus characters.
|
||||
*/
|
||||
for (i = 0; i < sp->charcnt; ++i)
|
||||
@@ -1209,7 +1214,9 @@ zoneinit(struct state *sp, char const *name)
|
||||
} else {
|
||||
int err = tzload(name, sp, true);
|
||||
if (err != 0 && name && name[0] != ':' && tzparse(name, sp, false))
|
||||
return 0;
|
||||
err = 0;
|
||||
if (err == 0)
|
||||
scrub_abbrs(sp);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user