changeset 880:52a05f4884a4

entered into RCS
author Eric S. Raymond <esr@snark.thyrsus.com>
date Mon, 27 Jul 1992 06:59:29 +0000
parents 6dc5b7273a07
children 945558e05127
files lisp/abbrev.el lisp/tar-mode.el
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/abbrev.el	Mon Jul 27 05:31:49 1992 +0000
+++ b/lisp/abbrev.el	Mon Jul 27 06:59:29 1992 +0000
@@ -2,8 +2,6 @@
 
 ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
 
-;; Maintainer: FSF
-
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
--- a/lisp/tar-mode.el	Mon Jul 27 05:31:49 1992 +0000
+++ b/lisp/tar-mode.el	Mon Jul 27 06:59:29 1992 +0000
@@ -916,6 +916,15 @@
       (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 @@
 		  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.