From 6b9151d3e37afe9f3702ed70516b9b096fd38424 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Sun, 20 Mar 2016 21:03:53 +1000 Subject: [PATCH] Print out an error message if ls is given a name that doesn't exist. --- src/other/wktls.s | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/other/wktls.s b/src/other/wktls.s index a99a4c3..8d3ea23 100644 --- a/src/other/wktls.s +++ b/src/other/wktls.s @@ -43,7 +43,7 @@ setlong: 1: sys open; 9:curdir; 0 " Open up the directory, curdir if no arguments spa - sys exit " Unable, so die now + jmp error dac fd " Save the fd fileloop: @@ -211,6 +211,18 @@ octal: 0 isz octal " Move return address 1 past the argument jmp octal i " and return from subroutine +error: + lac 9b + dac 1f + lac d1 + sys write; 1:0; 4 " Write out the bad dirname + lac d1 + sys write; mes; 1 " followed by "?\n" + sys exit + +mes: + 077012 " String literal: " ?\n" + longopt: 0 " User set the -l option when this is 1 argptr: 0 " Pointer to the next argument fd: 0 " File descriptor for the directory