summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2023-03-17 12:44:51 +0100
committerOndrej Holy <oholy@redhat.com>2023-03-29 13:43:10 +0000
commit11c25a37db29177f4d1cd696b3b4ddd72f9fed4d (patch)
treec0f4bfb3903150babe047155a872f3484b817ee1
parent06a838b0fb98b494f41333d423d297afead4079a (diff)
downloadnautilus-11c25a37db29177f4d1cd696b3b4ddd72f9fed4d.tar.gz
pathbar: Initialize drag action
The `‘action’ may be used uninitialized` warning is shown during build currently. It can really happen that uninitialized value is used when dropping something else then `GDK_TYPE_FILE_LIST` on the pathbar. Let's initialize the action to prevent this.
-rw-r--r--src/nautilus-pathbar.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 1b6ea6a47..7e19e2448 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -746,7 +746,7 @@ on_drag_motion (GtkDropTarget *target,
gpointer user_data)
{
ButtonData *button_data = user_data;
- GdkDragAction action;
+ GdkDragAction action = 0;
const GValue *value;
graphene_point_t start;
@@ -759,12 +759,7 @@ on_drag_motion (GtkDropTarget *target,
if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
{
GSList *items = g_value_get_boxed (value);
-
- if (items == NULL)
- {
- action = 0;
- }
- else
+ if (items != NULL)
{
action = nautilus_dnd_get_preferred_action (button_data->file, items->data);
}