]>
git.ipfire.org Git - thirdparty/util-linux.git/commit
more: improve error messaging when input file is directory
Before this change the error message about directory was not informative,
and a little bit out of place.
$ touch empty ; ./more ./empty /
::::::::::::::
./empty
::::::::::::::
magic failed: cannot read fd 4 (Is a directory)
::::::::::::::
/
::::::::::::::
After the change messaging is reverted back to what it used to be.
$ ./more ./empty /
::::::::::::::
./empty
::::::::::::::
*** /: directory ***
And while on it lets remove repeated fstat() call.
Fixes: 09070e1a658e70ec203150e4fa5f486b32771858
Signed-off-by: Sami Kerola <kerolasa@iki.fi>