From: lum Date: Fri, 7 May 2021 08:29:30 +0000 (+0000) Subject: Give an error if quoted string is found as first non-white char after X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=23ef0c4565f9d268ab1d10b605714371705e3118;p=openbsd Give an error if quoted string is found as first non-white char after '('. --- 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')