mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Fix Windows theme imports with uppercase .TAR.GZ/etc (case-insensitive archive check)
This commit is contained in:
@@ -474,20 +474,26 @@ typedef enum
|
|||||||
static ZoiteChatGtk3ArchiveType
|
static ZoiteChatGtk3ArchiveType
|
||||||
zoitechat_detect_gtk3_archive_type (const char *archive_path)
|
zoitechat_detect_gtk3_archive_type (const char *archive_path)
|
||||||
{
|
{
|
||||||
|
char *archive_path_lower;
|
||||||
|
ZoiteChatGtk3ArchiveType type = ZOITECHAT_GTK3_ARCHIVE_UNKNOWN;
|
||||||
|
|
||||||
if (!archive_path)
|
if (!archive_path)
|
||||||
return ZOITECHAT_GTK3_ARCHIVE_UNKNOWN;
|
return ZOITECHAT_GTK3_ARCHIVE_UNKNOWN;
|
||||||
|
|
||||||
if (g_str_has_suffix (archive_path, ".zip") || g_str_has_suffix (archive_path, ".ZIP"))
|
archive_path_lower = g_ascii_strdown (archive_path, -1);
|
||||||
return ZOITECHAT_GTK3_ARCHIVE_ZIP;
|
|
||||||
|
|
||||||
if (g_str_has_suffix (archive_path, ".tar")
|
if (g_str_has_suffix (archive_path_lower, ".zip"))
|
||||||
|| g_str_has_suffix (archive_path, ".tar.gz")
|
type = ZOITECHAT_GTK3_ARCHIVE_ZIP;
|
||||||
|| g_str_has_suffix (archive_path, ".tgz")
|
else if (g_str_has_suffix (archive_path_lower, ".tar")
|
||||||
|| g_str_has_suffix (archive_path, ".tar.xz")
|
|| g_str_has_suffix (archive_path_lower, ".tar.gz")
|
||||||
|| g_str_has_suffix (archive_path, ".txz"))
|
|| g_str_has_suffix (archive_path_lower, ".tgz")
|
||||||
return ZOITECHAT_GTK3_ARCHIVE_TAR;
|
|| g_str_has_suffix (archive_path_lower, ".tar.xz")
|
||||||
|
|| g_str_has_suffix (archive_path_lower, ".txz"))
|
||||||
|
type = ZOITECHAT_GTK3_ARCHIVE_TAR;
|
||||||
|
|
||||||
return ZOITECHAT_GTK3_ARCHIVE_UNKNOWN;
|
g_free (archive_path_lower);
|
||||||
|
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user