diff options
-rw-r--r-- | lbaselib.c | 8 | ||||
-rw-r--r-- | lua.c | 7 | ||||
-rw-r--r-- | luaconf.h | 5 |
3 files changed, 11 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.259 2011/01/26 16:30:02 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.260 2011/02/28 17:32:10 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -32,13 +32,13 @@ static int luaB_print (lua_State *L) { | |||
32 | lua_call(L, 1, 1); | 32 | lua_call(L, 1, 1); |
33 | s = lua_tolstring(L, -1, &l); /* get result */ | 33 | s = lua_tolstring(L, -1, &l); /* get result */ |
34 | if (s == NULL) | 34 | if (s == NULL) |
35 | return luaL_error(L, LUA_QL("tostring") " must return a string to " | 35 | return luaL_error(L, |
36 | LUA_QL("print")); | 36 | LUA_QL("tostring") " must return a string to " LUA_QL("print")); |
37 | if (i>1) luai_writestring("\t", 1); | 37 | if (i>1) luai_writestring("\t", 1); |
38 | luai_writestring(s, l); | 38 | luai_writestring(s, l); |
39 | lua_pop(L, 1); /* pop result */ | 39 | lua_pop(L, 1); /* pop result */ |
40 | } | 40 | } |
41 | luai_writestring("\n", 1); | 41 | luai_writeline(); |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
44 | 44 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.197 2011/03/14 15:39:42 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.198 2011/05/03 16:01:57 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -183,7 +183,8 @@ static int docall (lua_State *L, int narg, int nres) { | |||
183 | 183 | ||
184 | 184 | ||
185 | static void print_version (void) { | 185 | static void print_version (void) { |
186 | luai_writestring(LUA_COPYRIGHT "\n", sizeof(LUA_COPYRIGHT) + 1); | 186 | luai_writestring(LUA_COPYRIGHT, sizeof(LUA_COPYRIGHT)); |
187 | luai_writeline(); | ||
187 | } | 188 | } |
188 | 189 | ||
189 | 190 | ||
@@ -320,7 +321,7 @@ static void dotty (lua_State *L) { | |||
320 | } | 321 | } |
321 | } | 322 | } |
322 | lua_settop(L, 0); /* clear stack */ | 323 | lua_settop(L, 0); /* clear stack */ |
323 | luai_writestring("\n", 1); | 324 | luai_writeline(); |
324 | progname = oldprogname; | 325 | progname = oldprogname; |
325 | } | 326 | } |
326 | 327 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.156 2011/04/20 18:25:54 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.157 2011/04/29 13:56:28 roberto Exp roberto $ |
3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -209,10 +209,11 @@ | |||
209 | 209 | ||
210 | 210 | ||
211 | /* | 211 | /* |
212 | @@ luai_writestring defines how 'print' prints its results. | 212 | @@ luai_writestring/luai_writeline define how 'print' prints its results. |
213 | */ | 213 | */ |
214 | #include <stdio.h> | 214 | #include <stdio.h> |
215 | #define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) | 215 | #define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) |
216 | #define luai_writeline() (luai_writestring("\n", 1), fflush(stdout)) | ||
216 | 217 | ||
217 | /* | 218 | /* |
218 | @@ luai_writestringerror defines how to print error messages. | 219 | @@ luai_writestringerror defines how to print error messages. |