Index: lib/font/fontfile/bufio.c =================================================================== RCS file: /cvs/xorg/xc/lib/font/fontfile/bufio.c,v retrieving revision 1.2 diff -u -r1.2 bufio.c --- lib/font/fontfile/bufio.c 23 Apr 2004 18:44:21 -0000 1.2 +++ lib/font/fontfile/bufio.c 10 Nov 2004 11:27:56 -0000 @@ -122,7 +122,7 @@ BufFilePtr BufFileOpenRead (int fd) { -#ifdef __UNIXOS2__ +#if defined(__UNIXOS2__) || defined (WIN32) /* hv: I'd bet WIN32 has the same effect here */ setmode(fd,O_BINARY); #endif @@ -149,7 +149,7 @@ { BufFilePtr f; -#ifdef __UNIXOS2__ +#if defined(__UNIXOS2__) || defined(WIN32) /* hv: I'd bet WIN32 has the same effect here */ setmode(fd,O_BINARY); #endif Index: lib/font/fontfile/dirfile.c =================================================================== RCS file: /cvs/xorg/xc/lib/font/fontfile/dirfile.c,v retrieving revision 1.2 diff -u -r1.2 dirfile.c --- lib/font/fontfile/dirfile.c 23 Apr 2004 18:44:21 -0000 1.2 +++ lib/font/fontfile/dirfile.c 10 Nov 2004 11:27:56 -0000 @@ -73,11 +73,11 @@ #ifdef FONTDIRATTRIB /* Check for font directory attributes */ -#ifndef __UNIXOS2__ +#if !defined(__UNIXOS2__) && !defined(WIN32) if ((ptr = strchr(directory, ':'))) { #else - /* OS/2 path might start with a drive letter, don't clip this */ - if (ptr = strchr(directory+2, ':')) { + /* OS/2 and WIN32 path might start with a drive letter, don't clip this */ + if ((ptr = strchr(directory+2, ':'))) { #endif strncpy(dir_path, directory, ptr - directory); dir_path[ptr - directory] = '\0'; @@ -91,12 +91,19 @@ if (dir_file[strlen(dir_file) - 1] != '/') strcat(dir_file, "/"); strcat(dir_file, FontDirFile); - file = fopen(dir_file, "r"); + file = fopen(dir_file, "rt"); if (file) { Bool found_font = FALSE; - + +#ifndef WIN32 if (fstat (fileno(file), &statb) == -1) +#else + if (stat (dir_file, &statb) == -1) +#endif + { + fclose(file); return BadFontPath; + } count = fscanf(file, "%d\n", &i); if ((count == EOF) || (count != 1)) { fclose(file); @@ -113,7 +120,7 @@ MAXFONTFILENAMELEN-1, MAXFONTNAMELEN-1); while ((count = fscanf(file, format, file_name, font_name)) != EOF) { -#ifdef __UNIXOS2__ +#if defined(__UNIXOS2__) || defined(WIN32) /* strip any existing trailing CR */ for (i=0; i +#endif /* * Map FPE functions to renderer functions @@ -49,9 +52,9 @@ FontFileNameCheck (char *name) { #ifndef NCD -#ifdef __UNIXOS2__ +#if defined(__UNIXOS2__) || defined(WIN32) /* OS/2 uses D:/... as a path name for fonts, so accept this as a valid - * path if it starts with a letter and a colon + * path if it starts with a letter and a colon. Same applies for WIN32 */ if (isalpha(*name) && name[1]==':') return TRUE;