diff options
author | Daniel Jacobowitz <dan@debian.org> | 2006-04-24 22:00:27 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2006-04-24 22:00:27 +0000 |
commit | edc469a5506b2f0858aa4366d84f5c04e4eeeebe (patch) | |
tree | cf5d1c0b957710b8b9976bff1e8484b7c4a839b4 /readline/kill.c | |
parent | 7be84cf3293f63b314237035e7df76caa8022769 (diff) | |
download | gdb-readline_5_1-import-branch.tar.gz |
Import readline 5.1 on the branch.readline_5_1-import-branchcvs/readline_5_1-import-branch
Diffstat (limited to 'readline/kill.c')
-rw-r--r-- | readline/kill.c | 41 |
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; } |