Don't embed variables in formatting string.
authorRoy Marples <roy@marples.name>
Wed, 17 Jul 2019 16:11:38 +0000 (17:11 +0100)
committerRoy Marples <roy@marples.name>
Wed, 17 Jul 2019 16:11:38 +0000 (17:11 +0100)
resolvconf.in

index 50903b6723f545131e870557d069781950e2cc9b..e9a7787df61fd583b781ba7a6bd04b1f8acd6404 100644 (file)
@@ -128,13 +128,13 @@ usage()
 # Also strip any comments denoted by #.
 resolv_strip()
 {
-       d=
-       for n; do
-               case "$n" in
+       space=
+       for word; do
+               case "$word" in
                \#*) break;;
                esac
-               printf "$d%s" "${n%.}"
-               d=" "
+               printf "%s%s" "$space${word%.}"
+               space=" "
        done
        printf "\n"
 }