[glib] Only mark regular files as backup files
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [glib] Only mark regular files as backup files
- Date: Wed, 8 Apr 2009 03:13:36 -0400 (EDT)
commit d0cf7b38780b0832fc904f75eb387aa61eb2f76e
Author: Alexander Larsson <alexl redhat com>
Date: Wed Apr 8 09:12:02 2009 +0200
Only mark regular files as backup files
Apps don't generally create backup directories, etc. So, if the file
ends with ~ but is not a regular file shouldn't be considered a backup
file. (#573673)
---
gio/glocalfileinfo.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index f23b16c..b78b816 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -1500,7 +1500,8 @@ _g_local_file_info_get (const char *basename,
if (basename != NULL && basename[0] == '.')
g_file_info_set_is_hidden (info, TRUE);
- if (basename != NULL && basename[strlen (basename) -1] == '~')
+ if (basename != NULL && basename[strlen (basename) -1] == '~' &&
+ S_ISREG (statbuf.st_mode))
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP, TRUE);
#else
if (dos_attributes & FILE_ATTRIBUTE_HIDDEN)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]