Change 23649 by [EMAIL PROTECTED] on 2004/12/14 10:35:57
Allow escaping %m as %%m in Sys::Syslog format strings
(suggested by Joshua Richardson <[EMAIL PROTECTED]>
and Yitzchak Scott-Thoennes)
Affected files ...
... //depot/perl/ext/Sys/Syslog/Syslog.pm#24 edit
Differences ...
==== //depot/perl/ext/Sys/Syslog/Syslog.pm#24 (text) ====
Index: perl/ext/Sys/Syslog/Syslog.pm
--- perl/ext/Sys/Syslog/Syslog.pm#23~23341~ Thu Sep 30 08:41:40 2004
+++ perl/ext/Sys/Syslog/Syslog.pm Tue Dec 14 02:35:57 2004
@@ -1,5 +1,5 @@
package Sys::Syslog;
-require 5.000;
+require 5.006;
require Exporter;
require DynaLoader;
use Carp;
@@ -7,7 +7,7 @@
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(openlog closelog setlogmask syslog);
@EXPORT_OK = qw(setlogsock);
-$VERSION = '0.05';
+$VERSION = '0.06';
# it would be nice to try stream/unix first, since that will be
# most efficient. However streams are dodgy - see _syslog_send_stream
@@ -313,7 +313,7 @@
$whoami .= "[$$]" if $lo_pid;
- $mask =~ s/%m/$!/g;
+ $mask =~ s/(?<!%)%m/$!/g;
$mask .= "\n" unless $mask =~ /\n$/;
$message = sprintf ($mask, @_);
End of Patch.