Skip to content
This repository
Browse code

die nicely if opendir fails in example ls.pir

  • Loading branch information...
commit 91518de1ef77306ffa150dc178090e6fe5fcaf6f 1 parent 7a9e7ad
NotFound authored August 17, 2011

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  examples/nci/ls.pir
10  examples/nci/ls.pir
@@ -34,6 +34,16 @@ In this encarnation it works on linux i386 and amd64 systems.
34 34
 
35 35
      .local pmc curdir
36 36
      curdir = opendir(dirname_c)
  37
+     unless null curdir goto opened
  38
+
  39
+     .local pmc err
  40
+     getstderr err
  41
+     print err, "Cannot open directory '"
  42
+     print err, dirname
  43
+     print err, "'\n"
  44
+     exit 1
  45
+
  46
+opened:
37 47
      .local pmc entry
38 48
 
39 49
      .include "datatypes.pasm"

0 notes on commit 91518de

Please sign in to comment.
Something went wrong with that request. Please try again.