#1076383 coreutils: --backup=existing isn't if the existing backup is numbered 0

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2024-07-15 13:12:04 UTC
Severity:
normal
#1076383#5
Date:
2024-07-15 13:09:17 UTC
From:
To:
Dear Maintainer,

$ > f
$ > g.~0~
$ ln -v --backup=existing f g
'g' => 'f'
$ ln -v --backup=existing f g
'g~' ~ 'g' => 'f'

$ > g.~1~
$ ln -v --backup=existing f g
'g.~2~' ~ 'g' => 'f'

Quoth ln(1)
       existing, nil
              numbered if numbered backups exist, simple otherwise
so this is obviously wrong.

I tried to consult /usr/share/info/coreutils.info.gz
but that also doesn't describe the backup scheme.
Well, except calling it similar to Emacs, which is hardly relevant.

Best,