fix strftime() %z conversion specifier check
only glibc does something sane with gmtime()+strftime(). on bsd (incl. mac os), strftime() can be used only with localtime().
This commit is contained in:
parent
2b27216b86
commit
a49893f32e
|
@ -20,8 +20,8 @@ int main(void)
|
||||||
{
|
{
|
||||||
time_t t = 0;
|
time_t t = 0;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
strftime(buf, sizeof(buf), "%z", gmtime(&t));
|
strftime(buf, sizeof(buf), "%z", localtime(&t));
|
||||||
return !!strcmp(buf, "+0000");
|
return !(buf[0] == '+' || buf[0] == '-');
|
||||||
}
|
}
|
||||||
], [ob_cv_strftime_z=yes], [ob_cv_strftime_z=no], [ob_cv_strftime_z="yes (assumed)"])])
|
], [ob_cv_strftime_z=yes], [ob_cv_strftime_z=no], [ob_cv_strftime_z="yes (assumed)"])])
|
||||||
if test "x$ob_cv_strftime_z" = x"no"; then
|
if test "x$ob_cv_strftime_z" = x"no"; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user