env: Avoid clobbering an edited variable on ctrl-c
If readline says there was an error, don't write to the variable! Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
949a771097
commit
18a3cce9fa
@ -552,7 +552,8 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
else
|
||||
buffer[0] = '\0';
|
||||
|
||||
readline_into_buffer("edit: ", buffer, 0);
|
||||
if (readline_into_buffer("edit: ", buffer, 0) < 0)
|
||||
return 1;
|
||||
|
||||
return setenv(argv[1], buffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user