diff --git a/usr.bin/config/gram.y b/usr.bin/config/gram.y index f3d3688de6dc..9f4e68f97fe9 100644 --- a/usr.bin/config/gram.y +++ b/usr.bin/config/gram.y @@ -1,5 +1,5 @@ %{ -/* $NetBSD: gram.y,v 1.42 2014/10/10 06:13:30 uebayasi Exp $ */ +/* $NetBSD: gram.y,v 1.43 2014/10/10 11:09:50 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -587,7 +587,7 @@ depends: /* one depend item (which is an attribute) */ depend: - WORD { $$ = getattr($1); } + WORD { $$ = refattr($1); } ; /* list of option depends, may be empty */ diff --git a/usr.bin/config/sem.c b/usr.bin/config/sem.c index fefae5c90664..b2e98e9a2dae 100644 --- a/usr.bin/config/sem.c +++ b/usr.bin/config/sem.c @@ -1,4 +1,4 @@ -/* $NetBSD: sem.c,v 1.54 2014/10/10 10:16:19 uebayasi Exp $ */ +/* $NetBSD: sem.c,v 1.55 2014/10/10 11:09:50 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -672,12 +672,14 @@ getattr(const char *name) /* * Implicit attribute definition. */ -void +struct attr * refattr(const char *name) { + struct attr *a; - if ((ht_lookup(attrtab, name)) == NULL) - (void)mkattr(name); + if ((a = ht_lookup(attrtab, name)) == NULL) + a = mkattr(name); + return a; } int diff --git a/usr.bin/config/sem.h b/usr.bin/config/sem.h index eb49d44d9b42..ecb01be88f3c 100644 --- a/usr.bin/config/sem.h +++ b/usr.bin/config/sem.h @@ -1,4 +1,4 @@ -/* $NetBSD: sem.h,v 1.13 2014/10/10 07:48:50 uebayasi Exp $ */ +/* $NetBSD: sem.h,v 1.14 2014/10/10 11:09:50 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -57,7 +57,7 @@ struct devbase *getdevbase(const char *); struct deva *getdevattach(const char *); struct attr *mkattr(const char *); struct attr *getattr(const char *); -void refattr(const char *); +struct attr *refattr(const char *); int getrefattr(const char *, struct attr **); void expandattr(struct attr *, void (*)(struct attr *)); void selectattr(struct attr *);