about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
Diffstat (limited to 'converter')
-rw-r--r--converter/ppm/picttoppm.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c
index 6f34dae4..a89c3086 100644
--- a/converter/ppm/picttoppm.c
+++ b/converter/ppm/picttoppm.c
@@ -4056,6 +4056,23 @@ interpret_pict(FILE * const ofP) {
 
 
 
+static void
+loadDefaultFontDir(void) {
+/*----------------------------------------------------------------------------
+   Load the fonts from the font directory file "fontdir" (in the current
+   directory), if it exists.
+-----------------------------------------------------------------------------*/
+    struct stat statbuf;
+    int rc;
+
+    rc = stat("fontdir", &statbuf);
+    
+    if (rc == 0)
+        load_fontdir("fontdir");
+}
+
+
+
 int
 main(int argc, char * argv[]) {
     int argn;
@@ -4092,8 +4109,6 @@ main(int argc, char * argv[]) {
         ++argn;
     }
 
-    load_fontdir("fontdir");
-
     if (argn < argc) {
         ifp = pm_openr(argv[argn]);
         ++argn;
@@ -4103,6 +4118,8 @@ main(int argc, char * argv[]) {
     if (argn != argc)
         pm_usage(usage);
 
+    loadDefaultFontDir();
+
     if (header) {
         stage = "Reading 512 byte header";
         skip(512);