Project

General

Profile

Bug #11800

Folder list in collect lib duplicates parent directories

Added by Hans-Peter Deifel over 1 year ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
Lighttable
Target version:
Start date:
11/01/2017
Due date:
% Done:

100%

Affected Version:
git master branch
System:
other GNU/Linux
bitness:
64-bit
hardware architecture:
amd64/x86

Description

The current git version (1c3fc1138f05b743ccc2) of the collection lib has two new bugs wrt. the folder tree:

1. If the database contains both /foo/a/b and /foo/a as folders, the latter is shown twice: Once without any children and once as a parent of the former. The problem seems to be an off-by-one error in the calculation of `common_length` in collect.c, that ignores the last component in the path.

2. Even if this is fixed, the presence of /foo/a/b, /foo/a and /foo/a-bar in the database again leads to duplication of /foo/a. In this case, the problem is that the reverse lexicographic order of those tree pathnames is [/foo/a/b, /foo/a-bar, /foo/a] and thus the O(n) algorithm that only remembers the last entry doesn't detect that /foo/a is already in the tree.

Associated revisions

Revision 78c93478
Added by Tobias Ellinghaus over 1 year ago

collect: Properly sort folders for tree view

Fixes #11800

History

#1 Updated by Tobias Ellinghaus over 1 year ago

  • Target version set to 2.4.0

#2 Updated by Tobias Ellinghaus over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

Also available in: Atom PDF