Algorithmique Numérique Distribuée Public GIT Repository
 author Martin Quinson Sat, 7 Nov 2015 20:57:12 +0000 (21:57 +0100) committer Martin Quinson Sat, 7 Nov 2015 20:57:12 +0000 (21:57 +0100)

index 54f053a..2e0ec34 100755 (executable)
@@ -342,7 +342,7 @@ sub exec_cmd {
}

# substitute remaining variables, if any
}

# substitute remaining variables, if any
-    while ( \$cmd{'cmd'} =~ /\\${(\w+)(?::[=-][^}]*)?}/ ) {
+    while ( \$cmd{'cmd'} =~ /\\$\{(\w+)(?::[=-][^}]*)?\}/ ) {
\$cmd{'cmd'} = var_subst( \$cmd{'cmd'}, \$1, "" );
}
while ( \$cmd{'cmd'} =~ /\\$(\w+)/ ) {
\$cmd{'cmd'} = var_subst( \$cmd{'cmd'}, \$1, "" );
}
while ( \$cmd{'cmd'} =~ /\\$(\w+)/ ) {
@@ -730,11 +730,11 @@ sub build_diff {
sub var_subst {
my ( \$text, \$name, \$value ) = @_;
if (\$value) {
sub var_subst {
my ( \$text, \$name, \$value ) = @_;
if (\$value) {
-        \$text =~ s/\\${\$name(?::[=-][^}]*)?}/\$value/g;
+        \$text =~ s/\\$\{\$name(?::[=-][^}]*)?\}/\$value/g;
\$text =~ s/\\$\$name(\W|\$)/\$value\$1/g;
} else {
\$text =~ s/\\$\$name(\W|\$)/\$value\$1/g;
} else {
-        \$text =~ s/\\${\$name:=([^}]*)}/\$1/g;
-        \$text =~ s/\\${\$name}//g;
+        \$text =~ s/\\$\{\$name:=([^}]*)\}/\$1/g;
+        \$text =~ s/\\$\{\$name\}//g;
\$text =~ s/\\$\$name(\W|\$)/\$1/g;
}
return \$text;
\$text =~ s/\\$\$name(\W|\$)/\$1/g;
}
return \$text;