|Main Archive Page > Month Archives > spamassassin-dev archives|
--- Comment #9 from Karsten BrÃ¤ckelmann <firstname.lastname@example.org> 2011-11-01 18:02:59 UTC ---
(In reply to comment #8)
> Created attachment 5003 [details]
> Revised Carriage Return patch to use $/
$delimiter =~ s/[\r\n]//g;
That's backwards, you wanted to weed out any *non* [\r\n] chars.
> Attached is a compromise since I feel better sanitizing it to make sure it's
Sanitizing your variables always is a good idea, but still, I guess in this
case really not necessary. If we (or anyone else) messes with the input record
separator, it sure is done local()-ly. Otherwise, the code would break all over
the place, and your STDERR logging is the least of your problems.
The input record separator $/ is what chomp() uses internally. Which we use in
95 places in 39 files -- without sanitizing it.
$ find . -name '*.pm' | xargs grep -l chomp | wc -l
Pending confirmation of $/ doing the expected on Windows systems (Daniel?), I'd
prefer to drop that entire $delimiter dance, and simply use $/ instead of \n.
(As a side-note, the caveats in comment 4 and 5 about old Mac OS <= 9 appears
to be a non-issue. \n is a logical newline, and evaluates appropriately even on
old Mac OS systems. See perlport, section Newline.)
-- Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.