Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes jabber-parse-time bug in parsing fractional seconds #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions jabber-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,15 @@ TIME is in a format accepted by `format-time-string'."
(hour (string-to-number (substring time 11 13)))
(minute (string-to-number (substring time 14 16)))
(second (string-to-number (substring time 17 19)))
;; fractions are optional
(fraction (if (eq (aref time 19) ?.)
(string-to-number (substring time 20 23))))
(timezone (substring time (if fraction 23 19))))
(timezone (if (eq (aref time 19) ?.)
;; fractions are optional
(let ((timezone (cadr
(split-string (substring time 20)
"[-+Z]"))))
(if (string= "" timezone)
"Z"
timezone))
(substring time 19))))
;; timezone is either Z (UTC) or [+-]HH:MM
(let ((timezone-seconds
(if (string= timezone "Z")
Expand Down