mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 04:45:48 +01:00
Merge branch 'backport-456-bookmarkfile-crash-glib-2-58' into 'glib-2-58'
bookmarkfile: Don't move an item if the uri has not changed (backport to glib-2-58) See merge request GNOME/glib!457
This commit is contained in:
commit
6f5df32e72
@ -3584,6 +3584,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))
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user