From: lum Date: Sat, 8 May 2021 09:27:35 +0000 (+0000) Subject: stop parsing if a digit is found as first character of an expression. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=42033fc5dbac9b88da9fa731c43c3c5703fe66ca;p=openbsd stop parsing if a digit is found as first character of an expression. --- 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)); }