FreeBSD Bugzilla – Attachment 203269 Details for
Bug 232201
sh(1): Using unset variables in here-doc with set -u does not cause the script to exit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
experimental patch to stop ignoring here-document expansion errors
sh-heredoc-expansion-error.patch (text/plain), 1.75 KB, created by
Jilles Tjoelker
on 2019-03-30 21:46:59 UTC
(
hide
)
Description:
experimental patch to stop ignoring here-document expansion errors
Filename:
MIME Type:
Creator:
Jilles Tjoelker
Created:
2019-03-30 21:46:59 UTC
Size:
1.75 KB
patch
obsolete
>commit d6b9e93c13e7abadec5da7b6c7dcf7aa66e7655f >Author: Jilles Tjoelker <jilles@stack.nl> >Date: Fri Mar 29 17:50:47 2019 +0100 > > sh: Experimentally expand here-document in same shell environment > > PR: 232201 > >diff --git a/bin/sh/eval.c b/bin/sh/eval.c >index b95689bce006..435d46eb5f8d 100644 >--- a/bin/sh/eval.c >+++ b/bin/sh/eval.c >@@ -91,7 +91,6 @@ static void evalfor(union node *, int); > static union node *evalcase(union node *); > static void evalsubshell(union node *, int); > static void evalredir(union node *, int); >-static void exphere(union node *, struct arglist *); > static void expredir(union node *); > static void evalpipe(union node *); > static int is_valid_fast_cmdsubst(union node *n); >@@ -486,40 +485,6 @@ evalredir(union node *n, int flags) > } > > >-static void >-exphere(union node *redir, struct arglist *fn) >-{ >- struct jmploc jmploc; >- struct jmploc *savehandler; >- struct localvar *savelocalvars; >- int need_longjmp = 0; >- unsigned char saveoptreset; >- >- redir->nhere.expdoc = ""; >- savelocalvars = localvars; >- localvars = NULL; >- saveoptreset = shellparam.reset; >- forcelocal++; >- savehandler = handler; >- if (setjmp(jmploc.loc)) >- need_longjmp = exception != EXERROR; >- else { >- handler = &jmploc; >- expandarg(redir->nhere.doc, fn, 0); >- redir->nhere.expdoc = fn->args[0]; >- INTOFF; >- } >- handler = savehandler; >- forcelocal--; >- poplocalvars(); >- localvars = savelocalvars; >- shellparam.reset = saveoptreset; >- if (need_longjmp) >- longjmp(handler->loc, 1); >- INTON; >-} >- >- > /* > * Compute the names of the files in a redirection list. > */ >@@ -549,7 +514,8 @@ expredir(union node *n) > } > break; > case NXHERE: >- exphere(redir, &fn); >+ expandarg(redir->nhere.doc, &fn, 0); >+ redir->nhere.expdoc = fn.args[0]; > break; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232201
: 203269
Working