Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Config: escape \\ (windows paths) #78
Browse files Browse the repository at this point in the history
all non-valid escape chars need to be escaped.
"c:\perl" => "c:\\perl"
  • Loading branch information
Reini Urban committed Dec 7, 2015
1 parent ef38993 commit 61165ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/Config/Config_xs.PL
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ while (<$in>) {
my $k = $1;
my $v = $h{$k};
my $qv = $v;
$qv =~ s/(\\[nrftacx ])/\\$1/g; # \n => \\n
$qv =~ s/(\\[^nrftacx"' ])/\\$1/g; # windows paths: \\ => \\\\
$qv =~ s/(\\[nrftacx ])/\\$1/g; # \n => \\n, allowed escape chars
my $l = $v =~ m/["'\\]/ ?
# don't calculate C-style length [cperl #61], let C do it for us
# and don't count the ending \0
Expand Down

0 comments on commit 61165ca

Please sign in to comment.