Skip to content

Commit

Permalink
Change savegame date description format to %x %X which is short, desc…
Browse files Browse the repository at this point in the history
…riptive and locale-dependent. Patch by Emdek, closes ticket:2303

(cherry picked from commit e41fa8f)
  • Loading branch information
perim authored and cybersphinx committed Dec 11, 2010
1 parent eac4ca8 commit ec1bbcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/loadsave.c
Expand Up @@ -321,6 +321,7 @@ static BOOL _addLoadSave(BOOL bLoad, const char *sSearchPath, const char *sExten
W_BUTTON *button;
char savefile[256];
time_t savetime;
struct tm *timeinfo;

// See if this filename contains the extension we're looking for
if (!strstr(*i, checkExtension))
Expand All @@ -336,7 +337,8 @@ static BOOL _addLoadSave(BOOL bLoad, const char *sSearchPath, const char *sExten
/* Figure save-time */
snprintf(savefile, sizeof(savefile), "%s/%s", sSearchPath, *i);
savetime = PHYSFS_getLastModTime(savefile);
sstrcpy(sSlotTips[slotCount], ctime(&savetime));
timeinfo = localtime(&savetime);
strftime(sSlotTips[slotCount], sizeof(sSlotTips[slotCount]), "%x %X", timeinfo);

/* Set the button-text */
(*i)[strlen(*i) - 4] = '\0'; // remove .gam extension
Expand Down

0 comments on commit ec1bbcb

Please sign in to comment.