summaryrefslogtreecommitdiff
path: root/readline/kill.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-04-24 22:00:27 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-04-24 22:00:27 +0000
commitedc469a5506b2f0858aa4366d84f5c04e4eeeebe (patch)
treecf5d1c0b957710b8b9976bff1e8484b7c4a839b4 /readline/kill.c
parent7be84cf3293f63b314237035e7df76caa8022769 (diff)
downloadgdb-readline_5_1-import-branch.tar.gz
Diffstat (limited to 'readline/kill.c')
-rw-r--r--readline/kill.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/readline/kill.c b/readline/kill.c
index a616b920d90..1d3254c3275 100644
--- a/readline/kill.c
+++ b/readline/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;
}