diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-12-15 12:59:59 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-12-15 12:59:59 -0200 |
commit | 5d6de9075d27de4a891a3428b1394f1f721037d6 (patch) | |
tree | 24a5c363447df014796989840840f2f4c3ca80ef | |
parent | 21cff3015a325e2f965d762de5c733f0cf8525cd (diff) | |
download | lua-5d6de9075d27de4a891a3428b1394f1f721037d6.tar.gz lua-5d6de9075d27de4a891a3428b1394f1f721037d6.tar.bz2 lua-5d6de9075d27de4a891a3428b1394f1f721037d6.zip |
"print" uses fputs instead of printf (easier to reimplement).
-rw-r--r-- | lbuiltin.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.35 1998/11/13 16:39:18 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.36 1998/12/03 15:45:15 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -234,10 +234,11 @@ static void luaI_print (void) { | |||
234 | luaD_calln(1, 1); | 234 | luaD_calln(1, 1); |
235 | if (ttype(L->stack.top-1) != LUA_T_STRING) | 235 | if (ttype(L->stack.top-1) != LUA_T_STRING) |
236 | lua_error("`tostring' must return a string to `print'"); | 236 | lua_error("`tostring' must return a string to `print'"); |
237 | printf("%.200s\t", svalue(L->stack.top-1)); | 237 | if (i>2) fputs("\t", stdout); |
238 | fputs(svalue(L->stack.top-1), stdout); | ||
238 | L->stack.top--; | 239 | L->stack.top--; |
239 | } | 240 | } |
240 | printf("\n"); | 241 | fputs("\n", stdout); |
241 | } | 242 | } |
242 | 243 | ||
243 | 244 | ||