From ace0f87f35dd6dd082deb70c1da397758cd2f807 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 15 Aug 2001 14:35:11 +0000 Subject: [PATCH] Fix probable error in po-find-charset. --- misc/ChangeLog | 6 ++++++ misc/po-mode.el | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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)))))) -- 2.47.3