@@ -70,6 +70,9 @@ main(int argc, // I - Number of command-line args
7070 mime = mimeLoad (argv [i ], filter_path );
7171 testEnd (mime != NULL );
7272
73+ if (!mime )
74+ return (1 );
75+
7376 if (ppd )
7477 add_ppd_filters (mime , ppd );
7578 }
@@ -88,10 +91,21 @@ main(int argc, // I - Number of command-line args
8891 if (i < argc )
8992 {
9093 testBegin ("ppdOpenFile(\"%s\")" , argv [i ]);
91- ppd = ppdOpenFile (argv [i ]);
92- testEnd (ppd != NULL );
93-
94- if (mime )
94+ if ((ppd = ppdOpenFile (argv [i ])) != NULL )
95+ {
96+ testEnd (true);
97+ }
98+ else
99+ {
100+ ppd_status_t status ; // PPD error
101+ int linenum ;// Line number of error
102+
103+ status = ppdLastError (& linenum );
104+ testEndMessage (false, "%s on line %d" , ppdErrorString (status ), linenum );
105+ return (1 );
106+ }
107+
108+ if (mime && ppd )
95109 add_ppd_filters (mime , ppd );
96110 }
97111 }
@@ -102,6 +116,8 @@ main(int argc, // I - Number of command-line args
102116 testBegin ("mimeLoad(\"../conf\", \"%s\")" , filter_path );
103117 mime = mimeLoad ("../conf" , filter_path );
104118 testEnd (mime != NULL );
119+ if (!mime )
120+ return (1 );
105121 }
106122
107123 if (ppd )
@@ -146,6 +162,9 @@ main(int argc, // I - Number of command-line args
146162 mime = mimeLoad ("../conf" , filter_path );
147163 testEnd (mime != NULL );
148164
165+ if (!mime )
166+ return (1 );
167+
149168 if (ppd )
150169 add_ppd_filters (mime , ppd );
151170 }
0 commit comments