Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Assert archive member syntax. Cite who guarant...
details: https://anonhg.NetBSD.org/src/rev/a43c82dca01c
branches: trunk
changeset: 352981:a43c82dca01c
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Apr 16 20:38:18 2017 +0000
description:
Assert archive member syntax. Cite who guarantees it.
diffstat:
usr.bin/make/suff.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (48 lines):
diff -r 3f9c0bfbb4a3 -r a43c82dca01c usr.bin/make/suff.c
--- a/usr.bin/make/suff.c Sun Apr 16 20:20:24 2017 +0000
+++ b/usr.bin/make/suff.c Sun Apr 16 20:38:18 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $ */
+/* $NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $");
#endif
#endif /* not lint */
#endif
@@ -135,6 +135,7 @@
* order to find the node.
*/
+#include <assert.h>
#include <stdio.h>
#include "make.h"
#include "hash.h"
@@ -1906,6 +1907,13 @@
eoarch = strchr(gn->name, '(');
eoname = strchr(eoarch, ')');
+ /*
+ * Caller guarantees the format `libname(member)', via
+ * Arch_ParseArchive.
+ */
+ assert(eoarch != NULL);
+ assert(eoname != NULL);
+
*eoname = '\0'; /* Nuke parentheses during suffix search */
*eoarch = '\0'; /* So a suffix can be found */
Home |
Main Index |
Thread Index |
Old Index