=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctfconv/parse.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/ctfconv/parse.c 2017/08/11 14:58:56 1.2 +++ src/usr.bin/ctfconv/parse.c 2017/08/11 16:28:30 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.2 2017/08/11 14:58:56 jasper Exp $ */ +/* $OpenBSD: parse.c,v 1.3 2017/08/11 16:28:30 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -233,7 +233,7 @@ copit->it_nelems = it->it_nelems; TAILQ_FOREACH(im, &it->it_members, im_next) { - copim = im_new(im->im_name, im->im_ref, im->im_off); + copim = im_new(im_name(im), im->im_ref, im->im_off); copim->im_refp = im->im_refp; TAILQ_INSERT_TAIL(&copit->it_members, copim, im_next); } @@ -367,7 +367,7 @@ im->im_off = off; im->im_refp = NULL; if (name == NULL) { - im->im_flags = ITM_ANON; + im->im_flags = IMF_ANON; } else { size_t n; @@ -381,6 +381,15 @@ return im; } +const char * +im_name(struct imember *im) +{ + if (!(im->im_flags & IMF_ANON)) + return im->im_name; + + return NULL; +} + void cu_stat(void) { @@ -436,10 +445,9 @@ if (toresolve) printf(": %d members", toresolve); TAILQ_FOREACH(im, &it->it_members, im_next) { - if (im->im_refp == NULL) { - printf("\n%zu: %s", im->im_ref, - im->im_name); - } + if (im->im_refp != NULL) + continue; + printf("\n%zu: %s", im->im_ref, im_name(im)); } printf("\n"); }