unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* tar-mode.el (tar-octal-time bug)
@ 2002-05-12  0:28 Vivek Dasmohapatra
  0 siblings, 0 replies; only message in thread
From: Vivek Dasmohapatra @ 2002-05-12  0:28 UTC (permalink / raw)



tar-octal-time (as shipped with emacs 21.2-1 in Debian GNU/Linux)
is implemented as follows:


(defun tar-octal-time (timeval)
  ;; Format a timestamp as 11 octal digits.  Ghod, I hope this works...
  (let ((hibits (car timeval)) (lobits (car (cdr timeval))))
    (insert (format "%05o%01o%05o"
		    (lsh hibits -2)
		    (logior (lsh (logand 3 hibits) 1) (> (logand lobits 32768) 0))
		    (logand 32767 lobits)
		    ))))


I think it's meant to be more like this:

(defun tar-octal-time (timeval)
  ;; Format a timestamp as 11 octal digits.  Ghod, I hope this works...
  (let ((hibits (car timeval)) (lobits (car (cdr timeval))))
    (format "%05o%01o%05o"
	    (lsh hibits -2)
	    (logior (lsh (logand 3 hibits) 1) (if (> lobits 32768) 1 0))
	    (logand 32767 lobits)) ))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-12  0:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-12  0:28 tar-mode.el (tar-octal-time bug) Vivek Dasmohapatra

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).