git: d4f5d3a4eade - stable/14 - m4: Allow empty base argument in eval()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 30 May 2025 16:07:22 UTC
The branch stable/14 has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=d4f5d3a4eade118694a537564e35c64fdd779f9a
commit d4f5d3a4eade118694a537564e35c64fdd779f9a
Author: Eric Blake <eblake@redhat.com>
AuthorDate: 2025-05-23 14:37:20 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-05-30 12:45:56 +0000
m4: Allow empty base argument in eval()
POSIX specifies "The second argument, if specified, shall set the radix
for the result; if the argument is blank or unspecified, the default
is 10." Previously we reported an invalid
PR: 287015
Reviewed by: emaste
(cherry picked from commit ac196a5845757a4d92cdfc4927170576dce5de9d)
---
usr.bin/m4/eval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 82218eb9ba1c..3170d52bfe2a 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -181,7 +181,7 @@ expand_builtin(const char *argv[], int argc, int td)
int maxdigits = 0;
const char *errstr;
- if (argc > 3) {
+ if (argc > 3 && *argv[3] != '\0') {
base = strtonum(argv[3], 2, 36, &errstr);
if (errstr) {
m4errx(1, "expr: base is %s: %s.",