diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-09-22 11:18:22 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-09-22 11:18:22 +0000 |
commit | e804cac393c2dd84a8c570541fec5d6f7245d945 (patch) | |
tree | a0480475e799431680bfac040b30d30a0b41aeac /libsylph/utils.c | |
parent | 39a1d4cf0bd2ae39c2300b12f9c826514acd560e (diff) |
implemented 'Save all'.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@601 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/utils.c')
-rw-r--r-- | libsylph/utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libsylph/utils.c b/libsylph/utils.c index 5c0ba893..7164ed5c 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -1045,6 +1045,25 @@ void subst_for_filename(gchar *str) subst_chars(str, " \t\r\n\"'/\\", '_'); } +gchar *get_alt_filename(const gchar *filename, gint count) +{ + const gchar *ext; + gchar *alt_filename; + + ext = strrchr(filename, '.'); + + if (ext) { + gchar *base; + + base = g_strndup(filename, ext - filename); + alt_filename = g_strdup_printf("%s-%d%s", base, count, ext); + g_free(base); + } else + alt_filename = g_strdup_printf("%s-%d", filename, count); + + return alt_filename; +} + gboolean is_header_line(const gchar *str) { if (str[0] == ':') return FALSE; |