Output the right number of backslashes in values.
diff --git a/tools/wineconf b/tools/wineconf
index 060a155..daced6b 100755
--- a/tools/wineconf
+++ b/tools/wineconf
@@ -191,12 +191,12 @@
}
$::windir = &ToDos(dirname($winini));
print "[wine]\n";
- print "\"windows\" = \"$::windir\"\n";
+ print "\"windows\" = ", &marshall ($::windir), "\n";
if ($::opt_sysdir) {
- print "\"system\" = \"$::opt_sysdir\"\n";
+ print "\"system\" = ", &marshall ($::opt_sysdir), "\n";
}
else {
- print "\"system\" = \"$::windir\\SYSTEM\"\n";
+ print "\"system\" = ", &marshall ("$::windir\\SYSTEM"), "\n";
}
}
@@ -306,7 +306,7 @@
warn "exist\n";
}
}
- print "\"path\" = \"" . join(";", @::DOSpathlist) . "\"\n";
+ print "\"path\" = ", &marshall (join (";", @::DOSpathlist)), "\n";
}
else {
# Code status: tested 1.4
@@ -326,15 +326,15 @@
$command =~ s%[^/]+$%%;
$::DOSexecdir{&ToDos($command)}++;
}
- print "\"path\" = \"" .
- join(";",
- grep(s%\\$%%,
- sort {$::DOSexecdir{$b} <=> $::DOSexecdir{$a}}
- (keys %::DOSexecdir))) . "\"\n";
+ print "\"path\" = " .
+ &marshall (join(";",
+ grep(s%\\$%%,
+ sort {$::DOSexecdir{$b} <=> $::DOSexecdir{$a}}
+ (keys %::DOSexecdir)))) . "\n";
}
if ($::DOSenv{"temp"} && -d &ToUnix($::DOSenv{"temp"})) {
- print "\"temp\" = \"" . $::DOSenv{"temp"} . "\"\n";
+ print "\"temp\" = ", &marshall ($::DOSenv{"temp"}), "\n";
}
else {
my $TheTemp;
@@ -351,11 +351,11 @@
$TheTemp = '/tmp' if (!$TheTemp && -d '/tmp');
if ($TheTemp) {
warn "Using $TheTemp\n";
- print "\"temp\" = \"$TheTemp\"\n";
+ print "\"temp\" = ", &marshall ($TheTemp), "\n";
}
else {
warn "Using C:\\\n";
- print "\"temp\" = \"C:\\\"\n";
+ print "\"temp\" = ", &marshall ("C:\\"), "\n";
}
}
print "\n";
@@ -427,6 +427,13 @@
}
}
+sub marshall {
+ my ($s) = @_;
+ $s =~ s/\\/\\\\/g;
+ return "\"$s\"";
+}
+
+
sub StandardStuff {
if (!$::opt_inifile) {
&InsertDefaultFile("./wine.ini", "wineconf");