- Fixed variable shadowing in egf-speedup patch.
This commit is contained in:
parent
55f2675e4e
commit
b077d63419
@ -164,8 +164,8 @@
|
||||
+ bytes_left = offset;
|
||||
+ while (bytes_left)
|
||||
+ {
|
||||
+ size_t len = mbrlen (beg, bytes_left, &mbs);
|
||||
+ if (len == (size_t) -1 || len == 0)
|
||||
+ size_t mlen = mbrlen (beg, bytes_left, &mbs);
|
||||
+ if (mlen == (size_t) -1 || mlen == 0)
|
||||
+ {
|
||||
+ /* Incomplete character: treat as single-byte. */
|
||||
+ memset (&mbs, '\0', sizeof (mbstate_t));
|
||||
@ -174,13 +174,13 @@
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (len == (size_t) -2)
|
||||
+ if (mlen == (size_t) -2)
|
||||
+ /* Offset points inside multibyte character:
|
||||
+ * no good. */
|
||||
+ break;
|
||||
+
|
||||
+ beg += len;
|
||||
+ bytes_left -= len;
|
||||
+ beg += mlen;
|
||||
+ bytes_left -= mlen;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
@ -224,8 +224,8 @@
|
||||
+ bytes_left = offset;
|
||||
+ while (bytes_left)
|
||||
+ {
|
||||
+ size_t len = mbrlen (beg, bytes_left, &mbs);
|
||||
+ if (len == (size_t) -1 || len == 0)
|
||||
+ size_t mlen = mbrlen (beg, bytes_left, &mbs);
|
||||
+ if (mlen == (size_t) -1 || mlen == 0)
|
||||
+ {
|
||||
+ /* Incomplete character: treat as single-byte. */
|
||||
+ memset (&mbs, '\0', sizeof (mbstate_t));
|
||||
@ -234,13 +234,13 @@
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (len == (size_t) -2)
|
||||
+ if (mlen == (size_t) -2)
|
||||
+ /* Offset points inside multibyte character:
|
||||
+ * no good. */
|
||||
+ break;
|
||||
+
|
||||
+ beg += len;
|
||||
+ bytes_left -= len;
|
||||
+ beg += mlen;
|
||||
+ bytes_left -= mlen;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
@ -781,16 +781,16 @@
|
||||
+ end = beg + len;
|
||||
+ while (end < buf + size)
|
||||
+ {
|
||||
+ size_t len = mbrlen (end, buf + size - end, &mbs);
|
||||
+ if (len == (size_t) -1 || len == (size_t) -2 || len == 0)
|
||||
+ size_t mlen = mbrlen (end, buf + size - end, &mbs);
|
||||
+ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0)
|
||||
+ {
|
||||
+ memset (&mbs, '\0', sizeof (mbstate_t));
|
||||
+ len = 1;
|
||||
+ mlen = 1;
|
||||
+ }
|
||||
+ if (len == 1 && *end == eol)
|
||||
+ if (mlen == 1 && *end == eol)
|
||||
+ break;
|
||||
+
|
||||
+ end += len;
|
||||
+ end += mlen;
|
||||
+ }
|
||||
}
|
||||
+ else
|
||||
|
Loading…
Reference in New Issue
Block a user