Commit 165f960
authored
ls: runtime error for non-existent file argument
* When testing ls today I discovered the error: Can't use an undefined value as a HASH reference at ls line 525.
* Test case: "perl ls xxx ar a.x pig" where files xxx and a.x don't exist
* I broke this in the previous commit around where DirEntries() is called for Files-list
* Add correct return value guard to fix error
* DirEntries() prints a warning and returns an empty list if stat() fails on its file argument
* Derive sorted-list from attrs-hash to avoid listing filenames where stat() failed
%perl ls xxx ar a.x pig
ls: can't access 'xxx': No such file or directory
ls: can't access 'a.x': No such file or directory
ar pig1 parent 51ac8d3 commit 165f960
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
525 | 526 | | |
526 | 527 | | |
527 | | - | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| |||
0 commit comments