]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Allow unquoted newlines in word in ${param+word} etc.
authorjilles <jilles@FreeBSD.org>
Sun, 20 May 2018 17:25:52 +0000 (17:25 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 20 May 2018 17:25:52 +0000 (17:25 +0000)
commitee6bb75b10f451e0133df091707594c07b872021
treec87101a3345b3713e486dbd6be8f371c0782d6b2
parentfa23ca22d37d97c7a443e73df141eee113a51251
sh: Allow unquoted newlines in word in ${param+word} etc.

POSIX requires accepting unquoted newlines in word in parameter expansions
like ${param+word}, ${param#word}, although the Bourne shell did not support
it, it is not commonly used and might make it harder to find a missing
closing brace.

It was also strange that something like

foo="${bar#
}"

was rejected.

Reported by: Martijn Dekker via Robert Elz
bin/sh/parser.c
bin/sh/tests/expansion/Makefile
bin/sh/tests/expansion/plus-minus9.0 [new file with mode: 0644]
bin/sh/tests/expansion/trim10.0 [new file with mode: 0644]
bin/sh/tests/expansion/trim11.0 [new file with mode: 0644]