Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapics <gv.nishino@gmail.com>2020-06-16 13:25:39 +0300
committerJames M Snell <jasnell@gmail.com>2020-06-25 19:14:23 +0300
commitbc23d108c849c857cab4b3d5caee89ce48757a96 (patch)
treed055d344d0fe22a5eadfe6237a77c124845e4fae /src/util-inl.h
parent50228cf6ffca3936717f5797025f3c49c2278fee (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.h10
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;
}