cp fix
This commit is contained in:
parent
8f4c4dd8a0
commit
fae1043627
13
LICENSE
13
LICENSE
@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
@ -81,6 +81,9 @@ int copy(int mode, const char *src, const char *dst) {
|
||||
if (new_path == NULL)
|
||||
goto CLOSE;
|
||||
|
||||
if (!strcmp(new_path, src) || !strcmp(new_path + 2, src))
|
||||
goto CLOSE;
|
||||
|
||||
ofd = open(new_path, O_CREAT | O_TRUNC | O_RDWR, mode);
|
||||
if (ofd < 0)
|
||||
goto CLOSE;
|
||||
|
Loading…
Reference in New Issue
Block a user