]> git.donarmstrong.com Git - debbugs.git/commitdiff
use s/// instead of tr///, as tr must use one and only one character
authorDon Armstrong <don@donarmstrong.com>
Fri, 15 Mar 2013 22:57:57 +0000 (15:57 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 15 Mar 2013 22:57:57 +0000 (15:57 -0700)
scripts/spamscan-sa

index 29a1fb6ff141a9ff9f2879a565cec5d941a5c6ce..3f6c26f490a650d8c7f6747febb9ef850194f2ce 100755 (executable)
@@ -24,7 +24,8 @@ sub header_or_empty ($$) {
     my $value = $mail->get_header($hdr);
     if (defined $value) {
        chomp $value;
-       $value =~ tr/\n/\\n/;
+        # replace newlines with '\n'
+       $value =~ s/\n/\\n/g;
        return $value;
     }
     return '';