X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fhttp_datestring.c;h=33158dca92e20d1a9f48d54373a21bb597c4b48e;hb=86a1d535af8c52cc9536b03b707eed2d8674da31;hp=2e2bef8dafbde31c11dee9811a0a652acdb97cd9;hpb=3d35459a4c1eae50e3ef427de8e93eec8cdcd5c4;p=citadel.git diff --git a/webcit/http_datestring.c b/webcit/http_datestring.c index 2e2bef8da..33158dca9 100644 --- a/webcit/http_datestring.c +++ b/webcit/http_datestring.c @@ -1,13 +1,3 @@ -/* - * $Id$ - */ -/** - * \defgroup HTTPDateTime Function to generate HTTP-compliant textual time/date stamp - * (This module was lifted directly from the Citadel server source) - * - * \ingroup WebcitHttpServer - */ -/*@{*/ #include "webcit.h" /** HTTP Months - do not translate - these are not for human consumption */ @@ -71,7 +61,11 @@ void tmplput_nowstr(StrBuf *Target, WCTemplputParams *TP) time_t now; now = time(NULL); +#ifdef HAVE_SOLARIS_LOCALTIME_R + asctime_r(localtime(&now), buf, sizeof(buf)); +#else asctime_r(localtime(&now), buf); +#endif bufused = strlen(buf); if ((bufused > 0) && (buf[bufused - 1] == '\n')) { buf[bufused - 1] = '\0'; @@ -93,5 +87,3 @@ InitModule_DATE RegisterNamespace("DATE:NOW:STR", 0, 0, tmplput_nowstr, NULL, CTX_NONE); RegisterNamespace("DATE:NOW:NO", 0, 0, tmplput_nowno, NULL, CTX_NONE); } - -/*@}*/