From 7d87b9c216bad4c71aabfea2498c26cceda8e715 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Fri, 10 Nov 2023 10:48:19 +1000 Subject: [PATCH] less should error when file doesn't exist --- clite/commands.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clite/commands.js b/clite/commands.js index 1e35051..773c3c3 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -326,6 +326,11 @@ Options: } var fd = stdio.open(file,prepFile); + if (!fd) { + io.error('could not open file: '+file); + io.exit(1); + return; + } var tty = term.createTTY(); tty.setRaw(false);