diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-04-24 22:00:27 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-04-24 22:00:27 +0000 |
commit | 23e2f935d058f72a6dada4c83c740fd4e3dcc6ed (patch) | |
tree | 222dfd22cda9f7a158f58e9cb545f68c849dca98 /readline/kill.c | |
parent | 49b5a1f5dc74a0e693a51409252b3d590cc00bbb (diff) | |
download | binutils-readline_5_1-import-branch.zip binutils-readline_5_1-import-branch.tar.gz binutils-readline_5_1-import-branch.tar.bz2 |
Import readline 5.1 on the branch.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 a616b92..1d3254c 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; } |