Commit 3d7fc2fb authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

entered into RCS

parent 0fc37e7d
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
;; Maintainer: FSF
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify ;; GNU Emacs is free software; you can redistribute it and/or modify
......
...@@ -916,6 +916,15 @@ for this to be permanent." ...@@ -916,6 +916,15 @@ for this to be permanent."
(narrow-to-region 1 tar-header-offset)))) (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 () (defun tar-subfile-save-buffer ()
"In tar subfile mode, write this buffer back into its parent tar-file 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 This doesn't write anything to disk - you must save the parent tar-file buffer
...@@ -974,7 +983,7 @@ to make your changes permanent." ...@@ -974,7 +983,7 @@ to make your changes permanent."
nil nil
(goto-char (+ header-start tar-time-offset)) (goto-char (+ header-start tar-time-offset))
(delete-region (point) (+ (point) 12)) (delete-region (point) (+ (point) 12))
(insert (format "%11o" (current-time))) (insert (tar-octal-time (current-time)))
(insert ? )) (insert ? ))
;; ;;
;; compute a new checksum and insert it. ;; compute a new checksum and insert it.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment