Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ksh In emacs mode, when expanding file names containing ...
details: https://anonhg.NetBSD.org/src/rev/5a002c9d1078
branches: trunk
changeset: 551081:5a002c9d1078
user: wiz <wiz%NetBSD.org@localhost>
date: Thu Aug 28 19:53:32 2003 +0000
description:
In emacs mode, when expanding file names containing characters that should
get quoted with <ESC>*, _do_ quote them.
Patch from Federico Schwindt fgsch@openbsd -- thanks!
[rev 1.25 in OpenBSD version of this file]
diffstat:
bin/ksh/emacs.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 2f99c27b2cc0 -r 5a002c9d1078 bin/ksh/emacs.c
--- a/bin/ksh/emacs.c Thu Aug 28 19:44:09 2003 +0000
+++ b/bin/ksh/emacs.c Thu Aug 28 19:53:32 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.21 2003/08/26 09:06:50 wiz Exp $ */
+/* $NetBSD: emacs.c,v 1.22 2003/08/28 19:53:32 wiz Exp $ */
/*
* Emacs-like command line editing and history
@@ -10,7 +10,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: emacs.c,v 1.21 2003/08/26 09:06:50 wiz Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.22 2003/08/28 19:53:32 wiz Exp $");
#endif
@@ -1785,12 +1785,15 @@
x_goto(xbuf + start);
x_delete(end - start, FALSE);
- for (i = 0; i < nwords; i++)
- if (x_ins(words[i]) < 0 || (i < nwords - 1 && x_ins(space) < 0))
+ for (i = 0; i < nwords;) {
+ if (x_escape(words[i], strlen(words[i]), x_emacs_putbuf) < 0 ||
+ (++i < nwords && x_ins(space) < 0))
{
x_e_putc(BEL);
return KSTD;
}
+ }
+ x_adjust();
return KSTD;
}
Home |
Main Index |
Thread Index |
Old Index