From: Amos Jeffries Date: Sat, 17 Jan 2009 01:31:49 +0000 (+1300) Subject: Bug 2564: logformat '%tl' field not working as advertised X-Git-Tag: SQUID_3_0_STABLE12~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ba085e69d27e9ed5f8a9b6ffb7157d49d07d106;p=thirdparty%2Fsquid.git Bug 2564: logformat '%tl' field not working as advertised --- diff --git a/src/access_log.cc b/src/access_log.cc index cf3901402a..c56b0896eb 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -604,23 +604,22 @@ accessLogCustom(AccessLogEntry * al, customlog * log) case LFT_TIME_GMT: { const char *spec; - struct tm *t; spec = fmt->data.timespec; - if (!spec) - spec = "%d/%b/%Y:%H:%M:%S"; - - if (fmt->type == LFT_TIME_LOCALTIME) + if (fmt->type == LFT_TIME_LOCALTIME) { + if (!spec) + spec = "%d/%b/%Y:%H:%M:%S %z"; t = localtime(&squid_curtime); - else + } else { + if (!spec) + spec = "%d/%b/%Y:%H:%M:%S"; t = gmtime(&squid_curtime); + } strftime(tmp, sizeof(tmp), spec, t); - out = tmp; } - break; case LFT_TIME_TO_HANDLE_REQUEST: