Commit 2a4f206f5fed13a22f600897a188d8415c400834

Just van Rossum 2000-03-02T01:11:17

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)

diff --git a/demos/src/ftlint.c b/demos/src/ftlint.c
index 0dc3926..3a5ff0e 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" );