From bc37112b806de0e7ba4be78f3343dd100a3fa279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 11 Apr 2019 11:37:26 +0000 Subject: [PATCH] Bug 1542736 - Part 9: Replace std::isspace with js::unicode::IsSpace. r=jwalden Remove the last remaining call to ctype functions. Differential Revision: https://phabricator.services.mozilla.com/D26512 --HG-- extra : moz-landing-system : lando --- js/src/shell/jsoptparse.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index e7b9bcd635de..0f8cc9a3c6be 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -6,11 +6,12 @@ #include "shell/jsoptparse.h" -#include #include #include "jsutil.h" +#include "util/Unicode.h" + using namespace js; using namespace js::cli; using namespace js::cli::detail; @@ -75,16 +76,16 @@ static void PrintParagraph(const char* text, unsigned startColno, } /* Skip any leading spaces. */ - while (*it != '\0' && isspace(*it)) { + while (*it != '\0' && unicode::IsSpace(*it)) { ++it; } while (*it != '\0') { - MOZ_ASSERT(!isspace(*it) || *it == '\n'); + MOZ_ASSERT(!unicode::IsSpace(*it) || *it == '\n'); /* Delimit the current token. */ const char* limit = it; - while (!isspace(*limit) && *limit != '\0') { + while (!unicode::IsSpace(*limit) && *limit != '\0') { ++limit; }