aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-01 17:00:11 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-01 17:00:11 +0200
commit2fc5a2ee548c397ac635a6e007515150d4ed6aef (patch)
treef0f44c67ac5cef50bdb963778650edeb7f762f44 /src/command
parent780ee74177d00eabb152ee85d2b4a24cba48df9b (diff)
downloadprofani-tty-2fc5a2ee548c397ac635a6e007515150d4ed6aef.tar.gz
cmd_url_*(): remove NULLing when not needed
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_funcs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index ed20d09d..de7eb55c 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -8955,8 +8955,6 @@ cmd_url_open(ProfWin *window, const char *const command, gchar **args)
gboolean require_save = false;
- char *suffix_cmd = NULL;
- char *suffix = NULL;
gchar *fileStart = g_strrstr(args[1], "/");
if (fileStart == NULL) {
cons_show("URL '%s' is not valid.", args[1]);
@@ -8972,6 +8970,8 @@ cmd_url_open(ProfWin *window, const char *const command, gchar **args)
// fileStart is set to the end of the URL.
fileStart = args[1] + strlen(args[1]);
}
+
+ gchar *suffix = NULL;
gchar *suffixStart = g_strrstr(fileStart, ".");
if (suffixStart != NULL) {
suffixStart++;
@@ -8989,17 +8989,15 @@ cmd_url_open(ProfWin *window, const char *const command, gchar **args)
g_strfreev(suffix_cmd_pref);
suffix_cmd_pref = prefs_get_string_list_with_option(PREF_URL_OPEN_CMD, lowercase_suffix);
g_free(lowercase_suffix);
- lowercase_suffix = NULL;
g_free(suffix);
- suffix = NULL;
}
if (0 == g_strcmp0(suffix_cmd_pref[0], "true")) {
require_save = true;
}
- suffix_cmd = g_strdup(suffix_cmd_pref[1]);
+
+ gchar *suffix_cmd = g_strdup(suffix_cmd_pref[1]);
g_strfreev(suffix_cmd_pref);
- suffix_cmd_pref = NULL;
gchar *scheme = g_uri_parse_scheme(args[1]);
if( 0 == g_strcmp0(scheme, "aesgcm")) {
@@ -9118,11 +9116,9 @@ cmd_url_save(ProfWin *window, const char *const command, gchar **args)
}
g_free(scheme);
- scheme = NULL;
gchar **argv = g_strsplit(scheme_cmd, " ", 0);
g_free(scheme_cmd);
- scheme_cmd = NULL;
guint num_args = 0;
while (argv[num_args]) {