summaryrefslogtreecommitdiffstats
path: root/lib/libedit/chared.c
diff options
context:
space:
mode:
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 dcd189c..ed6a7c7 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);
}
OpenPOWER on IntegriCloud