leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.29k stars 41 forks source link

can't rename a file when a similar file is already there #253

Closed muellerto closed 10 months ago

muellerto commented 10 months ago

Describe the bug Complicated, see To Reproduce.

To Reproduce Steps to reproduce the behavior:

  1. I have two files, one is db.xml.bz2, the other one is xx.xml, both side by side in the same directory.
  2. Then I give him the command m xx.xml db.xml, exactly like this, no ELNs.
  3. When I press Enter mv asks if the file db.xml.bz2 should be overwritten.

That's not good. db.xml.bz2 should remain, it shouldn't be involved at all, the designated file name db.xml is truly different from db.xml.bz2 and valid, the desired rename operation should be possible without any problem.

When I really do this, "overwrite", nothing happens. Neither db.xml.bz2 is overwritten nor xx.xml is renamed. Everything is exactly as before.

I guess the problem depends somehow on multiple dots in a file name. Renaming xx.xml to upload.xml works as expected.

Expected behavior Renaming a file with the m command should affect only the files specified, no others.

Screenshots

1 input       15 d/rwx.r-x.r-x 2023-05-06 09:41:04   4096
2 output      13 d/rwx.r-x.r-x 2013-10-04 17:15:06   4096
3 db.xml.bz2   - ./rw-.r--.r-- 2023-07-10 16:00:13   7950
4 upload.ftp   - ./rw-.r--.r-- 2013-12-01 13:58:24    339
5 xx.xml       - ./rw-.r--.r-- 2023-09-13 17:34:10 169761
------------------------------------------------------------------------------------------------------------
T2[4] 17:42 muellerto:seth ~/local/share/pdrx
<1> $ m xx.xml db.xml
mv: 'db.xml.bz2' überschreiben?                      <- overwrite?

Desktop (please complete the following information):

leo-arch commented 10 months ago

I'll take a look at it. Seems trivial to solve, but who knows.

leo-arch commented 10 months ago

Ok @muellerto, it should be fixed now.

leo-arch commented 10 months ago

In case you're interested, here's an explanation of the fix.

muellerto commented 10 months ago

Great. Seems to work fine now. Thanks a lot for that (and for your breathtaking speed in fixing things ...)