aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/fontfile/fontfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/fontfile/fontfile.c')
-rwxr-xr-x[-rw-r--r--]libXfont/src/fontfile/fontfile.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/libXfont/src/fontfile/fontfile.c b/libXfont/src/fontfile/fontfile.c
index 05a961072..55aa98d4d 100644..100755
--- a/libXfont/src/fontfile/fontfile.c
+++ b/libXfont/src/fontfile/fontfile.c
@@ -36,6 +36,12 @@ in this Software without prior written authorization from The Open Group.
#ifdef WIN32
#include <ctype.h>
#endif
+#ifdef _MSC_VER
+#define BOOL W32BOOL
+#include <windows.h>
+#undef _X_HIDDEN
+#define _X_HIDDEN static
+#endif
static unsigned char
ISOLatin1ToLower(unsigned char source)
@@ -49,7 +55,7 @@ ISOLatin1ToLower(unsigned char source)
return source;
}
-_X_HIDDEN void
+void
CopyISOLatin1Lowered(char *dest, const char *source, int length)
{
int i;
@@ -69,8 +75,34 @@ static int FontFileOpenBitmapNCF (FontPathElementPtr fpe, FontPtr *pFont,
FontPtr non_cachable_font);
int
-FontFileNameCheck (const char *name)
+FontFileNameCheck (char *name)
{
+#ifdef _MSC_VER
+ WIN32_FIND_DATA FindData;
+ HANDLE hFind;
+ char Tmp;
+ int LenName=strlen(name)-1;
+ Tmp=name[LenName];
+ if (Tmp=='/')
+ name[LenName]=0;
+ hFind=FindFirstFile(name,&FindData);
+ name[LenName]=Tmp;
+
+ if (hFind==INVALID_HANDLE_VALUE)
+ {
+ return 0;
+ }
+ else
+ {
+ FindClose(hFind);
+ if (FindData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ {
+ return 1;
+ }
+ return 0;
+ }
+
+#else
#ifndef NCD
#if defined(WIN32)
/* OS/2 uses D:/... as a path name for fonts, so accept this as a valid
@@ -83,6 +115,7 @@ FontFileNameCheck (const char *name)
#else
return ((strcmp(name, "built-ins") == 0) || (*name == '/'));
#endif
+#endif
}
int