summaryrefslogtreecommitdiffstats
path: root/contrib/libreadline/kill.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2004-10-18 07:02:42 +0000
committerache <ache@FreeBSD.org>2004-10-18 07:02:42 +0000
commit0a8076ac56fc245cdfb48a1ac83798a3d6086c30 (patch)
treef78c1227a8143a263e4974d6bf25cf0ccde0e716 /contrib/libreadline/kill.c
parent001407b3a64c7fac1489a2ad6eeb2d23254b3e19 (diff)
downloadFreeBSD-src-0a8076ac56fc245cdfb48a1ac83798a3d6086c30.zip
FreeBSD-src-0a8076ac56fc245cdfb48a1ac83798a3d6086c30.tar.gz
Virgin import of GNU Readline 5.0
Diffstat (limited to 'contrib/libreadline/kill.c')
-rw-r--r--contrib/libreadline/kill.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/libreadline/kill.c b/contrib/libreadline/kill.c
index a616b92..1d3254c 100644
--- a/contrib/libreadline/kill.c
+++ b/contrib/libreadline/kill.c
@@ -339,6 +339,47 @@ rl_unix_word_rubout (count, key)
if (rl_editing_mode == emacs_mode)
rl_mark = rl_point;
}
+
+ return 0;
+}
+
+/* This deletes one filename component in a Unix pathname. That is, it
+ deletes backward to directory separator (`/') or whitespace. */
+int
+rl_unix_filename_rubout (count, key)
+ int count, key;
+{
+ int orig_point, c;
+
+ if (rl_point == 0)
+ rl_ding ();
+ else
+ {
+ orig_point = rl_point;
+ if (count <= 0)
+ count = 1;
+
+ while (count--)
+ {
+ c = rl_line_buffer[rl_point - 1];
+ while (rl_point && (whitespace (c) || c == '/'))
+ {
+ rl_point--;
+ c = rl_line_buffer[rl_point - 1];
+ }
+
+ while (rl_point && (whitespace (c) == 0) && c != '/')
+ {
+ rl_point--;
+ c = rl_line_buffer[rl_point - 1];
+ }
+ }
+
+ rl_kill_text (orig_point, rl_point);
+ if (rl_editing_mode == emacs_mode)
+ rl_mark = rl_point;
+ }
+
return 0;
}
OpenPOWER on IntegriCloud