about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-12-09 09:13:31 +0100
committerGitHub <noreply@github.com>2020-12-09 09:13:31 +0100
commitf10edd202f64237d3d941da2da173f56d115f7ac (patch)
tree3c4ec87fec42498b299c4ce1828a7ccbc04b51aa /src/command/cmd_funcs.c
parent7a319df6c80c472adcf416c8737e7b156854352b (diff)
parent5179b253c4ac7283a2c73cb5bc0da440c8012de1 (diff)
downloadprofani-tty-f10edd202f64237d3d941da2da173f56d115f7ac.tar.gz
Merge pull request #1447 from profanity-im/omemomediasharing-impr
omemo media sharing related polishing
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r--src/command/cmd_funcs.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index fd9d2ffd..68153270 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -4854,18 +4854,12 @@ gboolean
 cmd_sendfile(ProfWin* window, const char* const command, gchar** args)
 {
     jabber_conn_status_t conn_status = connection_get_status();
-    char* filename = args[0];
+    gchar* filename;
     char* alt_scheme = NULL;
     char* alt_fragment = NULL;
 
     // expand ~ to $HOME
-    if (filename[0] == '~' && filename[1] == '/') {
-        if (asprintf(&filename, "%s/%s", getenv("HOME"), filename + 2) == -1) {
-            return TRUE;
-        }
-    } else {
-        filename = strdup(filename);
-    }
+    filename = get_expanded_path(args[0]);
 
     if (access(filename, R_OK) != 0) {
         cons_show_error("Uploading '%s' failed: File not found!", filename);