From 60a0c450eb8ce47193e5cf3b6c9ca282296720ca Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 14 Jun 2013 00:46:28 +0200 Subject: [PATCH] command: use more standard time format for clock property %k is not very standard. The manpage notes them as conforming to "Olson's timezone package", and it's not standard C89, C99 or POSIX. mingw doesn't provide it, and even some of the smaller Linux libcs don't have support. Use %H instead. This gives slightly different results, but I think this is ok. Difference in behavior between these summarized: %k: "single digits are preceded by a blank" %H: "range 00 to 23" --- core/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/command.c b/core/command.c index 8ba58867dd..4da0653425 100644 --- a/core/command.c +++ b/core/command.c @@ -629,7 +629,7 @@ static int mp_property_clock(m_option_t *prop, int action, void *arg, time_t t = time(NULL); struct tm *tmp = localtime(&t); - if ((tmp != NULL) && (strftime(outstr, sizeof(outstr), "%k:%M", tmp) == 5)) + if ((tmp != NULL) && (strftime(outstr, sizeof(outstr), "%H:%M", tmp) == 5)) return m_property_strdup_ro(prop, action, arg, outstr); return M_PROPERTY_UNAVAILABLE; }