diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-08-19 01:57:44 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-08-19 01:57:44 +0000 |
commit | c898ddde9462591cc16c4d83f852fe73de844c4a (patch) | |
tree | 8347f616ba0ec78cf1e94897e9ba26bd3a251116 /gtk/fileset_dlg.c | |
parent | 8fe44356941d9446056d2a9a44de369d11427b00 (diff) |
Include <string.h> to declare "strrchr()".
Clean up indentation.
svn path=/trunk/; revision=15417
Diffstat (limited to 'gtk/fileset_dlg.c')
-rw-r--r-- | gtk/fileset_dlg.c | 34 |
1 files changed, 18 insertions, 16 deletions
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 <string.h> + #ifdef HAVE_IO_H #include <io.h> #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", |