mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix git loading of odd locales
This should make git loading be able to load git saves with arbitrary weekday names. Even strange German ones. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f692c39ac7
commit
d1839769ee
1 changed files with 12 additions and 6 deletions
18
load-git.c
18
load-git.c
|
@ -934,15 +934,21 @@ static int dive_directory(const char *root, const char *name, int timeoff)
|
||||||
{
|
{
|
||||||
int yyyy = -1, mm = -1, dd = -1;
|
int yyyy = -1, mm = -1, dd = -1;
|
||||||
int h, m, s;
|
int h, m, s;
|
||||||
int mday_off = timeoff - 7;
|
int mday_off, month_off, year_off;
|
||||||
int month_off = mday_off - 3;
|
|
||||||
int year_off = month_off - 5;
|
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
/* There has to be a mday */
|
/* Skip the '-' before the time */
|
||||||
if (mday_off < 0)
|
mday_off = timeoff;
|
||||||
|
if (!mday_off || name[--mday_off] != '-')
|
||||||
return GIT_WALK_SKIP;
|
return GIT_WALK_SKIP;
|
||||||
if (name[timeoff-1] != '-')
|
/* Skip the day name */
|
||||||
|
while (mday_off > 0 && name[--mday_off] != '-')
|
||||||
|
/* nothing */;
|
||||||
|
|
||||||
|
mday_off = mday_off - 2;
|
||||||
|
month_off = mday_off - 3;
|
||||||
|
year_off = month_off - 5;
|
||||||
|
if (mday_off < 0)
|
||||||
return GIT_WALK_SKIP;
|
return GIT_WALK_SKIP;
|
||||||
|
|
||||||
/* Get the time of day */
|
/* Get the time of day */
|
||||||
|
|
Loading…
Add table
Reference in a new issue