diff options
author | Tony Cook <tony@develop-help.com> | 2016-10-31 14:28:34 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2016-11-09 13:29:46 +1100 |
commit | 65df57a84b55413fcde1e64b86e3d740485536d3 (patch) | |
tree | 848c157d38e8a30b2ccf0bf95d4865174daf28ca /embed.fnc | |
parent | a7ea90b1451006596c4574b1e65894f0bda1bafc (diff) | |
download | perl-65df57a84b55413fcde1e64b86e3d740485536d3.tar.gz |
(perl #129000) create a safer utf8_hop()
Unlike utf8_hop(), utf8_hop_safe() won't navigate before the
beginning or after the end of the supplied buffer.
The original version of this put all of the logic into
utf8_hop_safe(), but in many cases a caller specifically
needs to go forward or backward, and supplying the other limit
made the function less usable, so I split the function
into forward and backward cases.
This split may also make inlining these functions more efficient
or more likely.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1734,6 +1734,9 @@ Ap |U8* |utf16_to_utf8_reversed|NN U8* p|NN U8 *d|I32 bytelen|NN I32 *newlen AdpPR |STRLEN |utf8_length |NN const U8* s|NN const U8 *e AipdPR |IV |utf8_distance |NN const U8 *a|NN const U8 *b AipdPRn |U8* |utf8_hop |NN const U8 *s|SSize_t off +AipdPRn |U8* |utf8_hop_back|NN const U8 *s|SSize_t off|NN const U8 *start +AipdPRn |U8* |utf8_hop_forward|NN const U8 *s|SSize_t off|NN const U8 *end +AipdPRn |U8* |utf8_hop_safe |NN const U8 *s|SSize_t off|NN const U8 *start|NN const U8 *end ApMd |U8* |utf8_to_bytes |NN U8 *s|NN STRLEN *len Apd |int |bytes_cmp_utf8 |NN const U8 *b|STRLEN blen|NN const U8 *u \ |STRLEN ulen |