Index: handler_dirlist.c =================================================================== --- handler_dirlist.c (revision 1851) +++ handler_dirlist.c (working copy) @@ -858,8 +858,18 @@ /* File */ VTMP_SUBSTITUTE_TOKEN ("%file_name%", name); - VTMP_SUBSTITUTE_TOKEN ("%file_link%", name); + if (is_dir) { + size_t len = strlen(name); + char *dir = (char *) malloc((len + 2) * sizeof(char)); + strncpy(dir, name, len); + dir[len] = '/'; + dir[len+1] = '\0'; + VTMP_SUBSTITUTE_TOKEN ("%file_link%", dir); + free(dir); + } else + VTMP_SUBSTITUTE_TOKEN ("%file_link%", name); + /* Date */ if (props->show_date) {