86e4ff351c
restores the check_space() function with small modifications to make it work with the current code. The patch was slightly modified by Bill Fenner to handle error messages better. Reviewed by: fenner