[gnu.bash.bug] Whitespace not skipped in continued case pattern

perf@EFD.LTH.SE (07/03/89)

Facts: Bash 1.01 compiled with gcc 1.35 on a Sun 3/280 running SunOS 4.0.1
	    
A newline in a case pattern seems to turn off skipping of whitespace
in the continuing line. Some examples:

---------------------------------
This doesn't work at all. 

	bash$ cat test1.sh
	case $SHELL in
	*csh | *ksh |\
	   *bash )
		echo xxxxxxxx ;;
	esac
	bash$ sh test1.sh
	xxxxxxxx
	bash$ bash -norc test1.sh
	syntax error near `*bash'
	in line 3: `   *bash )'
	syntax error near `;'
	in line 4: `    echo xxxxxxxx ;;'
	syntax error near `esac'
	in line 5: `esac'

---------------------------------
But if we break the line before the '|' it's ok.

	bash$ cat test2.sh
	case $SHELL in
	*csh | *ksh\
	   | *bash )
		echo xxxxxxxx ;;
	esac
	bash$ sh test2.sh
	xxxxxxxx
	bash$ bash -norc test2.sh
	xxxxxxxx

---------------------------------
Then put a blank before '\' and we're lost again...

	bash$ cat test3.sh
	case $SHELL in
	*csh | *ksh \
	   | *bash )
		echo xxxxxxxx ;;
	esac
	bash$ sh test3.sh
	xxxxxxxx
	bash$ bash -norc test3.sh
	in line 3: `   | *bash )'
	syntax error near `;'
	in line 4: `    echo xxxxxxxx ;;'
	syntax error near `esac'
	in line 5: `esac'

---------------------------------

Note that sh has no problems with any of the examples.

--
Per Foreby
System manager at EFD, Lund Institute of Technology (Lund University)
Snail: E-huset, Tekniska Hogskolan i Lund, Box 118, S-221 00 LUND, Sweden. 
Email: perf@efd.lth.se		Phone: int + 46 46-10 75 98