diff options
author | Philipp Lohmann <pl@openoffice.org> | 2002-10-21 14:05:15 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2002-10-21 14:05:15 +0000 |
commit | 51a9edfd830af6c624893089e30679f28abddac6 (patch) | |
tree | fdbb1e58d10e676c1e3e4f47677667b8beddf54f /psprint/source | |
parent | ebf574019e28fe747f37c92542ea021450b1151e (diff) |
#104300# use realpath to normalize pathes
Diffstat (limited to 'psprint/source')
-rw-r--r-- | psprint/source/fontmanager/fontmanager.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/psprint/source/fontmanager/fontmanager.cxx b/psprint/source/fontmanager/fontmanager.cxx index 0134b38f0fce..8261910f6cab 100644 --- a/psprint/source/fontmanager/fontmanager.cxx +++ b/psprint/source/fontmanager/fontmanager.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fontmanager.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: pl $ $Date: 2002-09-30 19:00:52 $ + * last change: $Author: pl $ $Date: 2002-10-21 15:05:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,6 +67,7 @@ #include <unistd.h> #include <sys/stat.h> #include <dirent.h> +#include <stdlib.h> #ifndef _OSL_THREAD_H_ #include <osl/thread.h> @@ -1492,10 +1493,18 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const static void normPath( ByteString& rPath ) { + char buf[PATH_MAX]; + + // double slashes and slash at end are probably + // removed by realpath anyway, but since this runs + // on many different platforms let's play it safe while( rPath.SearchAndReplace( "//", "/" ) != STRING_NOTFOUND ) ; if( rPath.Len() > 0 && rPath.GetChar( rPath.Len()-1 ) == '/' ) rPath.Erase( rPath.Len()-1 ); + + if( realpath( rPath.GetBuffer(), buf ) ) + rPath = buf; } void PrintFontManager::getServerDirectories() |