summaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-03-10 11:19:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-03-10 11:19:41 -0300
commitf2d35bdc7831dce6b1e9fcd639510bdc91488bc2 (patch)
tree6d0f085cf894f31605e52ad0ce2a1e11cea190f3 /lauxlib.c
parent26794616374fee54532d0030ae006abb77dfb7ba (diff)
downloadlua-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.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}