projects
/
debian
/
cpmtools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update standards version
[debian/cpmtools]
/
cpmchattr.c
diff --git
a/cpmchattr.c
b/cpmchattr.c
index 42704e72c7cc1ff1dbf7c96122d7538d022ee9b1..dc55c3300660954a97467c3d8577246545277721 100644
(file)
--- a/
cpmchattr.c
+++ b/
cpmchattr.c
@@
-1,12
+1,17
@@
/* #includes */ /*{{{C}}}*//*{{{*/
/* #includes */ /*{{{C}}}*//*{{{*/
+#include "config.h"
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "config.h"
-#include "getopt.h"
+#include "getopt
_
.h"
#include "cpmfs.h"
#include "cpmfs.h"
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
/*}}}*/
const char cmd[]="cpmchattr";
/*}}}*/
const char cmd[]="cpmchattr";
@@
-16,7
+21,7
@@
int main(int argc, char *argv[]) /*{{{*/
/* variables */ /*{{{*/
const char *err;
const char *image;
/* 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;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
@@
-27,6
+32,7
@@
int main(int argc, char *argv[]) /*{{{*/
/*}}}*/
/* parse options */ /*{{{*/
/*}}}*/
/* parse options */ /*{{{*/
+ if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
@@
-38,8
+44,8
@@
int main(int argc, char *argv[]) /*{{{*/
if (optind>=(argc-2)) usage=1;
else
{
if (optind>=(argc-2)) usage=1;
else
{
- image=argv[optind];
- attrs = argv[optind+
1
];
+ image=argv[optind
++
];
+ attrs = argv[optind+
+
];
}
if (usage)
}
if (usage)
@@
-101,6
+107,7
@@
int main(int argc, char *argv[]) /*{{{*/
exitcode=1;
}
}
exitcode=1;
}
}
+ cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/
exit(exitcode);
}
/*}}}*/