Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e62099c2
Commit
e62099c2
authored
Nov 04, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19424: PyUnicode_CompareWithASCIIString() normalizes memcmp() result
to -1, 0, 1
parent
e7319cb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Objects/unicodeobject.c
Objects/unicodeobject.c
+6
-2
No files found.
Objects/unicodeobject.c
View file @
e62099c2
...
...
@@ -10584,8 +10584,12 @@ PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str)
len
=
Py_MIN
(
len1
,
len2
);
cmp
=
memcmp
(
data
,
str
,
len
);
if
(
cmp
!=
0
)
return
cmp
;
if
(
cmp
!=
0
)
{
if
(
cmp
<
0
)
return
-
1
;
else
return
1
;
}
if
(
len1
>
len2
)
return
1
;
/* uni is longer */
if
(
len2
>
len1
)
...
...
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