From: morioka Date: Mon, 16 Dec 1996 07:12:38 +0000 (+0000) Subject: (std11-strip-quoted-pair): New implementation. X-Git-Tag: XEmacs-20_3-b6~18 X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fapel.git;a=commitdiff_plain;h=dc69baa8d424c6aab4de6b14c02ec10b328cabfb (std11-strip-quoted-pair): New implementation. --- diff --git a/std11.el b/std11.el index 7342229..e5d6c2c 100644 --- a/std11.el +++ b/std11.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Keywords: mail, news, RFC 822, STD 11 -;; Version: $Id: std11.el,v 0.36 1996-12-02 15:20:12 shuhei-k Exp $ +;; Version: $Id: std11.el,v 0.37 1996-12-16 07:12:38 morioka Exp $ ;; This file is part of MU (Message Utilities). @@ -214,23 +214,23 @@ If BOUNDARY is not nil, it is used as message header separator. )) string "") "\"")) -(defun std11-strip-quoted-pair (str) - (let ((dest "") +(defun std11-strip-quoted-pair (string) + "Strip quoted-pairs in STRING. [std11.el]" + (let (dest + (b 0) (i 0) - (len (length str)) - chr flag) - (while (< i len) - (setq chr (aref str i)) - (if (or flag (not (eq chr ?\\))) - (progn - (setq dest (concat dest (char-to-string chr))) - (setq flag nil) - ) - (setq flag t) + (len (length string)) ) - (setq i (+ i 1)) - ) - dest)) + (while (< i len) + (let ((chr (aref string i))) + (if (eq chr ?\\) + (setq dest (concat dest (substring string b i)) + b (1+ i) + i (+ i 2)) + (setq i (1+ i)) + ))) + (concat dest (substring string b)) + )) (defun std11-strip-quoted-string (string) "Strip quoted-string STRING. [std11.el]"