null+****@clear*****
null+****@clear*****
2011年 11月 10日 (木) 12:48:59 JST
SHIDARA Yoji 2011-11-10 03:48:59 +0000 (Thu, 10 Nov 2011)
New Revision: 39b57e7f81166910c0439c6344268356ddcf8de4
Merged 0be2f63: Merge pull request #7 from darashi/fix-prompt-with-libedit-on-lion
Log:
initialize ps before wcrtomb call
This will fix problem of prompt built with libedit on OS X Lion.
Modified files:
src/groonga.c
Modified: src/groonga.c (+1 -0)
===================================================================
--- src/groonga.c 2011-11-10 01:58:51 +0000 (1d8eedb)
+++ src/groonga.c 2011-11-10 03:48:59 +0000 (56dda8a)
@@ -192,6 +192,7 @@ prompt(grn_ctx *ctx, grn_obj *buf)
size_t multibyte_len;
mbstate_t ps;
history_w(command_history, &command_history_event, H_ENTER, line);
+ memset(&ps, 0, sizeof(ps));
wcrtomb(NULL, L'\0', &ps);
for (i = 0; i < nchar; i++) {
multibyte_len = wcrtomb(multibyte_buf, line[i], &ps);