Bug 457269 - Common prefix finder does not exclude special characters
Summary: Common prefix finder does not exclude special characters
Status: REPORTED
Alias: None
Product: ark
Classification: Applications
Component: general (other bugs)
Version First Reported In: 22.04.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-29 12:48 UTC by Frederick Yin
Modified: 2022-07-29 12:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederick Yin 2022-07-29 12:48:39 UTC
SUMMARY
When creating an archive of several files, ark will try to find a common prefix of all filenames. If the prefix is at least 5 characters long, the archive will be named "<prefix>.tar.gz" or "<prefix>.zip" by default. However, if the prefix already ends with a dot, the archive will be something like "files..tar.gz" with two dots. The same goes for '_', '-', and perhaps many other special characters.

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"

OBSERVED RESULT
context menu gives "abcde..tar.gz" and "abcde..zip" (two dots)

EXPECTED RESULT
sensible filenames like "abcde.tar.gz"

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
I commented this under #451203 (https://bugs.kde.org/show_bug.cgi?id=451203#c3), but felt it was off-topic so I went here to file a separate bug entry.

I am writing a patch right now.
Comment 1 Frederick Yin 2022-07-29 12:57:45 UTC
Sorry, just noticed !120 (https://invent.kde.org/utilities/ark/-/merge_requests/120) on invent that says basically the same thing.