X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fttf2pt1%2Fttf2pt1.c;h=0b03b2363995b45179e61faf9c514f6608355dd7;hb=359c111aa91dbbe9245a1bba2413692c63afdf73;hp=7a916abb2b58c10674b98f11f68dae2731ed0e84;hpb=50760be540fa6802296d7cb6eafa4d4b82a47a3b;p=swftools.git diff --git a/pdf2swf/ttf2pt1/ttf2pt1.c b/pdf2swf/ttf2pt1/ttf2pt1.c index 7a916ab..0b03b23 100644 --- a/pdf2swf/ttf2pt1/ttf2pt1.c +++ b/pdf2swf/ttf2pt1/ttf2pt1.c @@ -65,6 +65,8 @@ #include #include +#include "../../config.h" + #ifdef _GNU_SOURCE #include #endif @@ -106,6 +108,12 @@ struct frontsw *frontswtab[] = { NULL /* end of table */ }; +#ifdef WIN32 +#define NOPIPES +#else +#undef NOPIPES +#endif + struct frontsw *cursw=0; /* the active front end */ char *front_arg=""; /* optional argument */ @@ -605,7 +613,7 @@ unicode_init_user( } /* now read in the encoding description file, if requested */ - if ((unicode_map_file = fopen(path, "r")) == NULL) { + if ((unicode_map_file = fopen(path, "rb")) == NULL) { fprintf(stderr, "**** Cannot access map file '%s' ****\n", path); exit(1); } @@ -1707,7 +1715,7 @@ ttf2pt1_main( /* save the command line for the record * (we don't bother about escaping the shell special characters) */ - + j = 0; for(i=1; inglyphs(); @@ -2527,7 +2534,7 @@ ttf2pt1_main( cursw->close(); -#ifndef WIN32 +#ifndef NOPIPES while (wait(&ws) > 0) { } #else @@ -2536,8 +2543,7 @@ ttf2pt1_main( snprintf(filename, sizeof filename, "%s.%s", argv[2], pfbflag ? "pfb" : "pfa" ); - if ((ofp = fopen(filename, "w+b")) == NULL) { - fprintf(stderr, "**** Cannot create %s ****\n", filename); + if ((ofp = fopen(filename, "wb+")) == NULL) { exit(1); } else { WARNING_2 fprintf(stderr, "Creating file %s\n", filename); @@ -2546,7 +2552,6 @@ ttf2pt1_main( snprintf(filename, sizeof filename, "%s.t1a", argv[2]); if ((ifp = fopen(filename, "rb")) == NULL) { - fprintf(stderr, "**** Cannot read %s ****\n", filename); exit(1); } else { WARNING_2 fprintf(stderr, "Converting file %s\n", filename); @@ -2558,7 +2563,7 @@ ttf2pt1_main( if(unlink(filename) < 0) WARNING_1 fprintf(stderr, "Unable to remove file %s\n", filename); } -#endif /* WIN32 */ +#endif /* NOPIPES */ fclose(null_file); return 0;