git.droids-corp.org
/
libcmdline.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df9816e
)
cmdline: fix completion in some conditions (partial token len > 1)
author
Olivier Matz
<zer0@droids-corp.org>
Sun, 20 Feb 2011 16:57:29 +0000
(17:57 +0100)
committer
Olivier Matz
<zer0@droids-corp.org>
Sun, 13 Mar 2011 10:09:25 +0000
(11:09 +0100)
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
src/lib/cmdline_parse.c
patch
|
blob
|
history
diff --git
a/src/lib/cmdline_parse.c
b/src/lib/cmdline_parse.c
index
c056833
..
18ea76e
100644
(file)
--- a/
src/lib/cmdline_parse.c
+++ b/
src/lib/cmdline_parse.c
@@
-693,8
+693,8
@@
cmdline_complete(cmdline_parse_ctx_t *ctx, const char *buf,
if (completion_len >= dstsize)
completion_len = dstsize - 1;
strncpy(dst, completion_buf + preparse.comp_tok_len,
- completion_len);
- dst[completion_len] = '\0';
+ completion_len
- preparse.comp_tok_len
);
+ dst[completion_len
- preparse.comp_tok_len
] = '\0';
return CMDLINE_COMPLETE_APPEND;
}