diff --git a/mozilla/base/src/nsString.cpp b/mozilla/base/src/nsString.cpp index 9bad4b2c216..090d06d4825 100644 --- a/mozilla/base/src/nsString.cpp +++ b/mozilla/base/src/nsString.cpp @@ -758,10 +758,11 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const { result=-result; break; } - else if('+'==theChar) { //stop in a good state if you see this... + else if(('+'==theChar) || (' '==theChar)) { //stop in a good state if you see this... break; } - else if(' '==theChar){ //stop in a good state if you see this... + else if((('x'==theChar) || ('X'==theChar)) && (16==aRadix)) { + //stop in a good state. break; } else{ diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 9bad4b2c216..090d06d4825 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -758,10 +758,11 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const { result=-result; break; } - else if('+'==theChar) { //stop in a good state if you see this... + else if(('+'==theChar) || (' '==theChar)) { //stop in a good state if you see this... break; } - else if(' '==theChar){ //stop in a good state if you see this... + else if((('x'==theChar) || ('X'==theChar)) && (16==aRadix)) { + //stop in a good state. break; } else{ diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index 9bad4b2c216..090d06d4825 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -758,10 +758,11 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const { result=-result; break; } - else if('+'==theChar) { //stop in a good state if you see this... + else if(('+'==theChar) || (' '==theChar)) { //stop in a good state if you see this... break; } - else if(' '==theChar){ //stop in a good state if you see this... + else if((('x'==theChar) || ('X'==theChar)) && (16==aRadix)) { + //stop in a good state. break; } else{ diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index 9bad4b2c216..090d06d4825 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -758,10 +758,11 @@ PRInt32 nsString::ToInteger(PRInt32* aErrorCode,PRInt32 aRadix) const { result=-result; break; } - else if('+'==theChar) { //stop in a good state if you see this... + else if(('+'==theChar) || (' '==theChar)) { //stop in a good state if you see this... break; } - else if(' '==theChar){ //stop in a good state if you see this... + else if((('x'==theChar) || ('X'==theChar)) && (16==aRadix)) { + //stop in a good state. break; } else{