[gtksourceview] FileSaver: fix a bug with g_file_equal()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] FileSaver: fix a bug with g_file_equal()
- Date: Fri, 1 Aug 2014 19:39:25 +0000 (UTC)
commit 17d9d7709f606b74882ab05e172d03bf6a87b7ff
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Aug 1 15:15:06 2014 +0200
FileSaver: fix a bug with g_file_equal()
g_file_equal() doesn't accept NULL parameters.
priv->location is never NULL, but prev_location can be NULL.
gtksourceview/gtksourcefilesaver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcefilesaver.c b/gtksourceview/gtksourcefilesaver.c
index c36933d..d5a65e2 100644
--- a/gtksourceview/gtksourcefilesaver.c
+++ b/gtksourceview/gtksourcefilesaver.c
@@ -929,7 +929,8 @@ check_externally_modified (GtkSourceFileSaver *saver)
* because the user has normally accepted to overwrite the file if it
* already exists.
*/
- save_as = !g_file_equal (prev_location, saver->priv->location);
+ save_as = (prev_location == NULL ||
+ !g_file_equal (prev_location, saver->priv->location));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]