Bug fix: Remote option --list-add parameter
authorColin Clark <colin.clark@cclark.uk>
Wed, 8 Mar 2023 13:02:45 +0000 (13:02 +0000)
committerColin Clark <colin.clark@cclark.uk>
Wed, 8 Mar 2023 13:02:45 +0000 (13:02 +0000)
If the parameter to --remote --list-add: is not a full path to an
existing file Geeqie will crash.

src/remote.cc

index f123510..8a487cc 100644 (file)
@@ -1252,6 +1252,14 @@ static void gr_list_add(const gchar *text, GIOChannel *UNUSED(channel), gpointer
        FileData *fd;
        FileData *first;
 
+       /** @FIXME Should check if file is in current dir, has tilde or is relative */
+       if (!isfile(text))
+               {
+               log_printf("Warning: File does not exist --remote --list-add:%s", text);
+
+               return;
+               }
+
        /* If there is a files list on the command line
         * check if they are all in the same folder
         */