|
|
712866 |
From 40a5d2c0291d4ec7d8c501fce8fb9d412235fdbb Mon Sep 17 00:00:00 2001
|
|
|
712866 |
From: Harald Hoyer <harald@redhat.com>
|
|
|
712866 |
Date: Tue, 20 May 2014 11:27:42 +0200
|
|
|
712866 |
Subject: [PATCH] dracut-functions.sh:print_vars() fix for values with spaces
|
|
|
712866 |
MIME-Version: 1.0
|
|
|
712866 |
Content-Type: text/plain; charset=UTF-8
|
|
|
712866 |
Content-Transfer-Encoding: 8bit
|
|
|
712866 |
|
|
|
712866 |
for a variable with spaces, e.g.:
|
|
|
712866 |
EXT_KEYMAPS='backspace keypad euro2'
|
|
|
712866 |
|
|
|
712866 |
The following would occur:
|
|
|
712866 |
print_vars: eval printf -v _value %s '$EXT_KEYMAPS'
|
|
|
712866 |
print_vars: printf -v _value %s backspace keypad euro2
|
|
|
712866 |
print_vars: [[ -n backspacekeypadeuro2 ]]
|
|
|
712866 |
print_vars: printf '%s=\"%s\"\n' EXT_KEYMAPS backspacekeypadeuro2
|
|
|
712866 |
|
|
|
712866 |
Thanks to Sebastian Köln for the fix!
|
|
|
712866 |
|
|
|
712866 |
(cherry picked from commit 7a94a4326f0641396125acb2b444b562224457a1)
|
|
|
712866 |
---
|
|
|
712866 |
dracut-functions.sh | 2 +-
|
|
|
712866 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
712866 |
|
|
|
712866 |
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
|
|
5c6c2a |
index cb43f7ad..915f70fa 100755
|
|
|
712866 |
--- a/dracut-functions.sh
|
|
|
712866 |
+++ b/dracut-functions.sh
|
|
|
712866 |
@@ -176,7 +176,7 @@ print_vars() {
|
|
|
712866 |
|
|
|
712866 |
for _var in "$@"
|
|
|
712866 |
do
|
|
|
712866 |
- eval printf -v _value "%s" "\$$_var"
|
|
|
712866 |
+ eval printf -v _value "%s" \""\$$_var"\"
|
|
|
712866 |
[[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value"
|
|
|
712866 |
done
|
|
|
712866 |
}
|