Closed 4Luke4 closed 11 months ago
I would say undefined behaviour. It's returning -1 on an empty file and 0 on a file with no matches due to an implementation detail. What's desired behaviour?
I would say undefined behaviour. It's returning
-1
on an empty file and0
on a file with no matches due to an implementation detail. What's desired behaviour?
Up to you I guess... I mean, it is easy to workaround, so you might want to keep things as they are... If that is the case, then you might want to clarify the undefined behaviour in the docs...
According to the documentation, this command is supposed to return the number of times
regexp
appears in the current file.However, if the current file is empty, it returns
-1
instead of0
.Steps to reproduce
Is it intended...?