Module Name: src
Committed By: martin
Date: Sun May 28 10:03:54 UTC 2023
Modified Files:
src/usr.bin/m4 [netbsd-10]: gnum4.c
Log Message:
Pull up following revision(s) (requested by lukem in ticket #180):
usr.bin/m4/gnum4.c: revision 1.12
m4 -g: { and } aren't supported in patsubst() or regexp()
When running in -g (GNU m4) emulation, patsubst() and regexp()
use the GNU m4 emacs-like regexes as implemented by gnulib,
which don't support {..} intervals.
When converting a GNU m4 regex to a POSIX ERE, escape raw { and }.
Autoconf relies on the GNU m4 regex behaviour.
See:
-
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Redefined-M4-Macros.html
-
https://www.gnu.org/software/gnulib/manual/html_node/emacs-regular-expression-syntax.html
This fixes the tools/compat/configure regen.
PR toolchain/57431
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 src/usr.bin/m4/gnum4.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/m4/gnum4.c
diff -u src/usr.bin/m4/gnum4.c:1.11 src/usr.bin/m4/gnum4.c:1.11.2.1
--- src/usr.bin/m4/gnum4.c:1.11 Tue Dec 7 20:24:07 2021
+++ src/usr.bin/m4/gnum4.c Sun May 28 10:03:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gnum4.c,v 1.11 2021/12/07 20:24:07 rillig Exp $ */
+/* $NetBSD: gnum4.c,v 1.11.2.1 2023/05/28 10:03:54 martin Exp $ */
/* $OpenBSD: gnum4.c,v 1.39 2008/08/21 21:01:04 espie Exp $ */
/*
@@ -33,7 +33,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gnum4.c,v 1.11 2021/12/07 20:24:07 rillig Exp $");
+__RCSID("$NetBSD: gnum4.c,v 1.11.2.1 2023/05/28 10:03:54 martin Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -438,7 +438,7 @@ twiddle(const char *p)
p+=2;
continue;
}
- if (*p == '(' || *p == ')' || *p == '|')
+ if (*p == '(' || *p == ')' || *p == '|' || *p == '{' || *p == '}')
addchar('\\');
addchar(*p);