Module Name:    src
Committed By:   skrll
Date:           Tue Feb 23 08:23:24 UTC 2010

Modified Files:
        src/usr.bin/ldd: ldd.c

Log Message:
Mark each object as printed as visited and then print.

Fixes PR/48211.

As a side effect the libraries are printed in, imo, a better order.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/ldd/ldd.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/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.12 src/usr.bin/ldd/ldd.c:1.13
--- src/usr.bin/ldd/ldd.c:1.12	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/ldd.c	Tue Feb 23 08:23:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.12 2009/12/13 08:50:56 mrg Exp $	*/
+/*	$NetBSD: ldd.c,v 1.13 2010/02/23 08:23:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.12 2009/12/13 08:50:56 mrg Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.13 2010/02/23 08:23:24 skrll Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -290,10 +290,10 @@
 		const char *libname = obj->strtab + needed->name;
 
 		if (needed->obj != NULL) {
-			print_needed(needed->obj, fmt1, fmt2);
 			if (!needed->obj->printed) {
 				fmtprint(libname, needed->obj, fmt1, fmt2);
 				needed->obj->printed = 1;
+				print_needed(needed->obj, fmt1, fmt2);
 			}
 		} else {
 			fmtprint(libname, needed->obj, fmt1, fmt2);

Reply via email to