diff options
author | sapics <gv.nishino@gmail.com> | 2020-06-16 13:25:39 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-06-25 19:14:23 +0300 |
commit | bc23d108c849c857cab4b3d5caee89ce48757a96 (patch) | |
tree | d055d344d0fe22a5eadfe6237a77c124845e4fae /src/util-inl.h | |
parent | 50228cf6ffca3936717f5797025f3c49c2278fee (diff) |
src: fix ParseEncoding
"utf-16LE" was parsed "UNKNOWN", this fixes to "UCS2"
"utf-buffer" was parsed "BUFFER", this fixes to "UNKNOWN"
"utf-16leNOT" was parsed "UCS2", this fixes to "UNKNOWN"
PR-URL: https://github.com/nodejs/node/pull/33957
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/util-inl.h')
-rw-r--r-- | src/util-inl.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util-inl.h b/src/util-inl.h index 5276fbef07f..00a9f836e46 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -296,12 +296,10 @@ std::string ToUpper(const std::string& in) { } bool StringEqualNoCase(const char* a, const char* b) { - do { - if (*a == '\0') - return *b == '\0'; - if (*b == '\0') - return false; - } while (ToLower(*a++) == ToLower(*b++)); + while (ToLower(*a) == ToLower(*b++)) { + if (*a++ == '\0') + return true; + } return false; } |