From 93cd35c05988527ee9256d5b8d1697c652bde042 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Fri, 19 Feb 1999 06:32:40 +0000 Subject: [PATCH] small mod to handle hex conversion better git-svn-id: svn://10.0.0.236/trunk@21282 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsString.cpp | 5 +++-- mozilla/string/obsolete/nsString.cpp | 5 +++-- mozilla/xpcom/ds/nsString.cpp | 5 +++-- mozilla/xpcom/string/obsolete/nsString.cpp | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) 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{