projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
949a771
)
env: Avoid clobbering an edited variable on ctrl-c
author
Joe Hershberger
<joe.hershberger@ni.com>
Fri, 8 Feb 2013 10:12:34 +0000
(10:12 +0000)
committer
Tom Rini
<trini@ti.com>
Mon, 4 Mar 2013 19:19:56 +0000
(14:19 -0500)
If readline says there was an error, don't write to the variable!
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
common/cmd_nvedit.c
patch
|
blob
|
history
diff --git
a/common/cmd_nvedit.c
b/common/cmd_nvedit.c
index d646d90880edc3e258e0b375c2d601d465a2a895..3a05e6010306f6053624514c48843c375e43b9f6 100644
(file)
--- a/
common/cmd_nvedit.c
+++ b/
common/cmd_nvedit.c
@@
-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);
}