add: status=START_TO; foo=0;
context: char* parse_to(char* buffer, char *end, struct to_body *to_b){	struct to_param *param=0;	int status = START_TO;	int saved_status;	char  *tmp,*foo;	for( tmp=buffer; tmp<end; tmp++)	{		switch(*tmp)		{			case ' ':			case '\t':				switch (status)				{					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now =' '*/						status=saved_status;						break;					case URI_ENCLOSED:						to_b->uri.len = tmp - to_b->uri.s;						//*tmp = 0;						status = E_URI_ENCLOSED;						break;					case URI_OR_TOKEN:						foo = tmp;						status = MAYBE_URI_END;						break;				}				break;			case '\n':				switch (status)				{					case URI_OR_TOKEN:						foo = tmp;						status = MAYBE_URI_END;					case MAYBE_URI_END:					case DISPLAY_TOKEN:					case E_DISPLAY_QUOTED:					case END:						saved_status=status;						status=F_LF;						break;					case F_CR:						status=F_CRLF;						break;					case F_CRLF:					case F_LF:						status=saved_status;						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);				}				break;			case '\r':				switch (status)				{					case URI_OR_TOKEN:						foo = tmp;						status = MAYBE_URI_END;					case MAYBE_URI_END:					case DISPLAY_TOKEN:					case E_DISPLAY_QUOTED:					case END:						saved_status=status;						status=F_CR;						break;					case F_CRLF:					case F_CR:					case F_LF:						status=saved_status;						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			case '\\':				switch (status)				{					case DISPLAY_QUOTED:						switch (*(tmp+1))						{							case '\n':							case '\r':								break;							default:								tmp++;						}					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			case '<':				switch (status)				{					case START_TO:						to_b->body.s=tmp;						status = S_URI_ENCLOSED;						break;					case DISPLAY_QUOTED:						break;					case E_DISPLAY_QUOTED:					case URI_OR_TOKEN:					case DISPLAY_TOKEN: 					case MAYBE_URI_END:						status = S_URI_ENCLOSED;						break;					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now !=' '*/						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			case '>':				switch (status)				{					case DISPLAY_QUOTED:						break;					case URI_ENCLOSED:						//*tmp = 0;					case E_URI_ENCLOSED:						to_b->uri.len = tmp - to_b->uri.s;						status = END;						foo = 0;						break;					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now !=' '*/						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			case '"':				switch (status)				{					case START_TO:						to_b->body.s = tmp;						status = DISPLAY_QUOTED;						break;					case DISPLAY_QUOTED:						status = E_DISPLAY_QUOTED;						break;					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now !=' '*/						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			case ';' :				switch (status)				{					case DISPLAY_QUOTED:					case URI_ENCLOSED:						break;					case URI_OR_TOKEN:						foo = tmp;					case MAYBE_URI_END:						to_b->uri.len = foo - to_b->uri.s;					case END:						to_b->body.len = tmp-to_b->body.s;						tmp = parse_to_param(tmp,end,to_b,&saved_status);						//if (foo) *foo=0;						goto endofheader;					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now !=' '*/						goto endofheader;					default:						LOG( L_ERR , "ERROR: parse_to : unexpected char [%c] "						"in status %d .\n",*tmp,status);						goto error;				}				break;			default:				switch (status)				{					case START_TO:						to_b->uri.s = to_b->body.s = tmp;						status = URI_OR_TOKEN;;						break;					case S_URI_ENCLOSED:						to_b->uri.s=tmp;						status=URI_ENCLOSED;						break;					case MAYBE_URI_END:						status = DISPLAY_TOKEN;					case DISPLAY_QUOTED:					case DISPLAY_TOKEN:					case URI_ENCLOSED:					case URI_OR_TOKEN:						break;					case F_CRLF:					case F_LF:					case F_CR:						/*previous=crlf and now !=' '*/						goto endofheader;					default:						DBG("DEBUG:parse_to: spitting out [%c] in status %d\n",						*tmp,status );						goto error;				}		}/*char switch*/	}/*for*/endofheader:	DBG("DEBUG: status = %d \n",status);	status=saved_status;	DBG("end of header reached, state=%d\n", status);	/* check if error*/	switch(status){		case MAYBE_URI_END:			//*foo=0;			to_b->uri.len = foo - to_b->uri.s;		case END:			to_b->body.len = tmp - to_b->body.s;	case E_PARA_VALUE:			*(tmp-1)=0;			break;		default:			LOG(L_ERR, "ERROR: parse_to: invalid To -  unexpected "					"end of header in state %d\n", status);			goto error;	}	return tmp;error:	LOG(L_ERR, "to parse error\n");	to_b->error=PARSE_ERROR;	return tmp;}