diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c index 4661b9daf..7f4bf5fa4 100644 --- a/glib/gbookmarkfile.c +++ b/glib/gbookmarkfile.c @@ -3528,6 +3528,9 @@ g_bookmark_file_move_item (GBookmarkFile *bookmark, if (new_uri && new_uri[0] != '\0') { + if (g_strcmp0 (old_uri, new_uri) == 0) + return TRUE; + if (g_bookmark_file_has_item (bookmark, new_uri)) { if (!g_bookmark_file_remove_item (bookmark, new_uri, error)) diff --git a/glib/tests/bookmarkfile.c b/glib/tests/bookmarkfile.c index c81561ea2..cc922c0fc 100644 --- a/glib/tests/bookmarkfile.c +++ b/glib/tests/bookmarkfile.c @@ -94,6 +94,13 @@ test_move_item (void) g_assert (res); g_assert_no_error (error); + res = g_bookmark_file_move_item (bookmark, + "file:///tmp/schedule.ps", + "file:///tmp/schedule.ps", + &error); + g_assert (res); + g_assert_no_error (error); + res = g_bookmark_file_move_item (bookmark, "file:///no-such-file.xbel", "file:///tmp/schedule.ps",