Fix handling of leading spaces in scripts.

* grub-core/normal/cmdline.c (grub_cmdline_get): Don't strip leading
	spaces.
	* grub-core/normal/main.c (grub_file_getline): Remove all preprocessing
	other than skipping \r. All users updated.
	* tests/grub_script_echo1.in: Add space-related tests.
	* util/grub-menulst2cfg.c (main): Remove useless space skipping.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-11 14:43:18 +01:00
parent 1a1ac4f6cb
commit 9fdb2d7b11
10 changed files with 104 additions and 66 deletions

View file

@ -20,6 +20,9 @@
echo one two three
echo "one two three"
echo 'one two three'
echo "one two three"
echo "one two three"
echo "one two three"
# empty arguments
echo a "" b
@ -87,6 +90,13 @@ echo one'two
echo one'two
\'three
echo "one\
"
echo "one\
\""
echo "one\
two"
# echo "one\
# two"
# echo 'one\
@ -99,5 +109,40 @@ echo one'two
#
# two"
echo "one
"
echo "one
\""
echo "one
two"
echo one"two
"three
echo one"two
\""three
echo one"two
\"three\"
four"
echo 'one
'
echo 'one
\'
echo 'one
two'
echo one'two
'
echo one'two
\'
echo one'two
\'three
echo "one\
"
echo "one\
\""
echo "one\
two"
if test x$grubshell = xyes; then insmod regexp; fi
echo /boot/grub/i386-pc/normal.mod