diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-08-12 08:28:26 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-08-12 08:28:26 +0000 |
commit | 8e2e27a15cdde8b558f96b511bdd0207e721b374 (patch) | |
tree | 5475300e72f41035a7108042cb0fb388a9e1ea82 /src | |
parent | 08eb3603f006c60abc9b8c9cd8ee67e6369d4f6f (diff) |
don't overwrite existing file.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2213 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/export.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/export.c b/src/export.c index 8e608ff4..0e91e552 100644 --- a/src/export.c +++ b/src/export.c @@ -275,6 +275,13 @@ static gint export_eml(FolderItem *src, const gchar *path, gint type) } dest = g_strdup_printf("%s%c%d%s", path, G_DIR_SEPARATOR, count, ext); + if (g_file_test(dest, G_FILE_TEST_EXISTS)) { + g_warning("export_eml(): %s already exists.", dest); + g_free(dest); + g_free(file); + ok = -1; + break; + } if (copy_file(file, dest, FALSE) < 0) { g_free(dest); g_free(file); |