New upstream version 2.20
[debian/cpmtools] / cpmls.c
diff --git a/cpmls.c b/cpmls.c
index fa100e9d5e80fdfdf81cc29a11ad99c944680141..3721d2e0bb7c3d50e4169024032b0485e74768a5 100644 (file)
--- a/cpmls.c
+++ b/cpmls.c
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 
 #include "getopt_.h"
 #include "cpmfs.h"
@@ -379,10 +380,14 @@ int main(int argc, char *argv[])
   /* open image */ /*{{{*/
   if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts))) 
   {
-    fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+    fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+    exit(1);
+  }
+  if (cpmReadSuper(&drive,&root,format)==-1)
+  {
+    fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
     exit(1);
   }
-  cpmReadSuper(&drive,&root,format);
   /*}}}*/
   if (optind<argc) cpmglob(optind,argc,argv,&root,&gargc,&gargv);
   else cpmglob(0,1,star,&root,&gargc,&gargv);