From bd41795263e8c4326d5311497fc6f110f8314548 Mon Sep 17 00:00:00 2001 From: carlo-bramini <30959007+carlo-bramini@users.noreply.github.com> Date: Wed, 7 Nov 2018 19:49:13 +0100 Subject: [PATCH] Remove redundant dependency to readline in fluid_cmd.c Libreadline is already used into fluid_istream_readline(). In my opinion, there is no need to have this duplicated code, so I would suggest to move the call to add_history() into fluid_sys.h Closes #460. --- src/bindings/fluid_cmd.c | 14 -------------- src/utils/fluid_sys.c | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c index 156c4da2..a45eba97 100644 --- a/src/bindings/fluid_cmd.c +++ b/src/bindings/fluid_cmd.c @@ -28,11 +28,6 @@ #include "fluid_sfont.h" #include "fluid_chan.h" -#if WITH_READLINE -#include -#include -#endif - /* FIXME: LADSPA used to need a lot of parameters on a single line. This is not * necessary anymore, so the limits below could probably be reduced */ #define MAX_TOKENS 100 @@ -522,15 +517,6 @@ fluid_shell_run(void *data) break; } -#if WITH_READLINE - - if(shell->in == fluid_get_stdin()) - { - add_history(workline); - } - -#endif - /* handle the command */ switch(fluid_command(shell->handler, workline, shell->out)) { diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index e644ea5f..3df88fc2 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -1279,6 +1279,7 @@ fluid_istream_readline(fluid_istream_t in, fluid_ostream_t out, char *prompt, FLUID_SNPRINTF(buf, len, "%s", line); buf[len - 1] = 0; + add_history(buf); free(line); return 1;