Amend remote --tell option
authorColin Clark <colin.clark@cclark.uk>
Fri, 20 Mar 2020 18:27:30 +0000 (18:27 +0000)
committerColin Clark <colin.clark@cclark.uk>
Fri, 20 Mar 2020 18:27:30 +0000 (18:27 +0000)
This option did not give output if the current folder did not contain an
image.
The option now returns the current folder full path, terminated by the
directory separator.

src/remote.c

index b3c51c3..0c903cc 100644 (file)
@@ -975,13 +975,17 @@ static void gr_file_tell(const gchar *text, GIOChannel *channel, gpointer data)
                        {
                        out_string = g_strconcat(image_get_path(lw_id->image), NULL);
                        }
+               }
+       else
+               {
+               out_string = g_strconcat(lw_id->dir_fd->path, G_DIR_SEPARATOR_S, NULL);
+               }
 
-               g_io_channel_write_chars(channel, out_string, -1, NULL, NULL);
-               g_io_channel_write_chars(channel, "<gq_end_of_command>", -1, NULL, NULL);
+       g_io_channel_write_chars(channel, out_string, -1, NULL, NULL);
+       g_io_channel_write_chars(channel, "<gq_end_of_command>", -1, NULL, NULL);
 
-               g_free(collection_name);
-               g_free(out_string);
-               }
+       g_free(collection_name);
+       g_free(out_string);
 }
 
 static void gr_file_info(const gchar *text, GIOChannel *channel, gpointer data)