From 2a4f206f5fed13a22f600897a188d8415c400834 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Thu, 2 Mar 2000 01:11:17 +0000 Subject: [PATCH] if compiled for MacOS - use the Mac path separator to get the base file name - don't append .ttf if no dot in the file name (plus small typo fix and error message enhancement) --- demos/src/ftlint.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/demos/src/ftlint.c b/demos/src/ftlint.c index 0dc39263e..3a5ff0e97 100644 --- a/demos/src/ftlint.c +++ b/demos/src/ftlint.c @@ -97,17 +97,22 @@ strncpy( filename, fname, 128 ); strncpy( alt_filename, fname, 128 ); +#ifndef macintosh if ( i >= 0 ) { strncpy( filename + strlen( filename ), ".ttf", 4 ); strncpy( alt_filename + strlen( alt_filename ), ".ttc", 4 ); } - +#endif i = strlen( filename ); fname = filename; while ( i >= 0 ) +#ifndef macintosh if ( filename[i] == '/' || filename[i] == '\\' ) +#else + if ( filename[i] == ':' ) +#endif { fname = filename + i + 1; i = -1; @@ -122,9 +127,9 @@ if (error) { if (error == FT_Err_Invalid_File_Format) - printf( "unknow format\n" ); + printf( "unknown format\n" ); else - printf( "could not find/open file\n" ); + printf( "could not find/open file (error: %d)\n", error ); continue; } if (error) Panic( "Could not open file" );