forked from enlightenment/efl
Dont overrite ourselves and zero the file out during copy operations if src and dst are the same
SVN revision: 17393
This commit is contained in:
parent
f0e54c13f7
commit
2fc139fd86
|
@ -125,8 +125,16 @@ ecore_file_cp(const char *src, const char *dst)
|
|||
{
|
||||
FILE *f1, *f2;
|
||||
char buf[16384];
|
||||
char realpath1[PATH_MAX];
|
||||
char realpath2[PATH_MAX];
|
||||
size_t num;
|
||||
|
||||
if(realpath(src, realpath1) && realpath(src,realpath2))
|
||||
if(!strcmp(realpath1, realpath2))
|
||||
return 0;
|
||||
else
|
||||
return 0;
|
||||
|
||||
f1 = fopen(src, "rb");
|
||||
if (!f1) return 0;
|
||||
f2 = fopen(dst, "wb");
|
||||
|
|
Loading…
Reference in New Issue