Use read -r so that we ignore any backslash.
authorRoy Marples <roy@marples.name>
Thu, 11 Aug 2011 12:26:17 +0000 (12:26 +0000)
committerRoy Marples <roy@marples.name>
Thu, 11 Aug 2011 12:26:17 +0000 (12:26 +0000)
libc.in
pdnsd.in
resolvconf.in

diff --git a/libc.in b/libc.in
index 88e46b4940402c23747977ecf6ba3616f5be6678..801f342fecf1efcda5b4b036ae6058c0155adef0 100644 (file)
--- a/libc.in
+++ b/libc.in
@@ -40,14 +40,14 @@ key_get_value()
 
        shift
        if [ $# -eq 0 ]; then
-               while read line; do
+               while read -r line; do
                        case "$line" in
                        "$key"*) echo "${line##$key}";;
                        esac
                done
        else
                for x do
-                       while read line; do
+                       while read -r line; do
                                case "$line" in
                                "$key"*) echo "${line##$key}";;
                                esac
@@ -60,7 +60,7 @@ keys_remove()
 {
        local key x line found
 
-       while read line; do
+       while read -r line; do
                found=false
                for key do
                        case "$line" in
index 8be0f9a0d006a4b7276dae187d97f77b7cc04099..0a0241a7c7b3df92e85fee20a020f8b6d598083e 100644 (file)
--- a/pdnsd.in
+++ b/pdnsd.in
@@ -48,7 +48,7 @@ remove_markers()
                sed "/^$m1/,/^$m2/d" $@
        else
                for x; do
-                       while read line; do
+                       while read -r line; do
                                case "$line" in
                                "$m1"*) in_marker=1;;
                                "$m2"*) in_marker=0;;
index 713c4a100814f8516d7ee1c09ac31a9df60ab543..a7a7d3b3b50b36e2021f4c816e256d1b9bc242d3 100644 (file)
@@ -91,7 +91,7 @@ echo_resolv()
        # Our variable maker works of the fact each resolv.conf per interface
        # is separated by blank lines.
        # So we remove them when echoing them.
-       while read line; do
+       while read -r line; do
                IFS="$OIFS"
                if [ -n "$line" ]; then
                        # We need to set IFS here to preserve any whitespace
@@ -123,7 +123,7 @@ parse_resolv()
        echo "LOCALNAMESERVERS="
        newns=
 
-       while read line; do
+       while read -r line; do
                case "$line" in
                "# resolv.conf from "*)
                        if ${new}; then