assert(pch_char(new) == ' ');
if (pch_char(new) != ' ') fatal("Internal error: expected ' '\n");
apply_hunk(LINENUM where){	LINENUM		old = 1;	const LINENUM	lastline = pch_ptrn_lines();	LINENUM		new = lastline + 1;#define OUTSIDE 0#define IN_IFNDEF 1#define IN_IFDEF 2#define IN_ELSE 3	int		def_state = OUTSIDE;	const LINENUM	pat_end = pch_end();	where--;	while (pch_char(new) == '=' || pch_char(new) == '\n')		new++;	while (old <= lastline) {		if (pch_char(old) == '-') {			copy_till(where + old - 1);			if (do_defines) {				if (def_state == OUTSIDE) {					fputs(not_defined, ofp);					def_state = IN_IFNDEF;				} else if (def_state == IN_IFDEF) {					fputs(else_defined, ofp);					def_state = IN_ELSE;				}				fputs(pfetch(old), ofp);			}			last_frozen_line++;			old++;		} else if (new > pat_end) {			break;		} else if (pch_char(new) == '+') {			copy_till(where + old - 1);			if (do_defines) {				if (def_state == IN_IFNDEF) {					fputs(else_defined, ofp);					def_state = IN_ELSE;				} else if (def_state == OUTSIDE) {					fputs(if_defined, ofp);					def_state = IN_IFDEF;				}			}			fputs(pfetch(new), ofp);			new++;		} else if (pch_char(new) != pch_char(old)) {			say("Out-of-sync patch, lines %ld,%ld--mangled text or line numbers, maybe?\n",			    pch_hunk_beg() + old,			    pch_hunk_beg() + new);#ifdef DEBUGGING			say("oldchar = '%c', newchar = '%c'\n",			    pch_char(old), pch_char(new));#endif			my_exit(2);		} else if (pch_char(new) == '!') {			copy_till(where + old - 1);			if (do_defines) {				fputs(not_defined, ofp);				def_state = IN_IFNDEF;			}			while (pch_char(old) == '!') {				if (do_defines) {					fputs(pfetch(old), ofp);				}				last_frozen_line++;				old++;			}			if (do_defines) {				fputs(else_defined, ofp);				def_state = IN_ELSE;			}			while (pch_char(new) == '!') {				fputs(pfetch(new), ofp);				new++;			}		} else {			assert(pch_char(new) == ' ');			old++;			new++;			if (do_defines && def_state != OUTSIDE) {				fputs(end_defined, ofp);				def_state = OUTSIDE;			}		}	}	if (new <= pat_end && pch_char(new) == '+') {		copy_till(where + old - 1);		if (do_defines) {			if (def_state == OUTSIDE) {				fputs(if_defined, ofp);				def_state = IN_IFDEF;			} else if (def_state == IN_IFNDEF) {				fputs(else_defined, ofp);				def_state = IN_ELSE;			}		}		while (new <= pat_end && pch_char(new) == '+') {			fputs(pfetch(new), ofp);			new++;		}	}	if (do_defines && def_state != OUTSIDE) {		fputs(end_defined, ofp);	}}