mirror of
https://github.com/zsh-users/zsh
synced 2024-09-15 22:20:22 +00:00
35681: fix day of month initialisation
This commit is contained in:
parent
acb05d1616
commit
a257525afc
|
@ -1,5 +1,7 @@
|
||||||
2015-07-03 Oliver Kiddle <opk@zsh.org>
|
2015-07-03 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 35681: Src/Modules/datetime.c: fix day of month initialisation
|
||||||
|
|
||||||
* 35674: Src/Zle/zle_main.c: make an undo event for
|
* 35674: Src/Zle/zle_main.c: make an undo event for
|
||||||
initial buffer contents
|
initial buffer contents
|
||||||
|
|
||||||
|
|
|
@ -53,10 +53,12 @@ reverse_strftime(char *nam, char **argv, char *scalar, int quiet)
|
||||||
* to use the current timezone. This is probably the best guess;
|
* to use the current timezone. This is probably the best guess;
|
||||||
* it's the one that will cause dates and times output by strftime
|
* it's the one that will cause dates and times output by strftime
|
||||||
* without the -r option and without an explicit timezone to be
|
* without the -r option and without an explicit timezone to be
|
||||||
* converted back correctly.
|
* converted back correctly. Additionally, tm_mday is set to 1
|
||||||
|
* as that and not 0 corresponds to the first of the month.
|
||||||
*/
|
*/
|
||||||
(void)memset(&tm, 0, sizeof(tm));
|
(void)memset(&tm, 0, sizeof(tm));
|
||||||
tm.tm_isdst = -1;
|
tm.tm_isdst = -1;
|
||||||
|
tm.tm_mday = 1;
|
||||||
endp = strptime(argv[1], argv[0], &tm);
|
endp = strptime(argv[1], argv[0], &tm);
|
||||||
|
|
||||||
if (!endp) {
|
if (!endp) {
|
||||||
|
|
Loading…
Reference in a new issue