This commit is contained in:
Cameron Kaiser 2017-11-14 20:16:11 -08:00
parent 81e2358bec
commit 9bb17e851d
5 changed files with 22 additions and 6 deletions

View File

@ -15,6 +15,10 @@
#elif defined(XP_UNIX)
#include <sys/stat.h>
#include <string.h>
#include "mozilla-config.h"
#include "plvmx.h"
#endif
namespace mozilla {
@ -117,7 +121,7 @@ private:
// PATH. Only do so if argv[0] looks like a path (contains a /).
// 2) manually walk through the PATH and look for ourself
// 3) give up
if (strchr(aArgv0, '/') && realpath(aArgv0, aResult) &&
if (VMX_STRCHR(aArgv0, '/') && realpath(aArgv0, aResult) &&
stat(aResult, &fileStat) == 0) {
return NS_OK;
}

View File

@ -8,6 +8,9 @@
#include "nsUnicharUtils.h"
#include "mozilla-config.h"
#include "plvmx.h"
namespace mozilla {
static const char sWhitespaces[] = " \t";
@ -264,7 +267,7 @@ Tokenizer::Parse(Token& aToken) const
state = PARSE_CRLF;
} else if (*next == '\n') {
state = PARSE_LF;
} else if (strchr(mWhitespaces, *next)) { // not UTF-8 friendly?
} else if (VMX_STRCHR(mWhitespaces, *next)) { // not UTF-8 friendly?
state = PARSE_WS;
} else {
state = PARSE_CHAR;
@ -339,7 +342,7 @@ Tokenizer::IsWordFirst(const char aInput) const
return (ToLowerCase(static_cast<uint32_t>(aInput)) !=
ToUpperCase(static_cast<uint32_t>(aInput))) ||
'_' == aInput ||
(mAdditionalWordChars ? !!strchr(mAdditionalWordChars, aInput) : false);
(mAdditionalWordChars ? !!VMX_STRCHR(mAdditionalWordChars, aInput) : false);
}
bool

View File

@ -60,6 +60,9 @@
#include "prmem.h"
#include "plbase64.h"
#include "mozilla-config.h"
#include "plvmx.h"
static nsresult MacErrorMapper(OSErr inErr);
#endif
@ -334,7 +337,7 @@ nsLocalFile::CreateAllAncestors(uint32_t aPermissions)
fprintf(stderr, "nsIFile: before: %s\n", buffer);
#endif
while ((slashp = strchr(slashp + 1, '/'))) {
while ((slashp = VMX_STRCHR(slashp + 1, '/'))) {
/*
* Sequences of '/' are equivalent to a single '/'.
*/

View File

@ -8,6 +8,9 @@
#include "mozilla/double-conversion.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla-config.h"
#include "plvmx.h"
using double_conversion::DoubleToStringConverter;
#ifdef XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
@ -938,7 +941,7 @@ FormatWithoutTrailingZeros(char (&aBuf)[40], double aDouble,
}
char* end = formattedDouble + length;
char* decimalPoint = strchr(aBuf, '.');
char* decimalPoint = VMX_STRCHR(aBuf, '.');
// No trailing zeros to remove.
if (!decimalPoint) {
return length;

View File

@ -10,6 +10,9 @@
#include "nscore.h"
#include <string.h> /* strchr */
#include "mozilla-config.h"
#include "plvmx.h"
static PRBool
CheckForRepeat(XPTCursor *cursor, void **addrp, XPTPool pool, uint32_t len,
XPTCursor *new_cursor, PRBool *already);
@ -407,7 +410,7 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp)
my_cursor.state = cursor->state;
start = &CURS_POINT(&my_cursor);
end = strchr(start, 0); /* find the end of the string */
end = VMX_STRCHR(start, 0); /* find the end of the string */
if (!end) {
fprintf(stderr, "didn't find end of string on decode!\n");
return PR_FALSE;