Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Container Registry
Model registry
Operate
Environments
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
redox-os
relibc
Commits
3c8cb95b
Verified
Commit
3c8cb95b
authored
6 years ago
by
jD91mZM2
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup strcasecmp
parent
0de7d306
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1447
failed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/header/strings/mod.rs
+5
-27
5 additions, 27 deletions
src/header/strings/mod.rs
with
5 additions
and
27 deletions
src/header/strings/mod.rs
+
5
−
27
View file @
3c8cb95b
...
...
@@ -67,22 +67,7 @@ pub unsafe extern "C" fn rindex(mut s: *const c_char, c: c_int) -> *mut c_char {
#[no_mangle]
pub
unsafe
extern
"C"
fn
strcasecmp
(
mut
first
:
*
const
c_char
,
mut
second
:
*
const
c_char
)
->
c_int
{
while
*
first
!=
0
&&
*
second
!=
0
{
let
mut
i
=
*
first
;
let
mut
j
=
*
second
;
if
i
&
!
32
!=
j
&
!
32
{
return
-
1
;
}
first
=
first
.offset
(
1
);
second
=
second
.offset
(
1
);
}
// Both strings didn't end with NUL bytes
if
*
first
!=
*
second
{
return
-
1
;
}
0
strncasecmp
(
first
,
second
,
size_t
::
max_value
())
}
#[no_mangle]
...
...
@@ -91,21 +76,14 @@ pub unsafe extern "C" fn strncasecmp(
mut
second
:
*
const
c_char
,
mut
n
:
size_t
,
)
->
c_int
{
while
*
first
!=
0
&&
*
second
!=
0
&&
n
>
0
{
let
mut
i
=
*
first
;
let
mut
j
=
*
second
;
if
i
&
!
32
!=
j
&
!
32
{
return
-
1
;
while
*
first
&
!
32
==
*
second
&
!
32
{
if
n
==
0
||
*
first
==
0
&&
*
second
==
0
{
return
0
;
}
first
=
first
.offset
(
1
);
second
=
second
.offset
(
1
);
n
-=
1
;
}
// Both strings didn't end with NUL bytes (unless we reached the limit)
if
n
>
0
&&
*
first
!=
*
second
{
return
-
1
;
}
0
-
1
}
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