Fix ini functions to handle spaces in section names
This allows section names to look like:
[ default ]
OpenSSL is the primary offender for this usage.
Change-Id: If5c711107e73cebab9d4a26ca02a7ce572224377
diff --git a/tests/functions.sh b/tests/functions.sh
index 3a0f319..d2cc5c4 100755
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -54,6 +54,9 @@
[bbb]
handlers=ee,ff
+
+[ ccc ]
+spaces = yes
EOF
# Test with spaces
@@ -74,6 +77,14 @@
echo "iniget failed: $VAL"
fi
+# Test with spaces in section header
+
+VAL=$(iniget test.ini ccc spaces)
+if [[ "$VAL" == "yes" ]]; then
+ echo "OK: $VAL"
+else
+ echo "iniget failed: $VAL"
+fi
# Test without spaces, end of file
@@ -112,7 +123,6 @@
echo "iniget failed: $VAL"
fi
-
# Test option not exist
VAL=$(iniget test.ini aaa debug)