From c898ddde9462591cc16c4d83f852fe73de844c4a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 19 Aug 2005 01:57:44 +0000 Subject: Include to declare "strrchr()". Clean up indentation. svn path=/trunk/; revision=15417 --- gtk/fileset_dlg.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'gtk/fileset_dlg.c') diff --git a/gtk/fileset_dlg.c b/gtk/fileset_dlg.c index 5fde8a94fe..ef3910d3a4 100644 --- a/gtk/fileset_dlg.c +++ b/gtk/fileset_dlg.c @@ -26,6 +26,8 @@ # include "config.h" #endif +#include + #ifdef HAVE_IO_H #include #endif @@ -140,23 +142,23 @@ fileset_dlg_name2date_dup(const char * name) { /* just to be sure ... */ - g_assert(fileset_filename_match_pattern(name)); + g_assert(fileset_filename_match_pattern(name)); - /* find char position behind the last underscore */ + /* find char position behind the last underscore */ pfx = strrchr(name, '_'); - pfx++; - pos = pfx - name; - - /* start conversion behind that underscore */ - filename = g_strdup_printf("%c%c%c%c.%c%c.%c%c %c%c:%c%c:%c%c", - /* year */ name[pos] , name[pos+1], name[pos+2], name[pos+3], - /* month */ name[pos+4], name[pos+5], - /* day */ name[pos+6], name[pos+7], - /* hour */ name[pos+8], name[pos+9], - /* min */ name[pos+10], name[pos+11], - /* second */ name[pos+12], name[pos+13]); - - return filename; + pfx++; + pos = pfx - name; + + /* start conversion behind that underscore */ + filename = g_strdup_printf("%c%c%c%c.%c%c.%c%c %c%c:%c%c:%c%c", + /* year */ name[pos] , name[pos+1], name[pos+2], name[pos+3], + /* month */ name[pos+4], name[pos+5], + /* day */ name[pos+6], name[pos+7], + /* hour */ name[pos+8], name[pos+9], + /* min */ name[pos+10], name[pos+11], + /* second */ name[pos+12], name[pos+13]); + + return filename; } @@ -180,7 +182,7 @@ fileset_dlg_add_file(fileset_entry *entry) { created = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u", local->tm_year+1900, local->tm_mon+1, local->tm_mday, local->tm_hour, local->tm_min, local->tm_sec);*/ - created = fileset_dlg_name2date_dup(entry->name); + created = fileset_dlg_name2date_dup(entry->name); local = localtime(&entry->mtime); modified = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u", -- cgit v1.2.3