if (debug) log_d("get_path_info: stat(\"%s\") = %d", p, rv);
static int get_path_info(struct request *r){	char *p, *pa, *end, *cp, *start;	struct stat *s;	int rv;	size_t m;	m = r->location_length;	if (m == 0)		return -1;	s = &r->finfo;	p = r->path_translated;	start = p + m;	end = p + strlen(p);	pa = r->path_args;	*pa = 0;	cp = end;	while (cp >= start && cp[-1] == '/')		--cp;	while (cp >= start) {		if (cp != end)			*cp = 0;		rv = stat(p, s);		if (debug)			log_d("get_path_info: stat(\"%s\") = %d", p, rv);		if (cp != end)			*cp = '/';		if (rv != -1) {			strcpy(pa, cp);			if (S_ISDIR(s->st_mode))				*cp++ = '/';			*cp = 0;			return 0;		}		while (--cp >= start && *cp != '/')			;	}	return -1;}