Skip to content

fix: infinite loop when paste cannot find a free name#2634

Open
valoq wants to merge 2 commits into
gokcehan:masterfrom
valoq:nameloop
Open

fix: infinite loop when paste cannot find a free name#2634
valoq wants to merge 2 commits into
gokcehan:masterfrom
valoq:nameloop

Conversation

@valoq

@valoq valoq commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

When a pasted file name already exists, lf tries new names like file.1, file.2 etc. and only stops once a name is free.
But when that files e.g. because the new name is too long for the file system lf retries forever.
There are probably more cases where this can be triggered but the long name is the most obvious and easy to test

To trigger the issue, just create a filename with 255 characters (on ext4) and copy it in the same dir. since the appended N will exceed the limit, the loop will be infinite retries.

@valoq
valoq marked this pull request as ready for review July 2, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant