From: Bruno Haible Date: Wed, 15 Aug 2001 14:35:11 +0000 (+0000) Subject: Fix probable error in po-find-charset. X-Git-Tag: v0.11~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace0f87f35dd6dd082deb70c1da397758cd2f807;p=thirdparty%2Fgettext.git Fix probable error in po-find-charset. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index b34c8ce9e..2ce477569 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2001-08-02 Karl Eichwalder + + * po-mode.el (po-find-charset): Drop 'interactive'. Use + 'insert-file-contents-literally' to avoid side effects. Correct off + by 1 error. + 2001-08-07 Karl Eichwalder * po-mode.el (po-subedit-mode-menu-layout): New definition. diff --git a/misc/po-mode.el b/misc/po-mode.el index b692dad2b..3cb076a4d 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -751,8 +751,9 @@ Content-Type into a Mule coding system.") (while (not (or short-read (re-search-forward "^msgid" nil t))) (save-excursion (goto-char (point-max)) - (let ((pair (insert-file-contents filename nil - (1- (point)) (1- (+ (point) 4096))))) + (let ((pair (insert-file-contents-literally filename nil + (1- (point)) + (1- (+ (point) 4096))))) (setq short-read (< (nth 1 pair) 4096))))) (cond (short-read nil) ((re-search-forward charset-regexp nil t) (match-string 1)) @@ -761,7 +762,9 @@ Content-Type into a Mule coding system.") ;; isn't available, give up. (t (save-excursion (goto-char (point-max)) - (insert-file-contents filename nil (point) (+ (point) 1024))) + (insert-file-contents-literally filename nil + (1- (point)) + (1- (+ (point) 1024)))) (if (re-search-forward charset-regexp nil t) (match-string 1))))))