This commit is contained in:
Your Name 2023-10-24 21:40:36 +03:00
parent 8f4c4dd8a0
commit fae1043627
2 changed files with 16 additions and 0 deletions

13
LICENSE
View File

@ -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.

View File

@ -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;