From 42033fc5dbac9b88da9fa731c43c3c5703fe66ca Mon Sep 17 00:00:00 2001 From: lum Date: Sat, 8 May 2021 09:27:35 +0000 Subject: [PATCH] stop parsing if a digit is found as first character of an expression. --- usr.bin/mg/interpreter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/mg/interpreter.c b/usr.bin/mg/interpreter.c index 823a45122f9..1996d815788 100644 --- a/usr.bin/mg/interpreter.c +++ b/usr.bin/mg/interpreter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interpreter.c,v 1.29 2021/05/07 08:29:30 lum Exp $ */ +/* $OpenBSD: interpreter.c,v 1.30 2021/05/08 09:27:35 lum Exp $ */ /* * This file is in the public domain. * @@ -54,6 +54,7 @@ */ #include +#include #include #include #include @@ -226,7 +227,7 @@ foundparen(char *funstr, int llen, int lnum) } else if (*p != ' ' && *p != '\t') { if (begp == NULL) { begp = p; - if (*begp == '"') + if (*begp == '"' || isdigit(*begp)) return(dobeep_num("First char of "\ "expression error line:", lnm)); } -- 2.20.1