|
@@ -3,13 +3,14 @@
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
#include "shell/app/command_line_args.h"
|
|
|
+#include <locale>
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
bool IsUrlArg(const base::CommandLine::CharType* arg) {
|
|
|
// the first character must be a letter for this to be a URL
|
|
|
auto c = *arg;
|
|
|
- if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) {
|
|
|
+ if (std::isalpha(c, std::locale::classic())) {
|
|
|
for (auto* p = arg + 1; *p; ++p) {
|
|
|
c = *p;
|
|
|
|
|
@@ -23,7 +24,7 @@ bool IsUrlArg(const base::CommandLine::CharType* arg) {
|
|
|
}
|
|
|
|
|
|
// white-space before a colon means it's not a URL
|
|
|
- if (c == ' ' || (0x9 <= c && c <= 0xD))
|
|
|
+ if (std::isspace(c, std::locale::classic()))
|
|
|
break;
|
|
|
}
|
|
|
}
|