From: Kevin Ryde <user42@zip.com.au>
Subject: gmtime tm_zone
Date: Thu, 04 Mar 2004 07:12:49 +1000 [thread overview]
Message-ID: <87k721tz1q.fsf@zip.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
* stime.c (scm_gmtime): Return bd_time->tm_zone when available, rather
than "GMT" always.
On glibc tm_zone is "GMT", so this is no change there. But I'm
inclined to think that if scm_gmtime is designed to return what
gmtime() returns then it should take care to give back whatever zone
name the latter has indicated.
[-- Attachment #2: stime.c.gmtime-zone.diff --]
[-- Type: text/plain, Size: 790 bytes --]
--- stime.c.~1.84.~ 2004-02-18 09:38:38.000000000 +1000
+++ stime.c 2004-03-03 10:11:33.000000000 +1000
@@ -255,7 +255,7 @@
#undef FUNC_NAME
static SCM
-filltime (struct tm *bd_time, int zoff, char *zname)
+filltime (struct tm *bd_time, int zoff, const char *zname)
{
SCM result = scm_c_make_vector (11, SCM_UNDEFINED);
@@ -405,6 +405,7 @@
timet itime;
struct tm *bd_time;
SCM result;
+ const char *zname;
itime = SCM_NUM2LONG (1, time);
SCM_DEFER_INTS;
@@ -414,7 +415,12 @@
bd_time = gmtime (&itime);
if (bd_time == NULL)
SCM_SYSERROR;
- result = filltime (bd_time, 0, "GMT");
+#if HAVE_STRUCT_TM_TM_ZONE
+ zname = bd_time->tm_zone;
+#else
+ zname = "GMT";
+#endif
+ result = filltime (bd_time, 0, zname);
SCM_ALLOW_INTS;
return result;
}
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
reply other threads:[~2004-03-03 21:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k721tz1q.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).