Module Name: src Committed By: ryo Date: Sun Apr 2 18:15:24 UTC 2023
Modified Files: src/sbin/sysctl: sysctl.c Log Message: commonize case block To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sbin/sysctl/sysctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/sysctl/sysctl.c diff -u src/sbin/sysctl/sysctl.c:1.164 src/sbin/sysctl/sysctl.c:1.165 --- src/sbin/sysctl/sysctl.c:1.164 Sun Apr 2 18:11:26 2023 +++ src/sbin/sysctl/sysctl.c Sun Apr 2 18:15:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.c,v 1.164 2023/04/02 18:11:26 ryo Exp $ */ +/* $NetBSD: sysctl.c,v 1.165 2023/04/02 18:15:24 ryo Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ #if 0 static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: sysctl.c,v 1.164 2023/04/02 18:11:26 ryo Exp $"); +__RCSID("$NetBSD: sysctl.c,v 1.165 2023/04/02 18:15:24 ryo Exp $"); #endif #endif /* not lint */ @@ -940,13 +940,6 @@ parse(char *l, regex_t *re, size_t *last } switch (type) { - case CTLTYPE_NODE: - /* - * XXX old behavior is to print. should we error instead? - */ - print_tree(&name[0], namelen, node, CTLTYPE_NODE, 0, re, - lastcompiled); - break; case CTLTYPE_INT: case CTLTYPE_BOOL: case CTLTYPE_QUAD: @@ -955,6 +948,7 @@ parse(char *l, regex_t *re, size_t *last case CTLTYPE_STRING: write_string(&name[0], namelen, node, value, optional); break; + case CTLTYPE_NODE: case CTLTYPE_STRUCT: /* * XXX old behavior is to print. should we error instead?