Bug 1542736 - Part 8: Replace std::isalpha with mozilla::IsAsciiAlpha. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 11 Apr 2019 11:37:22 +0000
changeset 469059 ad9ff91000a99f6f12ea5338776aa883659c2986
parent 469058 ed1ef97375801e123d5edf8bbe569f8411852004
child 469060 e28d3c25f82c2246bcd3edf3a73f5fb1d0899a20
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1542736
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1542736 - Part 8: Replace std::isalpha with mozilla::IsAsciiAlpha. r=jwalden More removal of ctype functions. Differential Revision: https://phabricator.services.mozilla.com/D26511
js/src/shell/OSObject.cpp
--- a/js/src/shell/OSObject.cpp
+++ b/js/src/shell/OSObject.cpp
@@ -3,16 +3,18 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // OSObject.h - os object for exposing posix system calls in the JS shell
 
 #include "shell/OSObject.h"
 
+#include "mozilla/TextUtils.h"
+
 #include <errno.h>
 #include <stdlib.h>
 #ifdef XP_WIN
 #  include <direct.h>
 #  include <process.h>
 #  include <string.h>
 #else
 #  include <sys/wait.h>
@@ -72,18 +74,18 @@ static bool IsAbsolutePath(const UniqueC
   //
   //   "\..."
   //   "\\..."
   //   "C:\..."
   //
   // The first two cases are handled by the test above so we only need a test
   // for the last one here.
 
-  if ((strlen(pathname) > 3 && isalpha(pathname[0]) && pathname[1] == ':' &&
-       pathname[2] == '\\')) {
+  if ((strlen(pathname) > 3 && mozilla::IsAsciiAlpha(pathname[0]) &&
+       pathname[1] == ':' && pathname[2] == '\\')) {
     return true;
   }
 #endif
 
   return false;
 }
 
 /*