1.1 --- a/tumble_input.c Tue Mar 25 09:36:56 2003 +0000 1.2 +++ b/tumble_input.c Tue Mar 25 09:38:08 2003 +0000 1.3 @@ -2,7 +2,7 @@ 1.4 * tumble: build a PDF file from image files 1.5 * 1.6 * Input handler dispatch 1.7 - * $Id: tumble_input.c,v 1.3 2003/03/20 06:55:27 eric Exp $ 1.8 + * $Id: tumble_input.c,v 1.4 2003/03/25 01:38:08 eric Exp $ 1.9 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com> 1.10 * 1.11 * This program is free software; you can redistribute it and/or modify 1.12 @@ -110,9 +110,13 @@ 1.13 1.14 bool close_input_file (void) 1.15 { 1.16 - bool result; 1.17 + bool result = 1; 1.18 1.19 - result = current_input_handler->close_input_file (); 1.20 + if (current_input_handler) 1.21 + { 1.22 + result = current_input_handler->close_input_file (); 1.23 + current_input_handler = NULL; 1.24 + } 1.25 if (in_filename) 1.26 free (in_filename); 1.27 if (in) 1.28 @@ -127,6 +131,8 @@ 1.29 1.30 bool last_input_page (void) 1.31 { 1.32 + if (! current_input_handler) 1.33 + return (0); 1.34 return (current_input_handler->last_input_page ()); 1.35 } 1.36 1.37 @@ -135,6 +141,8 @@ 1.38 input_attributes_t input_attributes, 1.39 image_info_t *image_info) 1.40 { 1.41 + if (! current_input_handler) 1.42 + return (0); 1.43 return (current_input_handler->get_image_info (image, 1.44 input_attributes, 1.45 image_info)); 1.46 @@ -145,6 +153,8 @@ 1.47 image_info_t *image_info, 1.48 pdf_page_handle page) 1.49 { 1.50 + if (! current_input_handler) 1.51 + return (0); 1.52 return (current_input_handler->process_image (image, 1.53 input_attributes, 1.54 image_info,