diff lisp/auto-save.el @ 278:90d73dddcdc4 r21-0b37

Import from CVS: tag r21-0b37
author cvs
date Mon, 13 Aug 2007 10:31:29 +0200
parents 41ff10fd062f
children 19dcec799385
line wrap: on
line diff
--- a/lisp/auto-save.el	Mon Aug 13 10:30:38 2007 +0200
+++ b/lisp/auto-save.el	Mon Aug 13 10:31:29 2007 +0200
@@ -421,7 +421,7 @@
   ;; byte-by-byte basis. The polynomial used is D^7 + D^6 + D^3 +1.
   ;; The resulting string consists of hexadecimal digits [0-9a-f].
   ;; In particular, it contains no slash, so it can be used as autosave name."
-  (let ((crc (make-string 7 ?\0)))
+  (let ((crc (make-vector 7 ?\0)))
     (mapc
      (lambda (new)
        (setq new (+ new (aref crc 6)))
@@ -434,13 +434,13 @@
        (aset crc 0 new))
      s)
     (format "%02x%02x%02x%02x%02x%02x%02x"
-	    (aref crc 0)
-	    (aref crc 1)
-	    (aref crc 2)
-	    (aref crc 3)
-	    (aref crc 4)
-	    (aref crc 5)
-	    (aref crc 6))))
+	    (logand 255 (aref crc 0))
+	    (logand 255 (aref crc 1))
+	    (logand 255 (aref crc 2))
+	    (logand 255 (aref crc 3))
+	    (logand 255 (aref crc 4))
+	    (logand 255 (aref crc 5))
+	    (logand 255 (aref crc 6)))))
 
 ;; #### It is unclear to me how the following function is useful.  It
 ;; should be used in `auto-save-name-in-same-directory', if anywhere.