int fd, rv, first;
int fd, first;
static int get_path_info(struct request *r){	char *p, *pa, *end, *cp, *start, *cds;	int fd, rv, first;	size_t m;	m = r->location_length;	if (m == 0)		return -1;	p = r->path_translated;	start = p + m;	end = p + strlen(p);	pa = r->path_args;	*pa = 0;	cp = end;	first = 0;	while (cp >= start && cp[-1] == '/')		--cp;	while (cp >= start) {		if (cp != end)			*cp = 0;		fd = open(p, O_RDONLY | O_NONBLOCK);		if (fd != -1) {			if (assign_rfd(r, fd) == -1) {				close(fd);				return -1;			}		} 		if (debug) 			log_d("get_path_info: open(\"%s\") = %d", p, fd);		if (fd != -1) {			if (r->curdir[0] == 0) {				first = 1;				strcpy(r->curdir, p);			}		}		if (cp != end)			*cp = '/';		if (fd != -1) {			strcpy(pa, cp);			if (S_ISDIR(r->finfo.st_mode))				*cp++ = '/';			else if (first) {				cds = strrchr(r->curdir, '/');				if (cds)					*cds = 0;			}			*cp = 0;			return 0;		} else if (r->c->path_info_ok == 0)			return -1;		while (--cp >= start && *cp != '/')			;	}	return -1;}