Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
08ada199
Commit
08ada199
authored
Jan 02, 2009
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: Don't assume that psz_name != NULL as GetName can return NULL and
strcasecmp doesn't like comparing NULLs
parent
8dca232e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
src/playlist/sort.c
src/playlist/sort.c
+20
-2
No files found.
src/playlist/sort.c
View file @
08ada199
...
...
@@ -123,7 +123,10 @@ static int playlist_cmp(const void *first, const void *second)
#define META_STRCASECMP_NAME( ) { \
char *psz_i = input_item_GetName( (*(playlist_item_t **)first)->p_input ); \
char *psz_ismall = input_item_GetName( (*(playlist_item_t **)second)->p_input ); \
i_test = strcasecmp( psz_i, psz_ismall ); \
if( psz_i != NULL && psz_ismall != NULL ) i_test = strcasecmp( psz_i, psz_ismall ); \
else if ( psz_i == NULL && psz_ismall != NULL ) i_test = 1; \
else if ( psz_ismall == NULL && psz_i != NULL ) i_test = -1; \
else i_test = 0; \
free( psz_i ); \
free( psz_ismall ); \
}
...
...
@@ -231,10 +234,25 @@ static int playlist_cmp(const void *first, const void *second)
i_test
=
-
1
;
}
else
{
if
(
(
*
(
playlist_item_t
**
)
first
)
->
p_input
->
psz_name
!=
NULL
&&
(
*
(
playlist_item_t
**
)
second
)
->
p_input
->
psz_name
!=
NULL
)
{
i_test
=
strcasecmp
(
(
*
(
playlist_item_t
**
)
first
)
->
p_input
->
psz_name
,
(
*
(
playlist_item_t
**
)
second
)
->
p_input
->
psz_name
);
}
else
if
(
(
*
(
playlist_item_t
**
)
first
)
->
p_input
->
psz_name
!=
NULL
&&
(
*
(
playlist_item_t
**
)
second
)
->
p_input
->
psz_name
==
NULL
)
{
i_test
=
1
;
}
else
if
(
(
*
(
playlist_item_t
**
)
first
)
->
p_input
->
psz_name
==
NULL
&&
(
*
(
playlist_item_t
**
)
second
)
->
p_input
->
psz_name
!=
NULL
)
{
i_test
=
-
1
;
}
else
i_test
=
0
;
}
}
else
if
(
sort_mode
==
SORT_URI
)
{
...
...
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