From 0b416121a6fbb39e02cc4789725eada0a136084c Mon Sep 17 00:00:00 2001 From: aymeric Date: Tue, 23 Nov 2004 14:35:45 +0000 Subject: [PATCH] Move a line of code which was "obviously" misplaced. This fixes a core dump when auto-completing filenames and at least one of the file names is larger than the screen width. Bug report and fix by Peter Bex in PR#28382 --- usr.bin/vi/vi/v_txt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c index f11246f9797a..b34154d8a00e 100644 --- a/usr.bin/vi/vi/v_txt.c +++ b/usr.bin/vi/vi/v_txt.c @@ -1,4 +1,4 @@ -/* $NetBSD: v_txt.c,v 1.11 2003/06/06 08:06:47 aymeric Exp $ */ +/* $NetBSD: v_txt.c,v 1.12 2004/11/23 14:35:45 aymeric Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -16,7 +16,7 @@ #if 0 static const char sccsid[] = "@(#)v_txt.c 10.87 (Berkeley) 10/13/96"; #else -__RCSID("$NetBSD: v_txt.c,v 1.11 2003/06/06 08:06:47 aymeric Exp $"); +__RCSID("$NetBSD: v_txt.c,v 1.12 2004/11/23 14:35:45 aymeric Exp $"); #endif #endif /* not lint */ @@ -2234,8 +2234,8 @@ txt_fc_col(sp, argc, argv) /* If the largest file name is too large, just print them. */ if (colwidth > sp->cols) { - p = msg_print(sp, av[0]->bp + prefix, &nf); for (ac = argc, av = argv; ac > 0; --ac, ++av) { + p = msg_print(sp, av[0]->bp + prefix, &nf); (void)ex_printf(sp, "%s\n", p); if (F_ISSET(gp, G_INTERRUPTED)) break;