Update upstream source from tag 'upstream/2.23'
[debian/cpmtools] / cpmchmod.c
index ad146965cfad8c1d128363512a0603a3cfcb12b1..a917ae754400bdb0c32b06c9605ec3eb3420c462 100644 (file)
@@ -9,10 +9,6 @@
 
 #include "getopt_.h"
 #include "cpmfs.h"
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
 /*}}}*/
 
 const char cmd[]="cpmchmod";
@@ -24,6 +20,7 @@ int main(int argc, char *argv[]) /*{{{*/
   const char *image;
   const char *format;
   const char *devopts=NULL;
+  int uppercase=0;
   int c,i,usage=0,exitcode=0;
   struct cpmSuperBlock drive;
   struct cpmInode root;
@@ -34,10 +31,11 @@ int main(int argc, char *argv[]) /*{{{*/
 
   /* parse options */ /*{{{*/
   if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
-  while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
+  while ((c=getopt(argc,argv,"T:f:uh?"))!=EOF) switch(c)
   {
     case 'T': devopts=optarg; break;
     case 'f': format=optarg; break;
+    case 'u': uppercase=1; break;
     case 'h':
     case '?': usage=1; break;
   }
@@ -51,7 +49,7 @@ int main(int argc, char *argv[]) /*{{{*/
 
   if (usage)
   {
-    fprintf(stderr,"Usage: %s [-f format] image mode pattern ...\n",cmd);
+    fprintf(stderr,"Usage: %s [-f format] [-u] image mode pattern ...\n",cmd);
     exit(1);
   }
   /*}}}*/
@@ -61,7 +59,7 @@ int main(int argc, char *argv[]) /*{{{*/
     fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
     exit(1);
   }
-  if (cpmReadSuper(&drive,&root,format)==-1)
+  if (cpmReadSuper(&drive,&root,format,uppercase)==-1)
   {
     fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
     exit(1);