summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Li <gary.li1@uwaterloo.ca>2022-09-18 13:30:47 -0400
committerGary Li <gary.li1@uwaterloo.ca>2022-09-18 17:49:27 +0000
commitf8f1e6c0460f8d029879c08cca14a4917e8f97a7 (patch)
tree5d25d34a44349a4a52ddb06878de6c6493d63d6f
parenteea99624ac8f761644bc01469673ab89e45b57b3 (diff)
downloadnautilus-f8f1e6c0460f8d029879c08cca14a4917e8f97a7.tar.gz
nautilus-file-undo-operations.c: Use base file name for template redo
Currently, Nautilus crashes for redo operations after undoing a template create. This is because we are passing the parse path, but we expect the base name for the redo operation. To fix this, use g_file_get_basename instead of g_file_get_parse_name. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2344
-rw-r--r--src/nautilus-file-undo-operations.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-file-undo-operations.c b/src/nautilus-file-undo-operations.c
index 7fc6ecd2d..962f7f49e 100644
--- a/src/nautilus-file-undo-operations.c
+++ b/src/nautilus-file-undo-operations.c
@@ -872,7 +872,7 @@ create_from_template_redo_func (NautilusFileUndoInfoCreate *self,
parent = g_file_get_parent (self->target_file);
parent_uri = g_file_get_uri (parent);
- new_name = g_file_get_parse_name (self->target_file);
+ new_name = g_file_get_basename (self->target_file);
nautilus_file_operations_new_file_from_template (NULL,
parent_uri, new_name,
self->template,