Print out an error message if ls is given a name that doesn't exist.
This commit is contained in:
+13
-1
@@ -43,7 +43,7 @@ setlong:
|
|||||||
1:
|
1:
|
||||||
sys open; 9:curdir; 0 " Open up the directory, curdir if no arguments
|
sys open; 9:curdir; 0 " Open up the directory, curdir if no arguments
|
||||||
spa
|
spa
|
||||||
sys exit " Unable, so die now
|
jmp error
|
||||||
dac fd " Save the fd
|
dac fd " Save the fd
|
||||||
|
|
||||||
fileloop:
|
fileloop:
|
||||||
@@ -211,6 +211,18 @@ octal: 0
|
|||||||
isz octal " Move return address 1 past the argument
|
isz octal " Move return address 1 past the argument
|
||||||
jmp octal i " and return from subroutine
|
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
|
longopt: 0 " User set the -l option when this is 1
|
||||||
argptr: 0 " Pointer to the next argument
|
argptr: 0 " Pointer to the next argument
|
||||||
fd: 0 " File descriptor for the directory
|
fd: 0 " File descriptor for the directory
|
||||||
|
|||||||
Reference in New Issue
Block a user