From 435a620992ed595b1a86ffaf835d4b9b0297e5e4 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sat, 21 Jul 2012 13:53:54 +0000 Subject: [PATCH] check if the name has a 'file' part SVN revision: 74266 --- src/bin/e_fm_op.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bin/e_fm_op.c b/src/bin/e_fm_op.c index 407100b5f..866987993 100644 --- a/src/bin/e_fm_op.c +++ b/src/bin/e_fm_op.c @@ -1354,15 +1354,19 @@ _e_fm_op_copy_atom(E_Fm_Op_Task *task) dst_dir = ecore_file_dir_get(task->dst.name); if (dst_dir) { - char dst_path[PATH_MAX]; const char *dst_name; dst_name = ecore_file_file_get(task->src.name); - if ((strlen(dst_dir) + strlen(dst_name)) >= PATH_MAX) - _E_FM_OP_ERROR_SEND_WORK(task, 0, "Not copying link: path too long", dst_path); + if (dst_name) + { + char dst_path[PATH_MAX]; - snprintf(dst_path, sizeof(dst_path), "%s/%s", dst_dir, dst_name); - task->dst.name = strdup(dst_path); + if ((strlen(dst_dir) + strlen(dst_name)) >= PATH_MAX) + _E_FM_OP_ERROR_SEND_WORK(task, 0, "Not copying link: path too long", dst_path); + + snprintf(dst_path, sizeof(dst_path), "%s/%s", dst_dir, dst_name); + task->dst.name = strdup(dst_path); + } free(dst_dir); } }