Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/m4 use strchr



details:   https://anonhg.NetBSD.org/src/rev/b780f26a49ec
branches:  trunk
changeset: 375990:b780f26a49ec
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 24 22:14:31 2023 +0000

description:
use strchr

diffstat:

 usr.bin/m4/gnum4.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1f96b22843b3 -r b780f26a49ec usr.bin/m4/gnum4.c
--- a/usr.bin/m4/gnum4.c        Wed May 24 21:58:19 2023 +0000
+++ b/usr.bin/m4/gnum4.c        Wed May 24 22:14:31 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gnum4.c,v 1.12 2023/05/24 21:58:19 lukem Exp $ */
+/* $NetBSD: gnum4.c,v 1.13 2023/05/24 22:14:31 christos 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.12 2023/05/24 21:58:19 lukem Exp $");
+__RCSID("$NetBSD: gnum4.c,v 1.13 2023/05/24 22:14:31 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -438,7 +438,7 @@ twiddle(const char *p)
                        p+=2;
                        continue;
                }
-               if (*p == '(' || *p == ')' || *p == '|' || *p == '{' || *p == '}')
+               if (strchr("()|{}", *p) != NULL)
                        addchar('\\');
 
                addchar(*p);



Home | Main Index | Thread Index | Old Index