From 14efc6eb2454988c595a91e946cc3a1cbb9c37ee Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 26 Oct 2011 12:27:51 -0500 Subject: [PATCH] gdi32: Allow ~-based paths in HKCU\Software\Wine\Fonts:Path. --- dlls/gdi32/freetype.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index dee97adefec..c734ebf923d 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3115,9 +3115,19 @@ static void init_font_list(void) ptr = valueA; while (ptr) { + const char* home; LPSTR next = strchr( ptr, ':' ); if (next) *next++ = 0; - ReadFontDir( ptr, TRUE ); + if (ptr[0] == '~' && ptr[1] == '/' && (home = getenv( "HOME" )) && + (unixname = HeapAlloc( GetProcessHeap(), 0, strlen(ptr) + strlen(home) ))) + { + strcpy( unixname, home ); + strcat( unixname, ptr + 1 ); + ReadFontDir( unixname, TRUE ); + HeapFree( GetProcessHeap(), 0, unixname ); + } + else + ReadFontDir( ptr, TRUE ); ptr = next; } HeapFree( GetProcessHeap(), 0, valueA );