openbsd-ports/www/mozilla-firebird/patches/patch-string_embed_nsEmbedString_cpp
wilfried 2c5c44dae5 import of mozilla-firebird 0.6
The Mozilla Firebird project is a redesign of Mozilla's browser
component, written using the XUL user interface language and designed
to be cross-platform.
2003-05-18 20:43:49 +00:00

49 lines
1.4 KiB
Plaintext

$OpenBSD: patch-string_embed_nsEmbedString_cpp,v 1.1.1.1 2003/05/18 20:43:49 wilfried Exp $
--- string/embed/nsEmbedString.cpp.orig Mon Mar 24 23:46:49 2003
+++ string/embed/nsEmbedString.cpp Sun May 18 04:48:33 2003
@@ -39,7 +39,7 @@
#include <stdlib.h>
#include "nsEmbedString.h"
-const PRUnichar gCommonEmptyBuffer[1] = { 0 };
+static const PRUnichar gCommonEmptyBuffer[1] = { 0 };
nsEmbedString::nsEmbedString()
{
@@ -130,7 +130,7 @@ nsEmbedString::Realloc(size_type aNewSiz
PRBool
nsEmbedString::OwnsBuffer() const
{
- return mStr != (char_type*)gCommonEmptyBuffer;
+ return mStr != (char_type*)gCommonEmptyBuffer && mCapacity != 0;
}
const nsEmbedString::char_type*
@@ -180,7 +180,7 @@ nsEmbedString::SetLength(size_type aLeng
GrowCapacity(aLength);
mLength = aLength;
- if (mStr != (char_type*)gCommonEmptyBuffer)
+ if (mStr != (char_type*)gCommonEmptyBuffer && mCapacity != 0)
AddNullTerminator();
}
@@ -336,7 +336,7 @@ nsEmbedCString::Realloc(size_type aNewSi
PRBool
nsEmbedCString::OwnsBuffer() const
{
- return mStr != (char_type*)gCommonEmptyBuffer;
+ return mStr != (char_type*)gCommonEmptyBuffer && mCapacity != 0;
}
const nsEmbedCString::char_type*
@@ -386,7 +386,7 @@ nsEmbedCString::SetLength(size_type aLen
GrowCapacity(aLength);
mLength = aLength;
- if (mStr != (char_type*)gCommonEmptyBuffer)
+ if (mStr != (char_type*)gCommonEmptyBuffer && mCapacity != 0)
AddNullTerminator();
}