rem: image->format->x_dec <=3 && image->info->unit == INCH) {
add: image->format->x_dec <=3 && unit == INCH) {
context: drill_guess_format(gerb_file_t *fd, gerb_image_t *image){    int inch_score = 0;    int metric_score = 0;    int length, max_length = 0;    int leading_zeros, max_leading_zeros = 0;    int trailing_zeros, max_trailing_zeros = 0;    int read;    drill_state_t *state = NULL;    int done = FALSE;    int i;    state = new_state(state);    if (state == NULL)	GERB_FATAL_ERROR("malloc state failed\n");    image->format = (gerb_format_t *)malloc(sizeof(gerb_format_t));    if (image->format == NULL) 	GERB_FATAL_ERROR("malloc format failed\n");    memset((void *)image->format, 0, sizeof(gerb_format_t));    /* This is just a special case of the normal parser */    while ((read = gerb_fgetc(fd)) != EOF && !done) {	switch ((char)read) {	case ';' :	case 'F' :	case 'G':	case 'S':	case 'T':	    eat_line(fd);	    break;	case 'M':	    switch(drill_parse_M_code(fd, image)) {	    case DRILL_M_METRIC :		metric_score += 10;		break;	    case DRILL_M_IMPERIAL :		inch_score += 10;		break;	    case DRILL_M_END :		done = TRUE;	    default:		break;	    }	    break;	case 'X':	case 'Y':	    /* How many leading zeros? */	    length = 0;	    leading_zeros = 0;	    trailing_zeros = 0;	    {		/* This state machine is a bit ugly, so it'll probably		   have to be rewritten sometime */		int local_state = 0;		while ((read = gerb_fgetc(fd)) != EOF &&		       (isdigit(read) || read == ',' || read == '.')) {		    if(read != ',' && read != '.') length ++;		    switch (local_state) {		    case 0:			if(read == '0') {			    leading_zeros++;			} else {			    local_state++;			}			break;		    case 1:			if(read =='0') {			    trailing_zeros++;			}		    }		}	    }	    max_length = max(max_length, length);	    max_leading_zeros = max(max_leading_zeros, leading_zeros);	    max_trailing_zeros = max(max_trailing_zeros, trailing_zeros);	    break;	case '%':	    state->curr_section = DRILL_HEADER;	    break;	case 10 :   /* White space */	case 13 :	case ' ' :	case '\t' :	default:	    break;	}    }    /* Unfortunately, inches seem more common, so that's the default */    if(metric_score > inch_score) {	image->info->unit = MM;    } else {	image->info->unit = INCH;    }    /* Knowing about trailing zero suppression is more important,       so it takes precedence here. */    if (max_trailing_zeros == 0) {	/* No trailing zero anywhere. It's probable they're suppressed */	image->format->omit_zeros = TRAILING;    } else if(max_leading_zeros == 0) {	/* No leading zero anywhere. It's probable they're suppressed */	image->format->omit_zeros = LEADING;    } else if (max_trailing_zeros >= max_leading_zeros ) {	image->format->omit_zeros = TRAILING;    } else { 	image->format->omit_zeros = LEADING;    }    /* Almost every file seems to use 2.x format (where x is 3-4) */    image->format->x_dec = max_length - 2;    image->format->y_dec = max_length - 2;    /* A bit of a kludge (Or maybe wild ass guess would be more correct.       It seems to work, though.) It tries to cover all cases I've       found where the format has to be adjusted from the above       calculation. */    if( (image->format->omit_zeros == LEADING ||	 (max_leading_zeros == 0 && max_trailing_zeros == 0) ) &&	image->format->x_dec <=3 && image->info->unit == INCH) {	image->format->x_dec += 1;	image->format->y_dec += 1;    }    /* Restore the necessary things back to their default state */    for (i = 0; i < APERTURE_MAX; i++) {	if (image->aperture[i] != NULL) {	    free(image->aperture[i]);	    image->aperture[i] = NULL;	}    }    fd->ptr = 0;}