Gnus development mailing list
 help / color / mirror / Atom feed
From: "Darren/Torin/Who Ever..." <torin@daft.com>
Subject: bug in gnus-encode-date (in gnus-util.el) with patch
Date: 31 May 1997 01:01:00 -0700	[thread overview]
Message-ID: <87206o5aun.fsf@perv.daft.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----

gnus-encode-date is a handy little function that will turn a mail header
date into an Emacs date.  Useful for user-format functions.

Unfortunately, it has a bug.  It calls timezone-parse-date for the meaty
work returning an array of time elements which are then passed to
encode-time in the appropriate order.  The problem occurs since
timezone-parse-date just returns whatever timezone data was in the
message and encode-time expects the timezone data to be in seconds off
of GMT.

The following (simple) patch fixes this.  It's indented two spaces to
foil patch mangling by pgp.  (patch will still like it.)

  --- gnus-5.4.55.old/lisp/gnus-util.el	Sat May 17 22:37:16 1997
  +++ gnus-5.4.55/lisp/gnus-util.el	Thu May 29 19:14:59 1997
  @@ -255,7 +255,7 @@
	   (date (mapcar (lambda (d) (and d (string-to-int d))) parse))
	   (time (mapcar 'string-to-int (timezone-parse-time (aref parse 3)))))
       (encode-time (caddr time) (cadr time) (car time)
  -		 (caddr date) (cadr date) (car date) (nth 4 date))))
  +		 (caddr date) (cadr date) (car date) (* 60 (timezone-zone-to-minute (nth 4 date))))))

   (defun gnus-time-minus (t1 t2)
     "Subtract two internal times."


Darren
- -- 
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire.  C/Perl/CGI programmer and tutor. @

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM4/ayI4wrq++1Ls5AQFtkAP+K+6wnAJx60vxdHiOxrP/pmNJafG1FLqh
QiVNbe8N93T1aj1Zw9/mpT2m35ehr1Fno0hF4qTuLW/92qHyY0kCO9ooCz1ai+ud
qCBePxZdR3qli2u5zKMjeLc0zINd4ja390QYCO6TodCxSGsBEcUqb+Np2fMzRq03
xqsKU9Oqg40=
=riTU
-----END PGP SIGNATURE-----


                 reply	other threads:[~1997-05-31  8:01 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87206o5aun.fsf@perv.daft.com \
    --to=torin@daft.com \
    /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 NNTP newsgroup(s).