aboutsummaryrefslogtreecommitdiff
path: root/lib/libedit/chared.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1998-06-27 16:10:40 +0000
committerBrian Somers <brian@FreeBSD.org>1998-06-27 16:10:40 +0000
commit10d91426852cca57cde24ceac631a99b247c214f (patch)
tree5603b822edfb9e2b3ba8cb674ed64b21a41ef644 /lib/libedit/chared.c
parent431e760b940f014f770e94576b85d811293733ff (diff)
downloadsrc-10d91426852cca57cde24ceac631a99b247c214f.tar.gz
src-10d91426852cca57cde24ceac631a99b247c214f.zip
Fixes assorted problems with the history edit functions in libedit. This
affects sh, ftp (and others?). Submitted by: Max Euston <meuston@jmrodgers.com> PR: 6516
Notes
Notes: svn path=/head/; revision=37199
Diffstat (limited to 'lib/libedit/chared.c')
-rw-r--r--lib/libedit/chared.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/libedit/chared.c b/lib/libedit/chared.c
index dcd189c90343..ed6a7c71e090 100644
--- a/lib/libedit/chared.c
+++ b/lib/libedit/chared.c
@@ -153,12 +153,27 @@ ce__isword(p)
/* cv__isword():
- * Return if p is part of a word according to vi
+ * Return type of word for p according to vi
*/
protected int
cv__isword(p)
int p;
{
+ if (isspace((unsigned char) p))
+ return 0;
+ if ((unsigned char) p == '_' || isalnum((unsigned char) p))
+ return 1;
+ return 2;
+}
+
+
+/* c___isword():
+ * Return if p is part of a space-delimited word (!isspace)
+ */
+protected int
+c___isword(p)
+ int p;
+{
return !isspace((unsigned char) p);
}