From: ueno Date: Tue, 7 Dec 2004 06:45:05 +0000 (+0000) Subject: Fixed. X-Git-Tag: riece-1_0_7~119 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1cc9bfb307c6879fe9d55e725ff96f75ee0e8db;p=elisp%2Friece.git Fixed. --- diff --git a/lisp/riece-log.el b/lisp/riece-log.el index f8d6b47..e10e8d6 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -129,7 +129,7 @@ If integer, flash back only this line numbers. t means all lines." (setq name (cdr map)) (expand-file-name (riece-log-encode-file-name prefix) (expand-file-name - (riece-log-encode-file-name (concat "." server)) + (concat "." (riece-log-encode-file-name server)) riece-log-directory))))) (defun riece-log-encode-file-name (file-name) @@ -139,27 +139,26 @@ If integer, flash back only this line numbers. t means all lines." riece-log-file-name-coding-system))) (let ((index 0) c) - (while (string-match "[^-0-9A-Za-z=_\x80-\xFF]" file-name index) - (setq c (aref file-name (match-beginning 0)) - file-name (replace-match - (if (eq c ?=) - "==" - (format "=%02X" c)) - nil t file-name) - index (+ 3 index))) + (while (string-match "[^-0-9A-Za-z_\x80-\xFF]" file-name index) + (setq c (aref file-name (match-beginning 0))) + (if (eq c ?=) + (setq file-name (replace-match "==" nil t file-name) + index (1+ (match-end 0))) + (setq file-name (replace-match (format "=%02X" c) nil t file-name) + index (+ 2 (match-end 0))))) file-name)) (defun riece-log-decode-file-name (file-name) (let ((index 0)) (while (string-match "==\\|=\\([0-7][0-9A-F]\\)" file-name index) (setq file-name (replace-match - (if (eq (aref file-name (match-end 0)) ?=) + (if (eq (aref file-name (1- (match-end 0))) ?=) "=" (char-to-string (car (read-from-string (concat "?\\x" (match-string 1 file-name)))))) nil t file-name) - index (1+ index))) + index (1+ (match-beginning 0)))) file-name) (if riece-log-file-name-coding-system (setq file-name diff --git a/lisp/test/test-riece-log.el b/lisp/test/test-riece-log.el index 127a0eb..70eee62 100644 --- a/lisp/test/test-riece-log.el +++ b/lisp/test/test-riece-log.el @@ -61,10 +61,16 @@ case (equal "=23riece" (riece-log-encode-file-name "#riece"))) + (message "!!! %S" (riece-log-encode-file-name "#riece:*.jp")) (lunit-assert-2 case (equal "=23riece=3A=2A=2Ejp" - (riece-log-encode-file-name "#riece:*.jp"))))) + (riece-log-encode-file-name "#riece:*.jp"))) + (message "%S" (riece-log-encode-file-name "#riece=")) + (lunit-assert-2 + case + (equal "=23riece==" + (riece-log-encode-file-name "#riece="))))) (luna-define-method test-riece-log-encode-file-name-mule ((case test-riece-log)) @@ -95,7 +101,11 @@ (lunit-assert-2 case (equal "#riece:*.jp" - (riece-log-decode-file-name "=23riece=3A=2A=2Ejp"))))) + (riece-log-decode-file-name "=23riece=3A=2A=2Ejp"))) + (lunit-assert-2 + case + (equal "#riece=" + (riece-log-decode-file-name "=23riece=="))))) (luna-define-method test-riece-log-decode-file-name-mule ((case test-riece-log))