summaryrefslogtreecommitdiff
path: root/macro.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-23 19:14:15 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-23 19:14:15 -0500
commit6bac173ff2ec52b8e03b6e4cec67fffa5e4e3826 (patch)
tree90a88e8b0194af1bb4a7f7d7987e2f170a524345 /macro.c
parentfc06b0af27b485addc67a148e5e5ca061c2efdb6 (diff)
downloadreadline-6bac173ff2ec52b8e03b6e4cec67fffa5e4e3826.tar.gz
Readline-5.1 import
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/macro.c b/macro.c
index b73c3af..2975bf1 100644
--- a/macro.c
+++ b/macro.c
@@ -100,6 +100,8 @@ _rl_with_macro_input (string)
int
_rl_next_macro_key ()
{
+ int c;
+
if (rl_executing_macro == 0)
return (0);
@@ -109,7 +111,14 @@ _rl_next_macro_key ()
return (_rl_next_macro_key ());
}
+#if defined (READLINE_CALLBACKS)
+ c = rl_executing_macro[executing_macro_index++];
+ if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_READCMD) && rl_executing_macro[executing_macro_index] == 0)
+ _rl_pop_executing_macro ();
+ return c;
+#else
return (rl_executing_macro[executing_macro_index++]);
+#endif
}
/* Save the currently executing macro on a stack of saved macros. */