summaryrefslogtreecommitdiffstats
path: root/MDK
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-04 05:54:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-04 05:54:56 +0000
commitf7571319b3d693059705b5d20682bea44cb7d195 (patch)
tree12b62f5fc5d49a63cc543f011fd214673a9bce0f /MDK
parent658c477f1ea4b2f6e6b2370561dbde383a33bdb7 (diff)
downloadperl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.gz
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.bz2
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.xz
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.zip
setVarsInSh() now tries to use quoting only when really needed,
otherwise it breaks program parsing the generated file (eg: /usr/sbin/autologin)
Diffstat (limited to 'MDK')
-rw-r--r--MDK/Common.pm.pl2
-rw-r--r--MDK/Common/System.pm14
2 files changed, 7 insertions, 9 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl
index ba7a989..62dcb51 100644
--- a/MDK/Common.pm.pl
+++ b/MDK/Common.pm.pl
@@ -74,7 +74,7 @@ use vars qw(@ISA @EXPORT $VERSION); #);
# perl_checker: RE-EXPORT-ALL
@EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-$VERSION = "1.1.16";
+$VERSION = "1.1.17";
1;
EOF
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm
index 3b21a9d..427a9e5 100644
--- a/MDK/Common/System.pm
+++ b/MDK/Common/System.pm
@@ -327,14 +327,12 @@ sub setVarsInShMode {
MDK::Common::File::output($file,
map {
my $val = $l->{$_};
- if ($val =~ /\W/) {
- if ($val =~ /["\$]/) {
- $val =~ s/(')/\\$1/;
- $val = qq('$val');
- } else {
- $val =~ s/(")/\\$1/;
- $val = qq("$val");
- }
+ if ($val =~ /["`\$]/) {
+ $val =~ s/(')/\\$1/g;
+ $val = qq('$val');
+ } elsif ($val =~ /['\s\\]/) {
+ $val =~ s/(["\\])/\\$1/g;
+ $val = qq("$val");
}
"$_=$val\n";
} grep { $l->{$_} } @fields