From 84410733de34c3d944c3d8d847b997dbbec7422a Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 19 Nov 1998 17:58:30 +0000 Subject: [PATCH] Made nsString::Insert actually support the count=-1 default argument git-svn-id: svn://10.0.0.236/trunk@14950 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/nsString.cpp | 1 + mozilla/string/obsolete/nsString.cpp | 1 + mozilla/xpcom/ds/nsString.cpp | 1 + mozilla/xpcom/string/obsolete/nsString.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/mozilla/base/src/nsString.cpp b/mozilla/base/src/nsString.cpp index 06957e90825..85855519fc8 100644 --- a/mozilla/base/src/nsString.cpp +++ b/mozilla/base/src/nsString.cpp @@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) { */ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given + if (aCount < 0) aCount = aCopy.mLength; if(0<=anOffset) { if(aCount>0) { diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 06957e90825..85855519fc8 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) { */ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given + if (aCount < 0) aCount = aCopy.mLength; if(0<=anOffset) { if(aCount>0) { diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index 06957e90825..85855519fc8 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) { */ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given + if (aCount < 0) aCount = aCopy.mLength; if(0<=anOffset) { if(aCount>0) { diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index 06957e90825..85855519fc8 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) { */ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) { aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given + if (aCount < 0) aCount = aCopy.mLength; if(0<=anOffset) { if(aCount>0) {