summaryrefslogtreecommitdiffstats
path: root/MDK/Common/System.pm
diff options
context:
space:
mode:
Diffstat (limited to 'MDK/Common/System.pm')
-rw-r--r--MDK/Common/System.pm14
1 files changed, 6 insertions, 8 deletions
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