(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)
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
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))
(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))