Merge
This commit is contained in:
commit
1b6556acac
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -59,12 +59,13 @@ template <> void DCmdArgument<jlong>::destroy_value() { }
|
|||||||
|
|
||||||
template <> void DCmdArgument<bool>::parse_value(const char* str,
|
template <> void DCmdArgument<bool>::parse_value(const char* str,
|
||||||
size_t len, TRAPS) {
|
size_t len, TRAPS) {
|
||||||
|
// len is the length of the current token starting at str
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
set_value(true);
|
set_value(true);
|
||||||
} else {
|
} else {
|
||||||
if (strcasecmp(str, "true") == 0) {
|
if (len == strlen("true") && strncasecmp(str, "true", len) == 0) {
|
||||||
set_value(true);
|
set_value(true);
|
||||||
} else if (strcasecmp(str, "false") == 0) {
|
} else if (len == strlen("false") && strncasecmp(str, "false", len) == 0) {
|
||||||
set_value(false);
|
set_value(false);
|
||||||
} else {
|
} else {
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||||
|
@ -130,6 +130,9 @@ inline jdouble jdouble_cast(jlong x) { return *(jdouble*)&x; }
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Non-standard stdlib-like stuff:
|
// Non-standard stdlib-like stuff:
|
||||||
inline int strcasecmp(const char *s1, const char *s2) { return _stricmp(s1,s2); }
|
inline int strcasecmp(const char *s1, const char *s2) { return _stricmp(s1,s2); }
|
||||||
|
inline int strncasecmp(const char *s1, const char *s2, size_t n) {
|
||||||
|
return _strnicmp(s1,s2,n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user