From 23ef0c4565f9d268ab1d10b605714371705e3118 Mon Sep 17 00:00:00 2001 From: lum Date: Fri, 7 May 2021 08:29:30 +0000 Subject: [PATCH] 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(-) 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') -- 2.20.1