Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
4b4ce47e
Commit
4b4ce47e
authored
Nov 13, 2021
by
Johny Mattsson
Browse files
Fix file listing on submounts.
parent
a0c9085c
Changes
1
Show whitespace changes
Inline
Side-by-side
components/modules/file.c
View file @
4b4ce47e
...
...
@@ -44,8 +44,13 @@ static int file_list( lua_State* L )
lua_newtable
(
L
);
struct
dirent
*
e
;
while
((
e
=
readdir
(
dir
)))
{
char
*
fname
;
asprintf
(
&
fname
,
"%s/%s"
,
dirname
,
e
->
d_name
);
if
(
!
fname
)
return
luaL_error
(
L
,
"no memory"
);
struct
stat
st
=
{
0
,
};
stat
(
e
->
d_name
,
&
st
);
stat
(
fname
,
&
st
);
free
(
fname
);
lua_pushinteger
(
L
,
st
.
st_size
);
lua_setfield
(
L
,
-
2
,
e
->
d_name
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment