Remove (useless) s/*/__star__/ replacement in getconf.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 17 Mar 2010 21:44:09 +0000 (22:44 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Fri, 19 Mar 2010 20:40:15 +0000 (21:40 +0100)
It seems this was meant to replace * with __star__ to prevent globbing,
but getconf already handles its values properly so globbing does not
occur. Currently, this replacement was broken due to the double
backslash, causing it to replace a backslash and all following
characters with __star__, instead of a literal *. This is also confirmed
by the fact that some handlers' documentation says to use __star__
instead of * directly in the configuration (and they have special
handling to turn __star__ back into * or something else as appropriate).

Eventually, we should just support using * directly and fixing up all
handling of the variable to not cause any globbing or other expansion
(also because fixing * isn't complete, there is also ? and sometimes ~
and other special characters might be expanded as well).

lib/tools.in

index a6dcf269ef2dfb6592b7247a779f6176ccaf8463..2715a00643f4a2477c93378705191f8a28c47619 100644 (file)
@@ -50,9 +50,6 @@ function printconf() {
 function getconf() {
    ret=`printconf "$1" "$2"`
 
 function getconf() {
    ret=`printconf "$1" "$2"`
 
-   # replace * with %, so that it is not globbed.
-   ret="${ret//\\*/__star__}"
-
    # We use escape the $ in $ret to delay expansion of $ret, so when $1
    # is foo, eval sees foo=$ret and properly does the assignment
    # (without the backslash, the right part of the assignment would be
    # We use escape the $ in $ret to delay expansion of $ret, so when $1
    # is foo, eval sees foo=$ret and properly does the assignment
    # (without the backslash, the right part of the assignment would be