Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
3cc4799c
Commit
3cc4799c
authored
Oct 25, 2010
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncurses: factorize ReadDir()
parent
96c44901
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
modules/gui/ncurses.c
modules/gui/ncurses.c
+19
-35
No files found.
modules/gui/ncurses.c
View file @
3cc4799c
...
@@ -252,52 +252,36 @@ static void ReadDir(intf_thread_t *p_intf)
...
@@ -252,52 +252,36 @@ static void ReadDir(intf_thread_t *p_intf)
struct
stat
stat_data
;
struct
stat
stat_data
;
#endif
#endif
struct
dir_entry_t
*
p_dir_entry
;
struct
dir_entry_t
*
p_dir_entry
;
char
*
psz_uri
;
char
*
psz_uri
=
NULL
;
if
(
p_sys
->
b_show_hidden_files
==
false
&&
if
(
!
p_sys
->
b_show_hidden_files
)
(
strlen
(
psz_entry
)
&&
psz_entry
[
0
]
==
'.'
)
&&
if
(
*
psz_entry
==
'.'
&&
strcmp
(
psz_entry
,
".."
))
strcmp
(
psz_entry
,
".."
))
goto
next
;
{
free
(
psz_entry
);
continue
;
}
if
(
asprintf
(
&
psz_uri
,
"%s/%s"
,
p_sys
->
psz_current_dir
,
if
(
asprintf
(
&
psz_uri
,
"%s/%s"
,
p_sys
->
psz_current_dir
,
psz_entry
)
==
-
1
)
psz_entry
)
==
-
1
)
{
{
free
(
psz_entry
)
;
psz_uri
=
NULL
;
continue
;
goto
next
;
}
}
if
(
!
(
p_dir_entry
=
malloc
(
sizeof
(
struct
dir_entry_t
))))
if
(
!
(
p_dir_entry
=
malloc
(
sizeof
*
p_dir_entry
)))
{
goto
next
;
free
(
psz_uri
);
free
(
psz_entry
);
continue
;
}
p_dir_entry
->
b_file
=
#if defined(S_ISDIR)
#if defined(S_ISDIR)
if
(
!
vlc_stat
(
psz_uri
,
&
stat_data
)
vlc_stat
(
psz_uri
,
&
stat_data
)
||
!
S_ISDIR
(
stat_data
.
st_mode
)
&&
S_ISDIR
(
stat_data
.
st_mode
))
/*#elif defined(DT_DIR)
/*#elif defined(DT_DIR)
if
(p_dir_content->d_type & DT_DIR)*/
!
(p_dir_content->d_type & DT_DIR)*/
#else
#else
if
(
0
)
false
#endif
#endif
{
;
p_dir_entry
->
psz_path
=
strdup
(
psz_entry
);
p_dir_entry
->
b_file
=
false
;
p_dir_entry
->
psz_path
=
strdup
(
psz_entry
);
INSERT_ELEM
(
p_sys
->
pp_dir_entries
,
p_sys
->
i_dir_entries
,
INSERT_ELEM
(
p_sys
->
pp_dir_entries
,
p_sys
->
i_dir_entries
,
p_sys
->
i_dir_entries
,
p_dir_entry
);
p_sys
->
i_dir_entries
,
p_dir_entry
);
}
else
{
p_dir_entry
->
psz_path
=
strdup
(
psz_entry
);
p_dir_entry
->
b_file
=
true
;
INSERT_ELEM
(
p_sys
->
pp_dir_entries
,
p_sys
->
i_dir_entries
,
p_sys
->
i_dir_entries
,
p_dir_entry
);
}
next:
free
(
psz_uri
);
free
(
psz_uri
);
free
(
psz_entry
);
free
(
psz_entry
);
}
}
...
...
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