From eda77235ada3db8b7cc75dd60efbe25ad07207e7 Mon Sep 17 00:00:00 2001 From: Mark Lumsden Date: Fri, 7 May 2021 08:29:31 +0000 Subject: Give an error if quoted string is found as first non-white char after '('. --- usr.bin/mg/interpreter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr.bin/mg') diff --git a/usr.bin/mg/interpreter.c b/usr.bin/mg/interpreter.c index 8c5e5af784d..823a45122f9 100644 --- a/usr.bin/mg/interpreter.c +++ b/usr.bin/mg/interpreter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interpreter.c,v 1.28 2021/05/07 07:42:20 lum Exp $ */ +/* $OpenBSD: interpreter.c,v 1.29 2021/05/07 08:29:30 lum Exp $ */ /* * This file is in the public domain. * @@ -224,8 +224,12 @@ foundparen(char *funstr, int llen, int lnum) } esc = spc = 0; } else if (*p != ' ' && *p != '\t') { - if (begp == NULL) + if (begp == NULL) { begp = p; + if (*begp == '"') + return(dobeep_num("First char of "\ + "expression error line:", lnm)); + } if (*p == '"') { if (inquote == 0 && esc == 0) { if (*prechr != ' ' && *prechr != '\t') -- cgit v1.2.3