set_git_dir: die when setenv() fails
[gitweb.git] / compat / mingw.c
index 2d44d21aca8d31f67b16cb9a90245b4db526ff76..a67872babf332b7d8177e8477c2ee595d8cbbd3f 100644 (file)
@@ -761,6 +761,17 @@ int mingw_utime (const char *file_name, const struct utimbuf *times)
        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);