summaryrefslogtreecommitdiff
path: root/lisp/tar-mode.el
diff options
context:
space:
mode:
authorEric S. Raymond <esr@snark.thyrsus.com>1992-07-27 06:59:29 +0000
committerEric S. Raymond <esr@snark.thyrsus.com>1992-07-27 06:59:29 +0000
commit514ad44cba07c57cd46a2940770df22acfbaed2f (patch)
tree06679b7f12f11e00ea46c96bd3da85afb9c1f801 /lisp/tar-mode.el
parentbd206b8c2937b5bade65d7fc86f86a0c301c510f (diff)
downloademacs-514ad44cba07c57cd46a2940770df22acfbaed2f.tar.gz
entered into RCS
Diffstat (limited to 'lisp/tar-mode.el')
-rw-r--r--lisp/tar-mode.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 534204e6124..e7ad08c4404 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -916,6 +916,15 @@ for this to be permanent."
(narrow-to-region 1 tar-header-offset))))
+(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)
+ ))))
+
(defun tar-subfile-save-buffer ()
"In tar subfile mode, write this buffer back into its parent tar-file buffer.
This doesn't write anything to disk - you must save the parent tar-file buffer
@@ -974,7 +983,7 @@ to make your changes permanent."
nil
(goto-char (+ header-start tar-time-offset))
(delete-region (point) (+ (point) 12))
- (insert (format "%11o" (current-time)))
+ (insert (tar-octal-time (current-time)))
(insert ? ))
;;
;; compute a new checksum and insert it.