<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span># HG changeset patch<br>
</span>
<div># User Yunbin Liu yunbinliu@outlook.com<br>
</div>
<div># Date 1554925873 -28800<br>
</div>
<div># Thu Apr 11 03:51:13 2019 +0800<br>
</div>
<div># Node ID 228b945cf5f8c30356fc5760f696e49545075f00<br>
</div>
<div># Parent a6e23e343081b79eb924da985a414909310aa7a3<br>
</div>
<div>Fix bug of n in function of ngx_utf8_length<br>
</div>
<div><br>
</div>
<div>diff -r a6e23e343081 -r 228b945cf5f8 src/core/ngx_string.c<br>
</div>
<div>--- a/src/core/ngx_string.c Tue Apr 09 16:00:30 2019 +0300<br>
</div>
<div>+++ b/src/core/ngx_string.c Thu Apr 11 03:51:13 2019 +0800<br>
</div>
<div>@@ -1369,6 +1369,7 @@<br>
</div>
<div> {<br>
</div>
<div> u_char c, *last;<br>
</div>
<div> size_t len;<br>
</div>
<div>+ u_char *current_point;<br>
</div>
<div> <br>
</div>
<div> last = p + n;<br>
</div>
<div> <br>
</div>
<div>@@ -1378,13 +1379,16 @@<br>
</div>
<div> <br>
</div>
<div> if (c < 0x80) {<br>
</div>
<div> p++;<br>
</div>
<div>+ n--;<br>
</div>
<div> continue;<br>
</div>
<div> }<br>
</div>
<div> <br>
</div>
<div>+ current_point = p;<br>
</div>
<div> if (ngx_utf8_decode(&p, n) > 0x10ffff) {<br>
</div>
<div> /* invalid UTF-8 */<br>
</div>
<div> return n;<br>
</div>
<div> }<br>
</div>
<div>+ n -= p - current_point;<br>
</div>
<div> }<br>
</div>
<div> <br>
</div>
<span> return len;</span><br>
</div>
</body>
</html>