diff options
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 | } | ||