cli: don't call g_strstrip() on NULL arguments

GLib-CRITICAL **: g_strchug: assertion `string != NULL' failed
GLib-CRITICAL **: g_strchomp: assertion `string != NULL' failed
This commit is contained in:
Jiří Klimeš
2013-09-12 10:03:23 +02:00
parent 26544f3148
commit 449a0933ce

View File

@@ -4885,7 +4885,7 @@ parse_editor_main_cmd (const char *cmd, char **cmd_arg)
/* set pointer to command argument */
if (cmd_arg)
*cmd_arg = g_strstrip (g_strdup (vec[1]));
*cmd_arg = vec[1] ? g_strstrip (g_strdup (vec[1])) : NULL;
g_strfreev (vec);
return editor_cmd;