forked from enlightenment/enlightenment
that is bad code as rusty says - though fix it a different way.
SVN revision: 74252
This commit is contained in:
parent
db0049e248
commit
7ac8b4fd31
|
@ -1163,10 +1163,16 @@ _e_fm_op_copy_dir(E_Fm_Op_Task *task)
|
|||
static int
|
||||
_e_fm_op_copy_link(E_Fm_Op_Task *task)
|
||||
{
|
||||
size_t len;
|
||||
int len;
|
||||
char path[PATH_MAX];
|
||||
|
||||
len = readlink(task->src.name, &path[0], PATH_MAX);
|
||||
len = readlink(task->src.name, path, sizeof(path) - 1);
|
||||
if (len < 0)
|
||||
{
|
||||
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot read link '%s'.", task->src.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
path[len] = 0;
|
||||
|
||||
if (symlink(path, task->dst.name) != 0)
|
||||
|
@ -1181,7 +1187,7 @@ _e_fm_op_copy_link(E_Fm_Op_Task *task)
|
|||
else
|
||||
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot create link from '%s' to '%s': %s.", path, task->dst.name);
|
||||
}
|
||||
|
||||
}
|
||||
task->dst.done += task->src.st.st_size;
|
||||
|
||||
_e_fm_op_update_progress(task, task->src.st.st_size, 0);
|
||||
|
|
Loading…
Reference in New Issue