On 2012-04-23 12:11:06 +0200, Alexandre Julliard wrote: > Kusanagi Kouichi <[email protected]> writes: > > > @@ -962,6 +972,22 @@ static Family *find_family_from_any_name(const WCHAR > > *name) > > return NULL; > > } > > > > +static Font *find_font_file(const char *file) > > +{ > > + if (file != NULL) > > + { > > + Font *font; > > + > > + LIST_FOR_EACH_ENTRY(font, &font_list, Font, entry) > > + { > > + if (font->file != NULL && strcmp(font->file, file) == 0) > > + return font; > > + } > > + } > > + > > + return NULL; > > +} > > You can't compare files this way, different paths can point to the same > file.
This function finds font path, not file. So find_font_path would be more appropriate name. > > @@ -2927,7 +2988,8 @@ static BOOL get_fontdir( const char *unix_name, > > struct fontdir *fd ) > > DWORD type; > > > > if (!ft_face) return FALSE; > > - face = create_face( ft_face, 0, unix_name, NULL, 0, 0, FALSE ); > > + font.file = (char *)unix_name; > > Don't do that. > > -- > Alexandre Julliard > [email protected]
