Commit c0230162 authored by Adrian Robert's avatar Adrian Robert
Browse files

nsfont.m: duplicate UTF8Strings before modifying with...

nsfont.m: duplicate UTF8Strings before modifying with nsfont_escape_family_name - patch due to Seiji Zenitani
parent 45d325c4
2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfont.m (nsfont_fmember_to_entity, nsfont_make_fontset_for_font):
strdup() the family UTF8String before modifying it. Patch due to
Seiji Zenitani.
2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfns.m (ns_set_background_color): Apply patch from Chong Yidong to
......
......@@ -150,7 +150,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
unsigned int traits = [[famMember objectAtIndex: 3] unsignedIntValue];
/* NSString *psName = [famMember objectAtIndex: 0]; */
NSMutableString *suffix = [[famMember objectAtIndex: 1] mutableCopy];
char *escapedFamily = [family UTF8String];
char *escapedFamily = strdup ([family UTF8String]);
nsfont_escape_name (escapedFamily);
[suffix replaceOccurrencesOfString: @" " withString: @"" options: 0
......@@ -181,6 +181,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
}
[suffix release];
free (escapedFamily);
return font_entity;
}
......@@ -1226,7 +1227,7 @@ void nsfont_make_fontset_for_font (Lisp_Object name, Lisp_Object font_object)
if (cfont != nil)
{
char *family = [[cfont familyName] UTF8String];
char *family = strdup([[cfont familyName] UTF8String]);
Lisp_Object famAndReg;
nsfont_escape_name (family);
......@@ -1238,6 +1239,7 @@ void nsfont_make_fontset_for_font (Lisp_Object name, Lisp_Object font_object)
SDATA (SYMBOL_NAME (scripts[i])));
Fset_fontset_font (name, scripts[i], famAndReg, Qnil, Qnil);
free (family);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment