summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-08-11 08:18:39 +0000
committerjoerg <joerg@FreeBSD.org>1995-08-11 08:18:39 +0000
commit4f47bf958d458de84895d2bc9c4ce51bbe408045 (patch)
treed4817f59b3aebee9d460cd1326732fd7cd9dcef2 /bin/sh
parent3a38ab962539cccfc54845f871e47ef4951d07c0 (diff)
downloadFreeBSD-src-4f47bf958d458de84895d2bc9c4ce51bbe408045.zip
FreeBSD-src-4f47bf958d458de84895d2bc9c4ce51bbe408045.tar.gz
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>
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 0952ea3..1353b5b 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -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 != '$'
OpenPOWER on IntegriCloud