Module Name:    src
Committed By:   sjg
Date:           Fri Jan 14 18:43:23 UTC 2022

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
meta_cmd_cmp: use bool for once

Just use Buf_Init() some mallocs will be inevitable.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/usr.bin/make/meta.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/make/meta.c
diff -u src/usr.bin/make/meta.c:1.187 src/usr.bin/make/meta.c:1.188
--- src/usr.bin/make/meta.c:1.187	Thu Jan 13 04:51:50 2022
+++ src/usr.bin/make/meta.c	Fri Jan 14 18:43:23 2022
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.187 2022/01/13 04:51:50 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.188 2022/01/14 18:43:23 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1100,7 +1100,7 @@ meta_filter_cmd(Buffer *buf, GNode *gn, 
 static int
 meta_cmd_cmp(GNode *gn, char *a, char *b)
 {
-    static int once = 0;
+    static bool once = false;
     static Buffer buf;
     int rc;
 
@@ -1108,8 +1108,8 @@ meta_cmd_cmp(GNode *gn, char *a, char *b
     if (rc == 0 || !metaCmpFilter)
 	return rc;
     if (!once) {
-	once++;
-	Buf_InitSize(&buf, BUFSIZ);
+	once = true;
+	Buf_Init(&buf);
     }
     a = meta_filter_cmd(&buf, gn, a);
     b = meta_filter_cmd(&buf, gn, b);

Reply via email to