[pan2] Fix the strftime test for mingw64
- From: Petr Kovář <pmkovar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] Fix the strftime test for mingw64
- Date: Tue, 25 Apr 2017 23:02:44 +0000 (UTC)
commit 1c4598aedd71bc5f400fd4706960d9c81aae0af5
Author: Steve Davies <davies147 gmail com>
Date: Wed Apr 26 00:39:57 2017 +0200
Fix the strftime test for mingw64
mingw64's strftime returns an empty string when the %l and %h
tokens are not understood.
configure.ac | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ccc1ea9..2051e97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,13 +260,14 @@ dnl Check to see if strftime supports the use of %l and %k
AC_MSG_CHECKING(for %l and %k support in strftime)
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
+#include <stdlib.h>
#include <time.h>
int main(int argc, char **argv) {
char buf[10];
time_t rawtime = time(0);
struct tm *timeinfo = localtime (&rawtime);
strftime(buf, 10, "%l %k", timeinfo);
- exit (strstr(buf, "l") || strstr(buf, "k") || !strcmp(buf," "));
+ exit (strstr(buf, "l") || strstr(buf, "k") || !strcmp(buf," ") || !strlen(buf));
}]])],[
AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
ac_cv_lkstrftime=yes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]