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
331ea92a
Commit
331ea92a
authored
Aug 10, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #9425: create Py_UNICODE_strrchr() function
parent
e1dd1747
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
Include/unicodeobject.h
Include/unicodeobject.h
+4
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+13
-0
No files found.
Include/unicodeobject.h
View file @
331ea92a
...
...
@@ -1622,6 +1622,10 @@ PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr(
const
Py_UNICODE
*
s
,
Py_UNICODE
c
);
PyAPI_FUNC
(
Py_UNICODE
*
)
Py_UNICODE_strrchr
(
const
Py_UNICODE
*
s
,
Py_UNICODE
c
);
#ifdef __cplusplus
}
#endif
...
...
Objects/unicodeobject.c
View file @
331ea92a
...
...
@@ -9965,6 +9965,19 @@ Py_UNICODE_strchr(const Py_UNICODE *s, Py_UNICODE c)
return
NULL
;
}
Py_UNICODE
*
Py_UNICODE_strrchr
(
const
Py_UNICODE
*
s
,
Py_UNICODE
c
)
{
const
Py_UNICODE
*
p
;
p
=
s
+
Py_UNICODE_strlen
(
s
);
while
(
p
!=
s
)
{
p
--
;
if
(
*
p
==
c
)
return
(
Py_UNICODE
*
)
p
;
}
return
NULL
;
}
#ifdef __cplusplus
}
...
...
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