summaryrefslogtreecommitdiffstats
path: root/src/filemanager/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filemanager/command.c')
-rw-r--r--src/filemanager/command.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/filemanager/command.c b/src/filemanager/command.c
index 47d2d75..360f104 100644
--- a/src/filemanager/command.c
+++ b/src/filemanager/command.c
@@ -4,7 +4,7 @@
with all the magic of the command input line, we depend on some
help from the program's callback.
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
Written by:
@@ -139,8 +139,11 @@ enter (WInput * lc_cmdline)
char *s;
s = expand_format (NULL, cmd[++i], TRUE);
- g_string_append (command, s);
- g_free (s);
+ if (s != NULL)
+ {
+ g_string_append (command, s);
+ g_free (s);
+ }
}
}
@@ -248,8 +251,11 @@ command_insert (WInput * in, const char *text, gboolean insert_extra_space)
char *quoted_text;
quoted_text = name_quote (text, TRUE);
- input_insert (in, quoted_text, insert_extra_space);
- g_free (quoted_text);
+ if (quoted_text != NULL)
+ {
+ input_insert (in, quoted_text, insert_extra_space);
+ g_free (quoted_text);
+ }
}
/* --------------------------------------------------------------------------------------------- */