{
tmp=localtime(&statbuf.mtime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
+ }
+ else if (statbuf.ctime) printf(" ");
+ if (statbuf.ctime)
+ {
tmp=localtime(&statbuf.ctime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
}
else if (attrib & CPM_ATTR_PWWRITE) printf("Write ");
else if (attrib & CPM_ATTR_PWDEL) printf("Delete ");
else printf("None ");
- tmp=localtime(&statbuf.mtime);
- printf("%02d/%02d/%02d %02d:%02d ",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
- tmp=localtime(&statbuf.ctime);
- printf("%02d/%02d/%02d %02d:%02d",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
+ if (statbuf.mtime)
+ {
+ tmp=localtime(&statbuf.mtime);
+ printf("%02d/%02d/%02d %02d:%02d ",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
+ }
+ else if (statbuf.ctime) printf(" ");
+ if (statbuf.ctime)
+ {
+ tmp=localtime(&statbuf.ctime);
+ printf("%02d/%02d/%02d %02d:%02d",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
+ }
putchar('\n');
++l;
}
/* variables */ /*{{{*/
const char *err;
const char *image;
- const char *format=FORMAT;
+ const char *format;
const char *devopts=NULL;
int c,usage=0;
struct cpmSuperBlock drive;
/*}}}*/
/* parse options */ /*{{{*/
+ if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
while ((c=getopt(argc,argv,"cT:f:ih?dDFlA"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
if (usage)
{
+#if HAVE_LIBDSK_H
fprintf(stderr,"Usage: %s [-f format] [-T libdsk-type] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]\n",cmd);
+#else
+ fprintf(stderr,"Usage: %s [-f format] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]\n",cmd);
+#endif
exit(1);
}
/*}}}*/