summaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 090ded3c..a46591a1 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -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
130void 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}