Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
libfm
libfm-1.2.3-Fix-SF937.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libfm-1.2.3-Fix-SF937.patch of Package libfm
From cc4782b9ae28c7aa77997662b4efa02c1cdebc44 Mon Sep 17 00:00:00 2001 From: Andriy Grytsenko <andrej@rep.kiev.ua> Date: Sat, 9 May 2015 16:27:32 +0300 Subject: [PATCH] [SF#937] Fix wrong treating files like ".purple" as having extension "purple". --- NEWS | 2 ++ src/gtk/fm-folder-model.c | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 822628b..a8ee441 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ * Returned back the workaround on thumbnailers which don't save any of Thumb::MTime or Thumb::URI in the thumbnail. +* Fixed wrong treating files like ".purple" as having extension "purple". + Changes on 1.2.3 since 1.2.2: diff --git a/src/gtk/fm-folder-model.c b/src/gtk/fm-folder-model.c index 14ea780..b97b0a7 100644 --- a/src/gtk/fm-folder-model.c +++ b/src/gtk/fm-folder-model.c @@ -2,7 +2,7 @@ * fm-folder-model.c * * Copyright 2009 - 2012 Hong Jen Yee (PCMan) <pcman.tw@gmail.com> - * Copyright 2012-2014 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua> + * Copyright 2012-2015 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -827,8 +827,11 @@ static void fm_folder_model_get_value(GtkTreeModel *tree_model, } case FM_FOLDER_MODEL_COL_EXT: { - const char *str = strrchr(fm_file_info_get_disp_name(info), '.'); - if (str) + const char *name = fm_file_info_get_disp_name(info); + const char *str = strrchr(name, '.'); + if (str == name) + str = NULL; + else if (str) str++; g_value_set_string(value, str); } @@ -999,6 +1002,7 @@ static gint fm_folder_model_compare(gconstpointer item1, FmFileInfo* file2 = ((FmFolderItem*)item2)->inf; const char* key1; const char* key2; + const char *name; goffset diff; int ret = 0; @@ -1082,8 +1086,14 @@ _main_sort: } break; case FM_FOLDER_MODEL_COL_EXT: - key1 = strrchr(fm_file_info_get_disp_name(file1), '.'); - key2 = strrchr(fm_file_info_get_disp_name(file2), '.'); + name = fm_file_info_get_disp_name(file1); + key1 = strrchr(name, '.'); + if (key1 == name) + key1 = NULL; + name = fm_file_info_get_disp_name(file2); + key2 = strrchr(name, '.'); + if (key2 == name) + key2 = NULL; ret = g_strcmp0(key1, key2); if (ret == 0) goto _sort_by_name; -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor