diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-08-02 23:48:02 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-08-02 23:48:02 +0000 |
commit | 30727aa6d12fb866494020c0b62ab265a2bdcdfe (patch) | |
tree | 9db60d4f61ec0c8c25c06e9a8118d29b2bfc1cb1 /readline/kill.c | |
parent | 1fa0ddb30b4401475d6a055946cc20909d0a9c21 (diff) | |
parent | c862e87b3ec8647ab6c1bb08443088ea81c74225 (diff) | |
download | gdb-30727aa6d12fb866494020c0b62ab265a2bdcdfe.zip gdb-30727aa6d12fb866494020c0b62ab265a2bdcdfe.tar.gz gdb-30727aa6d12fb866494020c0b62ab265a2bdcdfe.tar.bz2 |
This commit was generated by cvs2svn to track changes on a CVS vendor
branch.
Diffstat (limited to 'readline/kill.c')
-rw-r--r-- | readline/kill.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/readline/kill.c b/readline/kill.c index a150e3c..0b4714f 100644 --- a/readline/kill.c +++ b/readline/kill.c @@ -572,6 +572,8 @@ rl_yank_last_arg (count, key) static int explicit_arg_p = 0; static int count_passed = 1; static int direction = 1; + static int undo_needed = 0; + int retval; if (rl_last_func != rl_yank_last_arg) { @@ -582,19 +584,22 @@ rl_yank_last_arg (count, key) } else { - rl_do_undo (); + if (undo_needed) + rl_do_undo (); if (count < 1) direction = -direction; history_skip += direction; if (history_skip < 0) history_skip = 0; - count_passed = count; } if (explicit_arg_p) - return (rl_yank_nth_arg_internal (count, key, history_skip)); + retval = rl_yank_nth_arg_internal (count_passed, key, history_skip); else - return (rl_yank_nth_arg_internal ('$', key, history_skip)); + retval = rl_yank_nth_arg_internal ('$', key, history_skip); + + undo_needed = retval == 0; + return retval; } /* A special paste command for users of Cygnus's cygwin32. */ |