Creating a file called . creates file in parent dir with the same name as the dir the file was created in
Describe the bug
Creating a file called . creates one in the parent dir and names it the same name as parent with (1) at the end.
To Reproduce
Create dir. For example, test.
In test, create file ..
In the parent of test, there will now be dir test and file test(1).
Expected behavior
Creating a file called . should not be allowed.
System information (please complete the following information):
- OS: Arch Linux
- Version: 6.10.2-arch1-1
- superfile Version: v1.1.7.1 (b157637)
Reproduced bug in MacOS too
Also passing .. also causes similiar behaviour but directory 2 level up is created as a new file.
Behaviour of yazi - Warns about replacing the directory and doesn't do anything and pressing enters ( operation is ignored )
Any name that ends with . or .. (including xyz/../abc/.., ../. , ../.) will also cause such behaviour.
We should avoid ctrl+n operation in case of name either being . or .. , or ending with /. or /..
We cant avoid all names ending with . as abc. is valid.
Also need to consider the behaviour in windows.
Thanks @booth-w for this bug report.
Hey would like to work on this one if its available. Thanks
Sure. @TheLazron .
Also need to consider the behaviour in windows.
Facing this bug on windows as well
@lazysegtree should I make another pull request, made a typo in my fork's branch name. Also if you have any inputs on the fix Thanks!
fork's branch name is okay. No need for another PR