diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-20 16:36:02 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-20 16:36:02 -0300 |
| commit | 738b3b64afd6b06d1de6d71caae9a3122c74a5a5 (patch) | |
| tree | 88cddae024fdaec52437ac8ad580ae2be8506c7b | |
| parent | 363b525c23126c167e89c688e835c54ab7ef30d1 (diff) | |
| download | lua-738b3b64afd6b06d1de6d71caae9a3122c74a5a5.tar.gz lua-738b3b64afd6b06d1de6d71caae9a3122c74a5a5.tar.bz2 lua-738b3b64afd6b06d1de6d71caae9a3122c74a5a5.zip | |
detail (to avoid warnings with '-O3')
| -rw-r--r-- | lutf8lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lutf8lib.c,v 1.2 2014/02/06 20:03:24 roberto Exp roberto $ | 2 | ** $Id: lutf8lib.c,v 1.3 2014/03/20 14:11:00 roberto Exp roberto $ |
| 3 | ** Standard library for UTF-8 manipulation | 3 | ** Standard library for UTF-8 manipulation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -108,7 +108,7 @@ static int codepoint (lua_State *L) { | |||
| 108 | int code; | 108 | int code; |
| 109 | s = utf8_decode(s, &code); | 109 | s = utf8_decode(s, &code); |
| 110 | if (s == NULL) | 110 | if (s == NULL) |
| 111 | luaL_error(L, "invalid UTF-8 code"); | 111 | return luaL_error(L, "invalid UTF-8 code"); |
| 112 | lua_pushinteger(L, code); | 112 | lua_pushinteger(L, code); |
| 113 | n++; | 113 | n++; |
| 114 | } | 114 | } |
| @@ -200,7 +200,7 @@ static int iter_aux (lua_State *L) { | |||
| 200 | int code; | 200 | int code; |
| 201 | const char *next = utf8_decode(s + n, &code); | 201 | const char *next = utf8_decode(s + n, &code); |
| 202 | if (next == NULL || iscont(next)) | 202 | if (next == NULL || iscont(next)) |
| 203 | luaL_error(L, "invalid UTF-8 code"); | 203 | return luaL_error(L, "invalid UTF-8 code"); |
| 204 | lua_pushinteger(L, n + 1); | 204 | lua_pushinteger(L, n + 1); |
| 205 | lua_pushinteger(L, code); | 205 | lua_pushinteger(L, code); |
| 206 | return 2; | 206 | return 2; |
