https://bugs.kde.org/show_bug.cgi?id=451203

--- Comment #4 from Méven Car <meve...@gmail.com> ---
(In reply to Frederick Yin from comment #3)
> So I was compressing some files today, and I noticed something I thought was
> a bug but is actually related to this thread.
> 
> Versions: Ark 22.04.3, Dolphin 22.04.3, Plasma 5.25.3, KF 5.96.0, Qt 5.15.5
> on Arch Linux, kernel 5.18.14
> 
> Steps to reproduce:
> 1. Create two files named "abcde.c" and "abcde.h" in dolphin
> 2. Select both, then right click
> 3. Hover on "Compress"
> Expected behavior: context menu provides sensible filenames like
> "abcde.tar.gz"
> Observed behavior: the filenames are "abcde..tar.gz" and "abcde..zip" (two
> dots)

Prefer reporting another bug next time ;-) This is a completely different
issue.
Bugs report are not conversations, they aim to gather information to resolve
the bug, or discuss the resolution.
> 
> I read the source code and it should be related to the algorithm to find
> common prefixes
> (https://invent.kde.org/utilities/ark/-/blob/master/kerfuffle/addtoarchive.
> cpp#L205). If the last common character is '.', it will precede another '.'
> and make the filename appear weird to anyone who hasn't seen the code. I
> think we should fix it as a special case.
> 
> If it sounds good to you I'll begin writing a patch soon.

You got it right, patch welcome.
I would special case, this line to avoid appending '.' when base already ends
with '.' :
https://invent.kde.org/utilities/ark/-/blob/master/kerfuffle/addtoarchive.cpp#L254

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to