mirror of
https://github.com/git/git.git
synced 2026-01-22 08:27:53 +00:00
Merge branch 'mingw-strftime'
This topic branch works around an out-of-memory bug when the user specified a format via --date=format:<format> that strftime() does not like. Reported by Stefan Naewe. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -931,6 +931,17 @@ revert_attrs:
|
||||
return rc;
|
||||
}
|
||||
|
||||
#undef strftime
|
||||
size_t mingw_strftime(char *s, size_t max,
|
||||
const char *format, const struct tm *tm)
|
||||
{
|
||||
size_t ret = strftime(s, max, format, tm);
|
||||
|
||||
if (!ret && errno == EINVAL)
|
||||
die("invalid strftime format: '%s'", format);
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int sleep (unsigned int seconds)
|
||||
{
|
||||
Sleep(seconds*1000);
|
||||
|
||||
@@ -446,6 +446,9 @@ extern int (*lstat)(const char *file_name, struct stat *buf);
|
||||
|
||||
int mingw_utime(const char *file_name, const struct utimbuf *times);
|
||||
#define utime mingw_utime
|
||||
size_t mingw_strftime(char *s, size_t max,
|
||||
const char *format, const struct tm *tm);
|
||||
#define strftime mingw_strftime
|
||||
|
||||
pid_t mingw_spawnvpe(const char *cmd, const char **argv, char **env,
|
||||
const char *dir,
|
||||
|
||||
Reference in New Issue
Block a user