if (debug) log_d("D check_path");
static int check_path(struct request *r){	char *p;	char c;	enum {		s_normal,		s_slash,		s_slashdot,		s_slashdotdot,		s_forbidden,	} s;	p = r->path;	s = s_normal;	do {		c = *p++;		switch (s) {		case s_normal:			if (c == '/')				s = s_slash;			break;		case s_slash:			if (c == '/')				s = s_forbidden;			else if (c == '.')				s = r->c->allow_dotfiles ? s_slashdot : s_forbidden;			else				s = s_normal;			break;		case s_slashdot:			if (c == 0 || c == '/')				s = s_forbidden;			else if (c == '.')				s = s_slashdotdot;			else				s = s_normal;			break;		case s_slashdotdot:			if (c == 0 || c == '/')				s = s_forbidden;			else				s = s_normal;			break;		case s_forbidden:			c = 0;			break;		}	} while (c);	return s == s_forbidden ? -1 : 0;}