Commit 056ccdc
committed
set LC_TIME even if locale dir is not present
Since Commit aa1462c (introduce "format" date-mode, 2015-06-25) git log can pass
user specified format strings directly to strftime(). One special format string we
explicitly mention in our documentation is %c, which depends on the system locale.
To accommodate for %c we added a call to setlocale() in git_setup_gettext().
In Commit cc5e1bf (gettext: avoid initialization if the locale dir is not present,
2018-04-21) we added an early exit to git_setup_gettext() in case no textdomain
directory is present. This early exit is so early, that we don't even set the
locale for %c in that case, despite strftime() not needing the textdomain directory
at all.
This leads to a subtle bug where `git log --date=format:%c` will use C locale instead
of the system locale on systems without a valid textdomain directory.
This fixes git-for-windows#2959
Signed-off-by: Matthias Aßhauer <mha1993@live.de>1 parent abf474a commit 056ccdc
3 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
413 | 417 | | |
414 | 418 | | |
415 | 419 | | |
| |||
2862 | 2866 | | |
2863 | 2867 | | |
2864 | 2868 | | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
2865 | 2872 | | |
2866 | 2873 | | |
2867 | 2874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
120 | | - | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
28 | 51 | | |
29 | 52 | | |
30 | 53 | | |
| |||
544 | 567 | | |
545 | 568 | | |
546 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
547 | 578 | | |
548 | 579 | | |
549 | 580 | | |
| |||
0 commit comments