fix(#4886) more: panics if file is not readable#4888
fix(#4886) more: panics if file is not readable#4888cakebaker merged 6 commits intouutils:mainfrom Ludmuterol:more-panic-4886
Conversation
|
Thanks for your PR :) I wouldn't use a And can you please add a test to |
|
:) Sure! If I understand correctly i only need to add a file into the fixtures folder (in the correct sub folder) to be able to use it? i did so and changed it to the 244 perms and now every test panics... i get that comes from recursive copy where it returns an error since it is not allowed to copy. |
|
You won't need fixtures in this case. And a Unix solution is fine. For inspiration you might want to have a look at the tests for |
Changed to USimpleError and added a test case. my quick research and my dad say the echo is missing/not happening. |
|
please replace the screenshot by text: it is terrible for search and accessibility |
|
should i add a "skip test on not unix" inside my newly added test? |
|
GNU testsuite comparison: |
|
On windows, fails with: |
You forgot to disable "raw mode" before returning the error :)
Yes, please, otherwise the CICD will fail when running it on Windows. You probably also have to use |
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
|
Ah yes I missed that :) thank you! |
|
Thanks :) |
fix for #4886 (comment)
i just changed the unwrap for the File::open to a match and i hope it actually is a UUsageError i am supposed to return here. I chose UsageError since the code above mine chose UsageError for a similar case
output of the preinstalled more on my linux:
more: cannot open foo: Permission deniedoutput of this more:
./more: cannot open 'foo': permission denied Try './more --help' for more information.