projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c2e81b
)
another small lineedit fix
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 16 Jul 2009 12:33:16 +0000
(14:33 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 16 Jul 2009 12:33:16 +0000
(14:33 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/lineedit.c
patch
|
blob
|
history
diff --git
a/libbb/lineedit.c
b/libbb/lineedit.c
index a3d939551cd8ed0319de7371d476471ae0c296af..9a773b4b8ceaae5420d59f1e4b5bed0e51316a2f 100644
(file)
--- a/
libbb/lineedit.c
+++ b/
libbb/lineedit.c
@@
-429,7
+429,9
@@
static void input_delete(int save)
#endif
memmove(command_ps + j, command_ps + j + 1,
- (command_len - j + 1) * sizeof(command_ps[0]));
+ /* (command_len + 1 [because of NUL]) - (j + 1)
+ * simplified into (command_len - j) */
+ (command_len - j) * sizeof(command_ps[0]));
command_len--;
input_end(); /* rewrite new line */
cmdedit_set_out_char(' '); /* erase char */