[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17814: 24.3.91; better string manipulation in subr-x
From: |
Stefan Monnier |
Subject: |
bug#17814: 24.3.91; better string manipulation in subr-x |
Date: |
Fri, 20 Jun 2014 15:14:56 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
> (string-match "\\`[\s\t\n\r]*\\(.*?\\)[\s\t\n\r]*\\'" string)
> (if (or (< 0 (match-beginning 1)) (< (match-end 1) (match-end 0)))
> (match-string 1 string)
> string))
The above string-match will fail on a string that has a newline, and the
subsequent code will use whatever was the old match-data, resulting in
broken behavior.
Other than that, I don't have any opinion on such changes (I've never
heard anyone complain about code size or cpu-time of any of those
functions, so I think it largely doesn't matter either way).
Stefan