mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-12 18:55:09 +00:00
The bug is that if you try to cp DIR_A to DIR_B where DIR_A and DIR_B have the same parent directory and DIR_A's name is a prefix of DIR_B (e.g. foo -> foo2, bar -> barbar), it thinks that it's a subdirectory (since it checks if DIR_A's realpath is a prefix of DIR_B's realpath). The easiest solution is to put a path delimiter at the end before the comparison, since you can't have a / in the middle of a directory name. For example if DIR_A is /home/anon/foo and DIR_B is /home/anon/foo2, then DIR_A's realpath is a prefix of DIR_B's realpath even though DIR_B is not inside DIR_A.
6.7 KiB
6.7 KiB