Ken Thomases : gdi32: Allow ~-based paths in HKCU\Software\Wine\Fonts:Path.

Alexandre Julliard julliard at winehq.org
Thu Oct 27 13:30:11 CDT 2011


Module: wine
Branch: master
Commit: 14efc6eb2454988c595a91e946cc3a1cbb9c37ee
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=14efc6eb2454988c595a91e946cc3a1cbb9c37ee

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed Oct 26 12:27:51 2011 -0500

gdi32: Allow ~-based paths in HKCU\Software\Wine\Fonts:Path.

---

 dlls/gdi32/freetype.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index dee97ad..c734ebf 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 );




More information about the wine-cvs mailing list