summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/readline.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/readline.c b/commands/readline.c
index 85b04a3903..403ac8563a 100644
--- a/commands/readline.c
+++ b/commands/readline.c
@@ -4,6 +4,7 @@
#include <common.h>
#include <command.h>
#include <malloc.h>
+#include <slice.h>
#include <xfuncs.h>
#include <environment.h>
@@ -14,11 +15,16 @@ static int do_readline(int argc, char *argv[])
if (argc < 3)
return COMMAND_ERROR_USAGE;
+ command_slice_release();
+
if (readline(argv[1], buf, CONFIG_CBSIZE) < 0) {
+ command_slice_acquire();
free(buf);
return COMMAND_ERROR;
}
+ command_slice_acquire();
+
setenv(argv[2], buf);
free(buf);