Fixed crashing when setting doc title to NULL. R/A by brendon

git-svn-id: svn://10.0.0.236/trunk@12718 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cmanske%netscape.com
1998-10-13 20:32:21 +00:00
parent 339c214ae5
commit 14a3005a7c

View File

@@ -815,12 +815,15 @@ SHIST_SetTitleOfCurrentDoc( MWContext *context )
{
/* StrAllocCopy( he->title, context->title ); */
/* Let's save the History as UTF8 */
he->title = (char*)INTL_ConvertLineWithoutAutoDetect(
INTL_DefaultWinCharSetID(context),
CS_UTF8,
(unsigned char*) context->title,
XP_STRLEN(context->title)
);
/* added by cmanske: free existing and check for null title */
XP_FREEIF(he->title);
if( context->title )
he->title = (char*)INTL_ConvertLineWithoutAutoDetect(
INTL_DefaultWinCharSetID(context),
CS_UTF8,
(unsigned char*) context->title,
XP_STRLEN(context->title)
);
/*
* This is the place where we set the title for *global* history hash records
* In addition to not making grid cells normal history entries we've added two