- add hyperlinks to the path components in the ``Index of /foo/bar/baz'' line, (except for the part representing current directory) if going there is allowed (i.e hyperlinks for ``/'', ``foo/'' and ``bar/'' but not for ``baz'') This also supports the case when the root ("/") is readable. - avoid adding a ``Go to parent directory'' line if target == current dir (i.e. if current dir == '/') Right now giving empty string for the dir in /magic/webls?dir= gives a directory of ``.''. One _might_ consider adding at the start of :/^dols if(strcmp(dir, "") ==0) dir = "/"; (i.e. before the ``cleanname(dir);'' statement) to normalize on "/" as the root. Axel. Reference: /n/sources/patch/applied/httpd-webls-clickable-path Date: Fri Jun 24 15:56:26 CES 2005 --- /sys/src/cmd/ip/httpd/webls.c Fri Jun 24 15:41:56 2005 +++ /sys/src/cmd/ip/httpd/webls.c Fri Jun 24 15:41:54 2005 @@ -197,11 +197,11 @@ dols(char *dir) { Dir *d; - char *f, *p; + char *f, *p,*nm; long i, n; int fd; - cleanname(dir); + cleanname(dir); // expands "" to "."; ``dir+1'' access below depends on that if (!allowed(dir)) { error("Permission denied", "
Cannot list directory %s: Access prohibited
", dir); return; @@ -220,7 +220,19 @@ hprint(hout, "\n"); hprint(hout, "