/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
}
u32 cmp(const char *a, const char *b, size_t len, bool nocase) {
- return cmpForward((const u8 *)a, (const u8 *)b, len, nocase);
+ if (!nocase) {
+ return memcmp(a, b, len);
+ }
+
+ for (const auto *a_end = a + len; a < a_end; a++, b++) {
+ if (mytoupper(*a) != mytoupper(*b)) {
+ return 1;
+ }
+ }
+ return 0;
}
case_iter::case_iter(const ue2_literal &ss) : s(ss.get_string()),