spamassassin-dev November 2011 archive
Main Archive Page > Month Archives  > spamassassin-dev archives
spamassassin-dev: [Bug 6456] add carriage return to make output

[Bug 6456] add carriage return to make output more readable for Windows

From: <bugzilla-daemon_at_nospam>
Date: Tue Nov 01 2011 - 18:02:59 GMT

--- Comment #9 from Karsten Bräckelmann <> 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
> ok.

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: ------- You are receiving this mail because: ------- You are the assignee for the bug.