comparison lisp/tar-mode.el @ 39471:3ca0c12d72fe

(tar-mode-write-file): Don't signal an error by calling byte-to-position with a nil tar-header-offset.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 27 Sep 2001 08:11:36 +0000
parents 03376ff9ccfd
children e4b5d4e63bd3
comparison
equal deleted inserted replaced
39470:3411e4da792d 39471:3ca0c12d72fe
1243 ;; I suppose this is run in a context where changing the buffer is bad. 1243 ;; I suppose this is run in a context where changing the buffer is bad.
1244 ;; (tar-pad-to-blocksize) 1244 ;; (tar-pad-to-blocksize)
1245 ;; tar-header-offset turns out to be null for files fetched with W3, 1245 ;; tar-header-offset turns out to be null for files fetched with W3,
1246 ;; at least. 1246 ;; at least.
1247 (let ((coding-system-for-write 'no-conversion)) 1247 (let ((coding-system-for-write 'no-conversion))
1248 (write-region (or (byte-to-position tar-header-offset) 1248 (write-region (if tar-header-offset
1249 (point-min)) 1249 (byte-to-position tar-header-offset)
1250 (point-min))
1250 (point-max) 1251 (point-max)
1251 buffer-file-name nil t)) 1252 buffer-file-name nil t))
1252 (tar-clear-modification-flags) 1253 (tar-clear-modification-flags)
1253 (set-buffer-modified-p nil)) 1254 (set-buffer-modified-p nil))
1254 (narrow-to-region 1 (byte-to-position tar-header-offset))) 1255 (narrow-to-region 1 (byte-to-position tar-header-offset)))