Bug 451893

Summary: uniquifyDocNames loops infinitely if one path is contained inside the other
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: David Redondo <kde>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: back.werner, betlogbetlog
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description David Redondo 2022-03-25 14:54:04 UTC
run kate /etc/xdg/kdeglobals ~/etc/xdg/kdeglobals, watch cpu spin at 100%
Comment 1 Christoph Cullmann 2022-03-25 17:00:59 UTC
Git commit b70a9653371057fd6bc50ecfefab1e31f16041c9 by Christoph Cullmann.
Committed on 25/03/2022 at 17:00.
Pushed by cullmann into branch 'master'.

fix wrap of search for slash

if we found slash at 0, we will again wrap over to end by 0 - 1
in the next round

this leads to endless looping for e.g.

kate /etc/xdg/kdeglobals ~/etc/xdg/kdeglobals

M  +2    -2    src/document/katedocument.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/b70a9653371057fd6bc50ecfefab1e31f16041c9
Comment 2 Waqar Ahmed 2023-01-16 11:12:32 UTC
*** Bug 464369 has been marked as a duplicate of this bug. ***
Comment 3 Waqar Ahmed 2023-02-16 13:48:51 UTC
*** Bug 465834 has been marked as a duplicate of this bug. ***