Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
luatex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeXLive
luatex
Commits
ae78b565
Commit
ae78b565
authored
11 years ago
by
Taco Hoekwater
Browse files
Options
Downloads
Patches
Plain Diff
restore --recorder output for lua files (dofile/loadfile/io.open)
parent
d2ade0bd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/texk/web2c/luatexdir/lua/liolibext.c
+16
-2
16 additions, 2 deletions
source/texk/web2c/luatexdir/lua/liolibext.c
source/texk/web2c/luatexdir/lua/luastuff.w
+7
-3
7 additions, 3 deletions
source/texk/web2c/luatexdir/lua/luastuff.w
with
23 additions
and
5 deletions
source/texk/web2c/luatexdir/lua/liolibext.c
+
16
−
2
View file @
ae78b565
...
...
@@ -181,8 +181,14 @@ static LStream *newfile (lua_State *L) {
static
void
opencheck
(
lua_State
*
L
,
const
char
*
fname
,
const
char
*
mode
)
{
LStream
*
p
=
newfile
(
L
);
p
->
f
=
fopen
(
fname
,
mode
);
if
(
p
->
f
==
NULL
)
if
(
p
->
f
==
NULL
)
{
luaL_error
(
L
,
"cannot open file "
LUA_QS
" (%s)"
,
fname
,
strerror
(
errno
));
}
else
{
if
(
mode
[
0
]
==
'r'
)
recorder_record_input
(
fname
);
else
recorder_record_output
(
fname
);
}
}
...
...
@@ -199,7 +205,15 @@ static int io_open (lua_State *L) {
return
luaL_error
(
L
,
"invalid mode "
LUA_QS
" (should match "
LUA_QL
(
"[rwa]%%+?b?"
)
")"
,
mode
);
p
->
f
=
fopen
(
filename
,
mode
);
return
(
p
->
f
==
NULL
)
?
luaL_fileresult
(
L
,
0
,
filename
)
:
1
;
if
(
p
->
f
==
NULL
)
{
return
luaL_fileresult
(
L
,
0
,
filename
)
;
}
else
{
if
(
mode
[
0
]
==
'r'
)
recorder_record_input
(
filename
);
else
recorder_record_output
(
filename
);
return
1
;
}
}
/*
...
...
This diff is collapsed.
Click to expand it.
source/texk/web2c/luatexdir/lua/luastuff.w
+
7
−
3
View file @
ae78b565
...
...
@@ -147,9 +147,12 @@ static int luatex_loadfile (lua_State *L) {
return 2; /* return nil plus error message */
}
status = luaL_loadfilex(L, fname, mode);
if (status == LUA_OK && env) { /* 'env' parameter? */
lua_pushvalue(L, 3);
lua_setupvalue(L, -2, 1); /* set it as 1st upvalue of loaded chunk */
if (status == LUA_OK) {
recorder_record_input(fname);
if (env) { /* 'env' parameter? */
lua_pushvalue(L, 3);
lua_setupvalue(L, -2, 1); /* set it as 1st upvalue of loaded chunk */
}
}
return load_aux(L, status);
}
...
...
@@ -168,6 +171,7 @@ static int luatex_dofile (lua_State *L) {
}
}
if (luaL_loadfile(L, fname) != 0) lua_error(L);
recorder_record_input(fname);
lua_call(L, 0, LUA_MULTRET);
return lua_gettop(L) - n;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment