However, it does not do what I would have thought.
Currently, when I try to open a directory, nano beeps and says
that the given name is a directory. For example, do:
src/nano doc/
Result on the statusbar: [ "doc" is a directory ]
But with your patch, nano now simply opens a blank buffer,
without any complaint. It ignores the doc/ as if the user
typed nothing at all. That is not good. If the user typed
something, she meant to edit something; she did not mean to
open a blank buffer.
So... this is not the way to solve bug #44950
(https://savannah.gnu.org/bugs/?44950).
Yes, the bug report suggests to discard anything on
the command line that is not a real and readable file,
but that was apparently not a good idea.
I now think that nano should report, for an argument
of the type nondir/filename, on the statusbar that
nondir is a nonexistent directory.
However, most other editors will open a blank buffer,
and will only complain at the moment the user tries
to save the file. Pico, vim, emacs, gedit...
What should nano do?