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
05778252
Commit
05778252
authored
Feb 16, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/extras/libc.c: fixed vlc_strncasecmp().
parent
4db0a6d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
33 deletions
+15
-33
src/extras/libc.c
src/extras/libc.c
+15
-33
No files found.
src/extras/libc.c
View file @
05778252
...
...
@@ -86,29 +86,20 @@ char *vlc_strndup( const char *string, size_t n )
#if !defined( HAVE_STRCASECMP ) && !defined( HAVE_STRICMP )
int
vlc_strcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
int
i_delta
=
0
;
int
c1
,
c2
;
if
(
!
s1
||
!
s2
)
return
-
1
;
while
(
!
i_delta
&&
*
s1
&&
*
s2
)
while
(
*
s1
&&
*
s2
)
{
i_delta
=
*
s1
-
*
s2
;
if
(
*
s1
>=
'A'
&&
*
s1
<=
'Z'
)
{
i_delta
-=
(
'A'
-
'a'
);
}
if
(
*
s2
>=
'A'
&&
*
s2
<=
'Z'
)
{
i_delta
+=
(
'A'
-
'a'
);
}
c1
=
tolower
(
*
s1
);
c2
=
tolower
(
*
s2
);
if
(
c1
!=
c2
)
return
(
c1
<
c2
?
-
1
:
1
);
s1
++
;
s2
++
;
}
if
(
!
i_delta
&&
(
*
s1
||
*
s2
)
)
i_delta
=
*
s1
?
1
:
-
1
;
return
i_delta
;
if
(
!*
s1
&&
!*
s2
)
return
0
;
else
return
(
*
s1
?
1
:
-
1
);
}
#endif
...
...
@@ -118,29 +109,20 @@ int vlc_strcasecmp( const char *s1, const char *s2 )
#if !defined( HAVE_STRNCASECMP ) && !defined( HAVE_STRNICMP )
int
vlc_strncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
int
i_delta
=
0
;
int
c1
,
c2
;
if
(
!
s1
||
!
s2
)
return
-
1
;
while
(
n
--
&&
!
i_delta
&&
*
s1
&&
*
s2
)
while
(
n
>
0
&&
*
s1
&&
*
s2
)
{
i_delta
=
*
s1
-
*
s2
;
c1
=
tolower
(
*
s1
);
c2
=
tolower
(
*
s2
);
if
(
*
s1
>=
'A'
&&
*
s1
<=
'Z'
)
{
i_delta
-=
'A'
-
'a'
;
if
(
c1
!=
c2
)
return
(
c1
<
c2
?
-
1
:
1
);
s1
++
;
s2
++
;
n
--
;
}
if
(
*
s2
>=
'A'
&&
*
s2
<=
'Z'
)
{
i_delta
+=
'A'
-
'a'
;
}
s1
++
;
s2
++
;
}
if
(
!
n
&&
!
i_delta
&&
(
*
s1
||
*
s2
)
)
i_delta
=
*
s1
?
1
:
-
1
;
return
i_delta
;
if
(
!
n
||
(
!*
s1
&&
!*
s2
)
)
return
0
;
else
return
(
*
s1
?
1
:
-
1
);
}
#endif
...
...
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