From 9235290adcd1ca1a7c1de6bafc1a275f677aa01f Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 15 Mar 2010 18:00:30 +0800 Subject: add some check on IME_TRIM_PRECHECK. --- lua/lua-plugin-init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/lua-plugin-init.c') diff --git a/lua/lua-plugin-init.c b/lua/lua-plugin-init.c index 7a1562f..8469cca 100644 --- a/lua/lua-plugin-init.c +++ b/lua/lua-plugin-init.c @@ -57,7 +57,7 @@ static int ime_get_version(lua_State* L){ } static gboolean ime_is_white_space(const char c){ - const char * white_space = " \t\n\r\v\f"; + static const char * const white_space = " \t\n\r\v\f"; int i; size_t len = strlen(white_space); @@ -69,7 +69,7 @@ static gboolean ime_is_white_space(const char c){ } #define IME_TRIM_PRECHECK \ - if (NULL == s){ \ + if (NULL == s || '\0' == s[0]){ \ lua_pushliteral(L, ""); \ return 1; \ } -- cgit