X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=readline%2Fkill.c;h=1d3254c3275dc62260c1f481355ea70299f9724c;hb=36f446111a0aba2bbd622ea73a2b5a9a363e5f5c;hp=a616b920d903b592411bb3e4e61bfbef5919df7b;hpb=9255ee3150832d7e235fc0711f0efa70700559e7;p=deliverable%2Fbinutils-gdb.git diff --git a/readline/kill.c b/readline/kill.c index a616b920d9..1d3254c327 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; }