Project

General

Profile

Actions

Bug #3109

closed

mod_dirlisting javascript sort of ".." entries is broken

Added by otovalek almost 3 years ago. Updated almost 3 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_dirlisting
Target version:
ASK QUESTIONS IN Forums:
No

Description

At https://git.lighttpd.net/lighttpd/lighttpd1.4/src/branch/master/src/mod_dirlisting.c#L706 the parent directory entry ("..") is handled specifically, in order to be first in the list:

if (sort_column == name_column) {
  if (at == '..') return -1;
  if (bt == '..') return  1;
}

However, the "at" or "bt" variable actually has value of "../", as generated at https://git.lighttpd.net/lighttpd/lighttpd1.4/src/branch/master/src/mod_dirlisting.c#L914 , the <td>'s inner text has / at the end.

The comparison is therefore always false and has no effect.

As a result, e.g. "!Directory" or "$Directory" is sorted before "..".

Can be fixed as follows:

if (sort_column == name_column) {
  if (at == '../') return -1;
  if (bt == '../') return  1;
}
Actions #1

Updated by gstrauss almost 3 years ago

  • Status changed from New to Patch Pending

Thank you. I'll commit a fix soon.

Actions #2

Updated by gstrauss almost 3 years ago

  • Target version changed from 1.4.xx to 1.4.61
Actions #3

Updated by gstrauss almost 3 years ago

  • Status changed from Patch Pending to Fixed
Actions

Also available in: Atom