#include <string.h>
#include <stdlib.h>
-#include "getopt.h"
+#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
/* variables */ /*{{{*/
const char *err;
const char *image;
- const char *format=FORMAT;
+ const char *format;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
/*}}}*/
/* parse options */ /*{{{*/
+ if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
if (optind>=(argc-2)) usage=1;
else
{
- image=argv[optind];
- if (!sscanf(argv[optind+1], "%o", &mode)) usage=1;
+ image=argv[optind++];
+ if (!sscanf(argv[optind++], "%o", &mode)) usage=1;
}
if (usage)
exitcode=1;
}
}
+ cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/