Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install/info Some package names are extra long, ...



details:   https://anonhg.NetBSD.org/src/rev/92326d82dd2c
branches:  trunk
changeset: 565191:92326d82dd2c
user:      reed <reed%NetBSD.org@localhost>
date:      Thu Apr 01 02:37:24 2004 +0000

description:
Some package names are extra long, like xscreensaver-gnome-4.13
and gdk-pixbuf-gnome-0.22.0nb1, so make sure that lines don't wrap.
Instead of having maxline based on MAXNAMESIZE, have it be based
on the length of the package name if longer than MAXNAMESIZE.
(This was discussed on tech-pkg list in November, 2003.)

diffstat:

 usr.sbin/pkg_install/info/show.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r dd03e10e2caf -r 92326d82dd2c usr.sbin/pkg_install/info/show.c
--- a/usr.sbin/pkg_install/info/show.c  Thu Apr 01 01:51:04 2004 +0000
+++ b/usr.sbin/pkg_install/info/show.c  Thu Apr 01 02:37:24 2004 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: show.c,v 1.27 2003/09/02 07:34:59 jlam Exp $   */
+/*     $NetBSD: show.c,v 1.28 2004/04/01 02:37:24 reed Exp $   */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp";
 #else
-__RCSID("$NetBSD: show.c,v 1.27 2003/09/02 07:34:59 jlam Exp $");
+__RCSID("$NetBSD: show.c,v 1.28 2004/04/01 02:37:24 reed Exp $");
 #endif
 #endif
 
@@ -133,7 +133,7 @@
 
        if (!Quiet) {
                printf("%s%s", InfoPrefix, title);
-               maxline -= MAXNAMESIZE;
+               maxline -= MAX(MAXNAMESIZE, strlen(title));
        }
        if ((fp = fopen(fname, "r")) == (FILE *) NULL) {
                warnx("show_file: can't open '%s' for reading", fname);



Home | Main Index | Thread Index | Old Index