From 0d78fff1523daf2fe7e9b07d252fa14ee7969ad5 Mon Sep 17 00:00:00 2001 From: provos Date: Fri, 27 Sep 2002 13:23:55 +0000 Subject: [PATCH] complete file names including a ~ correctly. --- bin/ksh/emacs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c index 94d960ae4708..2d09ceb82aa0 100644 --- a/bin/ksh/emacs.c +++ b/bin/ksh/emacs.c @@ -1,4 +1,4 @@ -/* $NetBSD: emacs.c,v 1.13 2002/09/25 02:55:03 provos Exp $ */ +/* $NetBSD: emacs.c,v 1.14 2002/09/27 13:23:55 provos Exp $ */ /* * Emacs-like command line editing and history @@ -1798,15 +1798,15 @@ do_complete(flags, type) olen = end - start; nlen = x_longest_prefix(nwords, words); - /* complete single match, or multi-match without globbing chars */ - if ((nlen > olen) && - ((nwords == 1) || (strncmp(words[0], xbuf + start, olen) == 0))) { + /* complete */ + if (nlen > olen) { x_goto(xbuf + start); x_delete(olen, FALSE); x_escape(words[0], nlen, x_emacs_putbuf); x_adjust(); completed = 1; } + /* add space if single non-dir match */ if ((nwords == 1) && (!ISDIRSEP(words[0][nlen - 1]))) { x_ins(space); completed = 1;