Bug 341479

Summary: Wrong file paths when having partially common paths (but not equal)
Product: [Applications] kompare Reporter: hardmooth
Component: parserAssignee: Kompare developers <kompare-devel>
Status: CONFIRMED ---    
Severity: normal CC: gszymaszek, hardmooth
Priority: NOR    
Version: 4.1.1   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Folder structure reproducing the error

Description hardmooth 2014-12-02 08:09:11 UTC
Kompare sometimes parses file paths incorrectly.
This happens if two files have partially common paths, like:
> common/path_A/sub_folder/file.ext
> common/sub_folder/file.ext
Kompare will then place both files into
> common/path_A/sub_folder/file.ext
A diff file as minimal non-working example can be found below.

==START_OF_DIFF_FILE==
diff --git a/common/path_A/sub_folder/file.ext b/common/path_A/sub_folder/file.ext
index f01e304..20f7773 100644
--- a/common/path_A/sub_folder/file.ext
+++ b/common/path_A/sub_folder/file.ext
@@ -1,6 +1,10 @@
-something left
+something right
 
 if(ORACLE_FOUND)
 
diff --git a/common/sub_folder/file.ext b/common/sub_folder/file.ext
index 6e32be5..9559da0 100644
--- a/common/sub_folder/file.ext
+++ b/common/sub_folder/file.ext
@@ -1,23 +1,27 @@
 # vim: ts=4:sw=4:cindent:expandtab
 
-something different left
+something different right
==END_OF_DIFF_FILE==

Reproducible: Always

Steps to Reproduce:
1. either open diff file from bash or compare two directories (as decribed in "Details)


Actual Results:  
Kompare will place both files 'file.ext' into 
> common/path_A/sub_folder/file.ext
and none into 
> common/sub_folder/file.ext


Expected Results:  
The two files should be (one each) in 
> common/path_A/sub_folder/file.ext
> common/sub_folder/file.ext
Comment 1 hardmooth 2014-12-03 08:34:43 UTC
Created attachment 89821 [details]
Folder structure reproducing the error

As a side notice:
The same error can be produced directly comparing two directories in the above described structure (see compressed folder)