diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-03-10 11:19:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-03-10 11:19:41 -0300 |
commit | f2d35bdc7831dce6b1e9fcd639510bdc91488bc2 (patch) | |
tree | 6d0f085cf894f31605e52ad0ce2a1e11cea190f3 /lauxlib.c | |
parent | 26794616374fee54532d0030ae006abb77dfb7ba (diff) | |
download | lua-f2d35bdc7831dce6b1e9fcd639510bdc91488bc2.tar.gz lua-f2d35bdc7831dce6b1e9fcd639510bdc91488bc2.tar.bz2 lua-f2d35bdc7831dce6b1e9fcd639510bdc91488bc2.zip |
format for file source is independent of "ldo".
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.14 1999/02/25 19:13:56 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.15 1999/03/04 21:17:26 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -126,3 +126,10 @@ void luaL_chunkid (char *out, char *source, int len) { | |||
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | |||
130 | void luaL_filesource (char *out, char *filename, int len) { | ||
131 | if (filename == NULL) | ||
132 | strcpy(out, "@(stdin)"); | ||
133 | else | ||
134 | sprintf(out, "@%.*s", len-2, filename); /* -2 for '@' and '\0' */ | ||
135 | } | ||