sh(1) incorrectly ignored an EOF condition when looking for the
closing backquote in a `foo` substitution. Discovered by: Martin Welk <mw@theatre.pandora.sax.de>
This commit is contained in:
parent
67d7e54eb1
commit
72348d41ba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10025
@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: parser.c,v 1.5 1995/01/11 07:07:00 paul Exp $
|
||||
* $Id: parser.c,v 1.6 1995/05/30 00:07:22 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -1179,6 +1179,10 @@ parsebackq: {
|
||||
|
||||
STARTSTACKSTR(out);
|
||||
while ((c = pgetc ()) != '`') {
|
||||
if (c == PEOF) {
|
||||
startlinno = plinno;
|
||||
synerror("EOF in backquote substitution");
|
||||
}
|
||||
if (c == '\\') {
|
||||
c = pgetc ();
|
||||
if ( c != '\\' && c != '`' && c != '$'
|
||||
|
Loading…
Reference in New Issue
Block a user