From d2ada28fe2d5db8b1aec97a278c32c90ba9e1cd6 Mon Sep 17 00:00:00 2001 From: "Brian A. LaMacchia" Date: Mon, 26 Aug 1991 21:47:48 +0000 Subject: [PATCH] Fixed bug in mail-strip-quoted-headers --- v7/src/edwin/rmailsrt.scm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/v7/src/edwin/rmailsrt.scm b/v7/src/edwin/rmailsrt.scm index 1815b789c..8923dcfc2 100644 --- a/v7/src/edwin/rmailsrt.scm +++ b/v7/src/edwin/rmailsrt.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/rmailsrt.scm,v 1.2 1991/08/13 02:31:22 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/rmailsrt.scm,v 1.3 1991/08/26 21:47:48 bal Exp $ ;;; ;;; Copyright (c) 1991 Massachusetts Institute of Technology ;;; @@ -195,9 +195,9 @@ If prefix argument REVERSE is non-nil, sort them in reverse order." ;; ;; added [ ]+ to the regexp to handle date string put out ;; by hx.lcs.mit.edu (they use 2 spaces instead of 1) - (if (re-match-string-forward + (if (re-search-string-forward (re-compile-pattern - ".*\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\)[ ]+\\([0-9:]+\\)" true) + "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\)[ ]+\\([0-9:]+\\)" true) true false date) (string-append ;; Year @@ -236,23 +236,26 @@ If prefix argument REVERSE is non-nil, sort them in reverse order." (define mail-strip-quoted-names (lambda (address) + (display address) + (newline) (let ((pos)) - (if (re-match-string-forward (re-compile-pattern "\\`[ \t\n]*" true) + (if (re-search-string-forward (re-compile-pattern "\\`[ \t\n]*" true) true false address) (set! address (string-tail address (re-match-end-index 0)))) ;; strip surrounding whitespace - (if (re-match-string-forward (re-compile-pattern "[ \t\n]*\\'" true) + (if (re-search-string-forward (re-compile-pattern "[ \t\n]*\\'" true) true false address) (set! address (string-head address (re-match-start-index 0)))) - (let loop () + (let loop () (let ((the-pattern (re-compile-pattern "[ \t]*(\\([^)\"\\]\\|\\\\.\\|\\\\\n\\)*)" true))) - (set! pos (re-match-string-forward the-pattern true false address)) + (set! pos (re-search-string-forward the-pattern true false address)) (if pos (begin - (set! address (mail-string-address - address pos + (set! address (mail-string-delete + address + (re-match-start-index 0) (re-match-end-index 0))) (loop))))) ;; strip `quoted' names (This is supposed to hack `"Foo Bar" ') @@ -279,7 +282,7 @@ If prefix argument REVERSE is non-nil, sort them in reverse order." (re-compile-pattern "\\(,\\|\\`\\)[^,]*<\\([^>,]*>\\)" true))) - (set! pos (re-match-string-forward the-pattern true false address)) + (set! pos (re-search-string-forward the-pattern true false address)) (if pos (let ((junk-beg (re-match-end-index 1)) (junk-end (re-match-start-index 2)) @@ -287,4 +290,4 @@ If prefix argument REVERSE is non-nil, sort them in reverse order." (set! address (mail-string-delete address (-1+ close) close)) (set! address (mail-string-delete address junk-beg junk-end)) (loop))))) - address))) \ No newline at end of file + address))) -- 2.25.1