Bug 477806

Summary: When overwriting a file in the archive, it can put the file in the wrong location resulting in 2 files.
Product: [Applications] ark Reporter: Jordan Adams <jordanplayz158again>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: REPORTED ---    
Severity: minor CC: aacid, rthomsen6
Priority: NOR    
Version First Reported In: 23.08.1   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jordan Adams 2023-11-30 23:06:35 UTC
SUMMARY
When you add a file to an archive (`.tar.zst` archive in this instance but specific type may not be relevant) with the same name as a file in the archive, I have an archive with a file under `etc/vzdump/pct.conf` and I extracted it, modified it and placed it back inside the archive in the same spot to overwrite it but this caused an issue in another application (https://forum.proxmox.com/threads/changing-the-config-for-an-lxc-backup.135967/#post-611512) as even though ark shows that there is only 1 file for `etc/vzdump/pct.conf`, in reality there is now 2, as seen by this output:
```
tar tf vzdump-lxc-115-2023_10_21-12_18_42.tar.zst | grep vzdump     
etc/vzdump/pct.conf
./etc/vzdump/pct.conf
./etc/vzdump/pct.fw
```
The GUI does not show this second file and the settings don't seem to have an option related to this. I assume this stems from a bug in Ark where it either does not know about the 2 files, it uses the first file it grabs and ignores the other occurrence(s) or it ignores files with `./` in the tar archive if one without './' is found. Grabs the first occurrence probably makes the most sense


STEPS TO REPRODUCE
1. Make a `.tar.zst` archive with a file using `tar -cf Archive.tar.zst ./example.txt`
2. Verify files in the archive
```
tar tf Archive.tar.zst                                         
./example.txt
```
3. Modify the file `example.txt`
4. Open the archive in Ark and drag the file into the archive, when it asks to overwrite, click overwrite
5. Verify the files in the archive again
```
tar tf Archive.tar.zst
example.txt
./example.txt
```

OBSERVED RESULT
There are 2 files, one with leading `./` and one without.

EXPECTED RESULT
There should be 1 file matching the leading `./` of the file it replaced.

SOFTWARE/OS VERSIONS 
Linux/KDE Plasma: Nobara Linux 38 (based on Fedora)
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION