diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-01-01 23:55:09 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-01-01 23:55:09 +0000 |
commit | 44a31f1ba6fac1a84029a0d9d5c40f7af8717cca (patch) | |
tree | cfd7c7a088cae819785eb064ef01af4a32ab5c25 | |
parent | 3cf40857512f998f4f2ae30ac56c29c2c9caf7f7 (diff) | |
download | netpbm-mirror-44a31f1ba6fac1a84029a0d9d5c40f7af8717cca.tar.gz netpbm-mirror-44a31f1ba6fac1a84029a0d9d5c40f7af8717cca.tar.xz netpbm-mirror-44a31f1ba6fac1a84029a0d9d5c40f7af8717cca.zip |
Don't fail if 'fontdir' file doesn't exist.
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@808 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/ppm/picttoppm.c | 21 | ||||
-rw-r--r-- | doc/HISTORY | 5 |
2 files changed, 23 insertions, 3 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); diff --git a/doc/HISTORY b/doc/HISTORY index 3a560145..538176d6 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -1,4 +1,4 @@ -ee http://netpbm.sourceforge.net/history.html for a general history of +See http://netpbm.sourceforge.net/history.html for a general history of Netpbm. CHANGE HISTORY @@ -6,6 +6,9 @@ CHANGE HISTORY not yet BJH Release 10.46.00 + picttoppm: Don't fail if 'fontdir' file doesn't exist. Bug + from 10.44. + ilbmtoppm: fix bug: appends color map PPM to output if input has color map; fails if input doesn't have color map. Broken in 10.18. |