From f609a768e726772f00d26568c87e04bbaa23281f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 14 Dec 2006 00:20:26 +0100 Subject: [PATCH] mshtml: Added nsACString_SetData function and use it instead of nsACString_Init when we return string value. --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/nsembed.c | 7 ++++++- dlls/mshtml/nsio.c | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index b7bfb36d888..d23a96709d6 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -332,6 +332,7 @@ void *nsalloc(size_t); void nsfree(void*); void nsACString_Init(nsACString*,const char*); +void nsACString_SetData(nsACString*,const char*); PRUint32 nsACString_GetData(const nsACString*,const char**,PRBool*); void nsACString_Finish(nsACString*); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index e5c46c217dd..f1c2dd2d215 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -422,7 +422,12 @@ void nsACString_Init(nsACString *str, const char *data) { NS_CStringContainerInit(str); if(data) - NS_CStringSetData(str, data, PR_UINT32_MAX); + nsACString_SetData(str, data); +} + +void nsACString_SetData(nsACString *str, const char *data) +{ + NS_CStringSetData(str, data, PR_UINT32_MAX); } PRUint32 nsACString_GetData(const nsACString *str, const char **data, PRBool *termited) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 568434d7987..3c4b04e934c 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -475,7 +475,7 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString TRACE("(%p)->(%p)\n", This, aContentType); if(This->content) { - nsACString_Init(aContentType, This->content); + nsACString_SetData(aContentType, This->content); return S_OK; } @@ -483,7 +483,7 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString return nsIChannel_GetContentType(This->channel, aContentType); TRACE("returning default text/html\n"); - nsACString_Init(aContentType, "text/html"); + nsACString_SetData(aContentType, "text/html"); return NS_OK; } @@ -1154,7 +1154,7 @@ static nsresult NSAPI nsURI_GetSpec(nsIWineURI *iface, nsACString *aSpec) return nsIURI_GetSpec(This->uri, aSpec); if(This->spec) { - nsACString_Init(aSpec, This->spec); + nsACString_SetData(aSpec, This->spec); return NS_OK; }