Description: Remove backup files
 Dia normally saves a copy of an old saved file if it is overwritten via the
 "File Save" function. This clutters the directory. Since the common behaviour
 of programs is to not save backups in a separate location (also for security
 reasons), this patch removes this feature and therefore removes backup files
 when dia is sure to have the newly written file in the correct location.
Author: Roland Stigge <stigge@antcom.de>
Bug-Debian: http://bugs.debian.org/173650

Index: dia-0.97.3+git20160930/app/load_save.c
===================================================================
--- dia-0.97.3+git20160930.orig/app/load_save.c
+++ dia-0.97.3+git20160930/app/load_save.c
@@ -1137,6 +1137,8 @@ diagram_data_save(DiagramData *data, Dia
 				       dia_message_filename(tmpname),
 				       dia_context_get_filename(ctx));
   }
+  else /* remove backup file if new file is in place */
+    g_unlink(bakname);
 CLEANUP:
   if (filename != user_filename)
     g_free(filename);
