diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/Changelog mtools/Changelog --- mtools-3.9.10/Changelog 2005-03-02 22:18:39.000000000 +0100 +++ mtools/Changelog 2006-05-25 22:24:33.000000000 +0200 @@ -1,3 +1,19 @@ +v20060525 + Fix gcc4 warnings + Fix reading of boot sector (block size) +v20060228b + Do no longer open floppy devices with O_EXCL, in order to enable + work-around against broken cache. +v20060228 + If no info dir exists at all, assume dir +v20060227 + Support for DESTDIR +v20051011 + Fix Unix loop +v20050410 + Cygwin compatibility +v20050317 + Solaris 8 compatibility v20050302 Released 3.9.10 v20050228 diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/Makefile.in mtools/Makefile.in --- mtools-3.9.10/Makefile.in 2004-02-28 20:06:35.000000000 +0100 +++ mtools/Makefile.in 2006-02-28 09:55:15.000000000 +0100 @@ -61,10 +61,10 @@ mkmanifest.1 mlabel.1 mmd.1 mmount.1 mmove.1 mpartition.1 \ mrd.1 mren.1 mshowfat.1 mtoolstest.1 mtools.1 mtype.1 mzip.1 MAN1EXT = 1 -MAN1DIR = $(mandir)/man${MAN1EXT} +MAN1DIR = $(DESTDIR)$(mandir)/man${MAN1EXT} MAN5 = mtools.5 MAN5EXT = 5 -MAN5DIR = $(mandir)/man${MAN5EXT} +MAN5DIR = $(DESTDIR)$(mandir)/man${MAN5EXT} # all files in this directory included in the distribution DIST = \ @@ -195,30 +195,29 @@ # Don't cd, to avoid breaking install-sh references. install-info: info - $(top_srcdir)/mkinstalldirs $(infodir) + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(infodir) if test -f mtools.info; then \ for i in mtools.info*; do \ - $(INSTALL_DATA) $$i $(infodir)/$$i; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(infodir)/$$i; \ done; \ else \ for i in $(srcdir)/mtools.info*; do \ - $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \ done; \ fi; \ if [ -n "$(INSTALL_INFO)" ] ; then \ - if [ -f $(infodir)/dir.info ] ; then \ - $(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir.info; \ - fi; \ - if [ -f $(infodir)/dir ] ; then \ - $(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir; \ + if [ -f $(DESTDIR)$(infodir)/dir.info ] ; then \ + $(INSTALL_INFO) $(DESTDIR)$(infodir)/mtools.info $(DESTDIR)$(infodir)/dir.info; \ + else \ + $(INSTALL_INFO) $(DESTDIR)$(infodir)/mtools.info $(DESTDIR)$(infodir)/dir; \ fi; \ fi uninstall-info: - cd $(infodir) && rm -f mtools.info* + cd $(DESTDIR)$(infodir) && rm -f mtools.info* -install: $(bindir)/mtools @BINFLOPPYD@ install-man install-links \ - $(bindir)/mkmanifest install-scripts install-info +install: $(DESTDIR)$(bindir)/mtools @BINFLOPPYD@ install-man install-links \ + $(DESTDIR)$(bindir)/mkmanifest install-scripts install-info uninstall: uninstall-bin uninstall-man uninstall-links \ uninstall-scripts @@ -228,41 +227,41 @@ maintainer-clean: distclean -$(bindir)/floppyd: floppyd - $(top_srcdir)/mkinstalldirs $(bindir) - $(INSTALL_PROGRAM) floppyd $(bindir)/floppyd - -$(bindir)/floppyd_installtest: floppyd_installtest - $(top_srcdir)/mkinstalldirs $(bindir) - $(INSTALL_PROGRAM) floppyd_installtest $(bindir)/floppyd_installtest - -$(bindir)/mtools: mtools - $(top_srcdir)/mkinstalldirs $(bindir) - $(INSTALL_PROGRAM) mtools $(bindir)/mtools - -$(bindir)/mkmanifest: mkmanifest - $(top_srcdir)/mkinstalldirs $(bindir) - $(INSTALL_PROGRAM) mkmanifest $(bindir)/mkmanifest +$(DESTDIR)$(bindir)/floppyd: floppyd + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) floppyd $(DESTDIR)$(bindir)/floppyd + +$(DESTDIR)$(bindir)/floppyd_installtest: floppyd_installtest + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) floppyd_installtest $(DESTDIR)$(bindir)/floppyd_installtest + +$(DESTDIR)$(bindir)/mtools: mtools + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) mtools $(DESTDIR)$(bindir)/mtools + +$(DESTDIR)$(bindir)/mkmanifest: mkmanifest + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) mkmanifest $(DESTDIR)$(bindir)/mkmanifest #$(ETCDIR)/mtools: mtools.etc # cp mtools.etc $(ETCDIR)/mtools -install-links: $(bindir)/mtools +install-links: $(DESTDIR)$(bindir)/mtools @for j in $(LINKS); do \ - rm -f $(bindir)/$$j ; \ - $(LN_S) mtools $(bindir)/$$j ; \ - echo $(bindir)/$$j ; \ + rm -f $(DESTDIR)$(bindir)/$$j ; \ + $(LN_S) mtools $(DESTDIR)$(bindir)/$$j ; \ + echo $(DESTDIR)$(bindir)/$$j ; \ done ## "z" is the older version of "gz"; the name is just *too* short -install-scripts: $(bindir)/mtools - @$(top_srcdir)/mkinstalldirs $(bindir) +install-scripts: $(DESTDIR)$(bindir)/mtools + @$(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) @for j in $(SCRIPTS) ; do \ - $(INSTALL_PROGRAM) $(srcdir)/scripts/$$j $(bindir)/$$j ; \ - echo $(bindir)/$$j ; \ + $(INSTALL_PROGRAM) $(srcdir)/scripts/$$j $(DESTDIR)$(bindir)/$$j ; \ + echo $(DESTDIR)$(bindir)/$$j ; \ done - rm -f $(bindir)/lz - $(LN_S) uz $(bindir)/lz + rm -f $(DESTDIR)$(bindir)/lz + $(LN_S) uz $(DESTDIR)$(bindir)/lz install-man: @$(top_srcdir)/mkinstalldirs $(MAN1DIR) @@ -278,14 +277,14 @@ uninstall-bin: @for j in mtools mkmanifest; do \ - rm -f $(bindir)/$$j ; \ - echo $(bindir)/$$j ; \ + rm -f $(DESTDIR)$(bindir)/$$j ; \ + echo $(DESTDIR)$(bindir)/$$j ; \ done uninstall-scripts: @for j in $(SCRIPTS); do \ - rm -f $(bindir)/$$j ; \ - echo $(bindir)/$$j ; \ + rm -f $(DESTDIR)$(bindir)/$$j ; \ + echo $(DESTDIR)$(bindir)/$$j ; \ done uninstall-man: @@ -300,8 +299,8 @@ uninstall-links: @for j in $(LINKS); \ - do rm -f $(bindir)/$$j ; \ - echo $(bindir)/$$j ; \ + do rm -f $(DESTDIR)$(bindir)/$$j ; \ + echo $(DESTDIR)$(bindir)/$$j ; \ done depend: $(SRCS) diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/codepage.c mtools/codepage.c --- mtools-3.9.10/codepage.c 2002-05-01 11:57:01.000000000 +0200 +++ mtools/codepage.c 2005-04-10 09:19:16.000000000 +0200 @@ -87,7 +87,7 @@ return; } - fd = open(filename, O_RDONLY | O_LARGEFILE); + fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); if(fd < 0) { perror("open country.sys"); exit(1); diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/config.c mtools/config.c --- mtools-3.9.10/config.c 2004-02-28 18:40:23.000000000 +0100 +++ mtools/config.c 2005-10-11 22:56:37.000000000 +0200 @@ -34,6 +34,8 @@ struct device *devices; /* the device table */ static int token_nr; /* number of tokens in line */ +static char default_drive='\0'; /* default drive */ + /* "environment" variables */ unsigned int mtools_skip_check=0; unsigned int mtools_fat_compatibility=0; @@ -152,6 +154,23 @@ { "BLOCKSIZE", OFFS(blocksize), T_UINT } }; +static void maintain_default_drive(char drive) +{ + if(default_drive == ':') + return; /* we have an image */ + if(default_drive == '\0' || + default_drive > drive) + default_drive = drive; +} + +char get_default_drive(void) +{ + if(default_drive != '\0') + return default_drive; + else + return 'A'; +} + static void syntax(const char *msg, int thisLine) { char drive='\0'; @@ -495,6 +514,7 @@ void set_cmd_line_image(char *img, int flags) { prepend(); devices[cur_dev].drive = ':'; + default_drive = ':'; devices[cur_dev].name = strdup(img); devices[cur_dev].fat_bits = 0; devices[cur_dev].tracks = 0; @@ -549,6 +569,7 @@ } devices[cur_dev].drive = toupper(devices[cur_dev].drive); + maintain_default_drive(devices[cur_dev].drive); if (!(devices[cur_dev].name = strdup(name))) { printOom(); exit(1); @@ -589,6 +610,7 @@ trusted = privilege; flag_mask = 0; devices[cur_dev].drive = toupper(token[0]); + maintain_default_drive(devices[cur_dev].drive); expect_char(':'); return 1; } diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/config.h.in mtools/config.h.in --- mtools-3.9.10/config.h.in 2005-02-28 23:10:39.000000000 +0100 +++ mtools/config.h.in 2005-03-17 20:47:11.000000000 +0100 @@ -126,6 +126,9 @@ /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/configure mtools/configure --- mtools-3.9.10/configure 2005-02-28 23:10:33.000000000 +0100 +++ mtools/configure 2006-02-27 17:36:50.000000000 +0100 @@ -5171,9 +5171,11 @@ + for ac_func in strerror random srandom strchr strrchr lockf flock \ strcasecmp strncasecmp atexit on_exit getpass memmove \ -strdup strcspn strspn strtoul strtol memcpy strpbrk memset seteuid setresuid \ +strdup strcspn strspn strtoul strtol memcpy strpbrk memset setenv \ +seteuid setresuid \ tcsetattr tcflush basename fchdir media_oldaliases llseek lseek64 \ snprintf stat64 do @@ -7737,7 +7739,7 @@ exit 1 fi FLOPPYD="floppyd floppyd_installtest" - BINFLOPPYD="\$(bindir)/floppyd \$(bindir)/floppyd_installtest" + BINFLOPPYD="\$(DESTDIR)\$(bindir)/floppyd \$(DESTDIR)\$(bindir)/floppyd_installtest" cat >>confdefs.h <<\_ACEOF #define USE_FLOPPYD 1 diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/configure.in mtools/configure.in --- mtools-3.9.10/configure.in 2003-02-16 16:13:25.000000000 +0100 +++ mtools/configure.in 2006-02-27 17:36:44.000000000 +0100 @@ -135,7 +135,8 @@ AC_TYPE_SIGNAL AC_CHECK_FUNCS(strerror random srandom strchr strrchr lockf flock \ strcasecmp strncasecmp atexit on_exit getpass memmove \ -strdup strcspn strspn strtoul strtol memcpy strpbrk memset seteuid setresuid \ +strdup strcspn strspn strtoul strtol memcpy strpbrk memset setenv \ +seteuid setresuid \ tcsetattr tcflush basename fchdir media_oldaliases llseek lseek64 \ snprintf stat64) AC_FUNC_SETPGRP @@ -343,7 +344,7 @@ exit 1 fi FLOPPYD="floppyd floppyd_installtest" - BINFLOPPYD="\$(bindir)/floppyd \$(bindir)/floppyd_installtest" + BINFLOPPYD="\$(DESTDIR)\$(bindir)/floppyd \$(DESTDIR)\$(bindir)/floppyd_installtest" AC_DEFINE([USE_FLOPPYD],1,[Define when you want to include floppyd support]) else FLOPPYD= diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/devices.c mtools/devices.c --- mtools-3.9.10/devices.c 2003-05-24 22:54:27.000000000 +0200 +++ mtools/devices.c 2006-05-25 22:33:49.000000000 +0200 @@ -717,8 +717,8 @@ #define predefined_devices struct device devices[] = { - {"/dev/fd0", 'A', 0, O_EXCL, 80,2, 18,0, MDEF_ARG}, - {"/dev/fd1", 'B', 0, O_EXCL, 0,0, 0,0, FDEF_ARG}, + {"/dev/fd0", 'A', 0, 0, 80,2, 18,0, MDEF_ARG}, + {"/dev/fd1", 'B', 0, 0, 0,0, 0,0, FDEF_ARG}, /* we assume that the Zip or Jaz drive is the second on the SCSI bus */ {"/dev/sdb4",'J', GENHD }, {"/dev/sdb4",'Z', GENHD }, diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/fat.c mtools/fat.c --- mtools-3.9.10/fat.c 2004-05-05 21:19:52.000000000 +0200 +++ mtools/fat.c 2005-10-11 22:53:40.000000000 +0200 @@ -4,8 +4,6 @@ #include "mtools.h" #include "fsP.h" -extern Stream_t *default_drive; - #ifdef HAVE_LONG_LONG typedef long long fatBitMask; #else diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/floppyd.1 mtools/floppyd.1 --- mtools-3.9.10/floppyd.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/floppyd.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH floppyd 1 "28Feb05" mtools-3.9.10 +.TH floppyd 1 "02Mar05" mtools-3.9.10 .SH Name floppyd - floppy daemon for remote access to floppy drive floppyd_installtest - tests whether floppyd is installed and running @@ -81,7 +81,7 @@ .PP \&\fIdevicenames\fR is a list of device nodes to be opened. Default is \fR\&\f(CW/dev/fd0\fR. Multiple devices are only supported on mtools -versions newer than February 28th 2005 +versions newer than 3.9.10. .PP .SH Connecting\ to\ floppyd .PP @@ -94,7 +94,7 @@ \&\fIbaseport\fR+\fIdisplaynumber\fR at \fIhostname\fR. By default \&\fIbaseport\fR is 5703. The drive parameter is to distinguish among multiple drives associated with a single display (only mtools versions -more recent than February 28th 2005) +more recent than 3.9.10) .PP .SH Examples: .PP diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/floppyd.c mtools/floppyd.c --- mtools-3.9.10/floppyd.c 2005-02-28 00:33:37.000000000 +0100 +++ mtools/floppyd.c 2006-05-25 22:34:39.000000000 +0200 @@ -384,6 +384,7 @@ static char *dispName; +static char XAUTHORITY[]="XAUTHORITY"; char do_auth(io_buffer sock, int *version) { @@ -452,7 +453,17 @@ destroyPacket(mit_cookie); return 0; } - setenv("XAUTHORITY", authFile, 1); +#ifdef HAVE_SETENV + setenv(XAUTHORITY, authFile, 1); +#else + { + char *buffer=malloc(strlen(XAUTHORITY)+strlen(authFile)+2); + strcpy(buffer, XAUTHORITY); + strcat(buffer, "="); + strcat(buffer, authFile); + putenv(buffer); + } +#endif ptr = template; ptr[4095] = 0; diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/floppyd_installtest.1 mtools/floppyd_installtest.1 --- mtools-3.9.10/floppyd_installtest.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/floppyd_installtest.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH floppyd_installtest 1 "28Feb05" mtools-3.9.10 +.TH floppyd_installtest 1 "02Mar05" mtools-3.9.10 .SH Name floppyd_installtest - tests whether floppyd is installed and running '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/floppyd_installtest.c mtools/floppyd_installtest.c --- mtools-3.9.10/floppyd_installtest.c 2002-05-01 12:48:11.000000000 +0200 +++ mtools/floppyd_installtest.c 2006-05-25 22:19:31.000000000 +0200 @@ -69,7 +69,7 @@ { Byte val[4]; - read(handle, val, 4); + read(handle, (char *) val, 4); return byte2dword(val); } diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/floppyd_io.c mtools/floppyd_io.c --- mtools-3.9.10/floppyd_io.c 2005-02-27 23:32:57.000000000 +0100 +++ mtools/floppyd_io.c 2006-05-25 22:02:42.000000000 +0200 @@ -81,7 +81,7 @@ { Byte val[4]; - read(handle, val, 4); + read(handle, (char *)val, 4); return byte2dword(val); } diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/init.c mtools/init.c --- mtools-3.9.10/init.c 2002-05-01 11:57:02.000000000 +0200 +++ mtools/init.c 2006-05-25 21:59:07.000000000 +0200 @@ -30,8 +30,8 @@ /* read the first sector, or part of it */ if(!size) size = BOOTSIZE; - if(size > 1024) - size = 1024; + if(size > MAX_BOOT) + size = MAX_BOOT; if (force_read(Stream, (char *) boot, 0, size) != size) return -1; @@ -196,8 +196,9 @@ struct device dev; mt_size_t maxSize; - struct bootsector boot0; -#define boot (&boot0) + unsigned char boot0[MAX_BOOT]; + struct bootsector *boot = (struct bootsector *) boot0; + Fs_t *This; This = New(Fs_t); @@ -216,7 +217,7 @@ This->drive = drive; This->last = 0; - This->Direct = find_device(drive, mode, &dev, &boot0, name, &media, + This->Direct = find_device(drive, mode, &dev, boot, name, &media, &maxSize); if(!This->Direct) return NULL; @@ -268,16 +269,16 @@ nhs = WORD(nhs); - This->cluster_size = boot0.clsiz; + This->cluster_size = boot->clsiz; This->fat_start = WORD(nrsvsect); This->fat_len = WORD(fatlen); This->dir_len = WORD(dirents) * MDIR_SIZE / This->sector_size; - This->num_fat = boot0.nfat; + This->num_fat = boot->nfat; if (This->fat_len) { - labelBlock = &boot0.ext.old.labelBlock; + labelBlock = &boot->ext.old.labelBlock; } else { - labelBlock = &boot0.ext.fat32.labelBlock; + labelBlock = &boot->ext.fat32.labelBlock; } if(labelBlock->dos4 == 0x29) { @@ -293,8 +294,9 @@ if(!mtools_skip_check && (tot_sectors % dev.sectors)){ fprintf(stderr, - "Total number of sectors not a multiple of" - " sectors per track!\n"); + "Total number of sectors (%d) not a multiple of" + " sectors per track (%d)!\n", tot_sectors, + dev.sectors); fprintf(stderr, "Add mtools_skip_check=1 to your .mtoolsrc file " "to skip this test\n"); @@ -347,7 +349,7 @@ } /* read the FAT sectors */ - if(fat_read(This, &boot0, dev.fat_bits, tot_sectors, dev.use_2m&0x7f)){ + if(fat_read(This, boot, dev.fat_bits, tot_sectors, dev.use_2m&0x7f)){ This->num_fat = 1; FREE(&This->Next); Free(This->Next); diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mainloop.c mtools/mainloop.c --- mtools-3.9.10/mainloop.c 2002-05-01 12:17:50.000000000 +0200 +++ mtools/mainloop.c 2005-10-11 23:18:18.000000000 +0200 @@ -14,14 +14,68 @@ #include "file.h" +/* Fix the info in the MCWD file to be a proper directory name. + * Always has a leading separator. Never has a trailing separator + * (unless it is the path itself). */ + +static const char *fix_mcwd(char *ans) +{ + FILE *fp; + char *s; + char buf[MAX_PATH]; + + fp = open_mcwd("r"); + if(!fp || !fgets(buf, MAX_PATH, fp)) { + if(fp) + fclose(fp); + ans[0] = get_default_drive(); + strcpy(ans+1, ":/"); + return ans; + } + + buf[strlen(buf) -1] = '\0'; + fclose(fp); + /* drive letter present? */ + s = buf; + if (buf[0] && buf[1] == ':') { + strncpy(ans, buf, 2); + ans[2] = '\0'; + s = &buf[2]; + } else { + ans[0] = get_default_drive(); + strcpy(ans+1, ":"); + } + /* add a leading separator */ + if (*s != '/' && *s != '\\') { + strcat(ans, "/"); + strcat(ans, s); + } else + strcat(ans, s); + +#if 0 + /* translate to upper case */ + for (s = ans; *s; ++s) { + *s = toupper(*s); + if (*s == '\\') + *s = '/'; + } +#endif + /* if only drive, colon, & separator */ + if (strlen(ans) == 3) + return(ans); + /* zap the trailing separator */ + if (*--s == '/') + *s = '\0'; + return ans; +} + int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg, int follow_dir_link); static int _unix_loop(Stream_t *Dir, MainParam_t *mp, const char *filename) { - unix_dir_loop(Dir, mp); - return GOT_ONE; + return unix_dir_loop(Dir, mp); } int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg, int follow_dir_link) @@ -355,7 +409,7 @@ drive = mp->mcwd[0]; cwd = mp->mcwd+2; } else { - drive = 'A'; + drive = get_default_drive(); } if(*pathname=='/') /* absolute path name */ diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mattrib.1 mtools/mattrib.1 --- mtools-3.9.10/mattrib.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mattrib.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mattrib 1 "28Feb05" mtools-3.9.10 +.TH mattrib 1 "02Mar05" mtools-3.9.10 .SH Name mattrib - change MSDOS file attribute flags '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mbadblocks.1 mtools/mbadblocks.1 --- mtools-3.9.10/mbadblocks.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mbadblocks.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mbadblocks 1 "28Feb05" mtools-3.9.10 +.TH mbadblocks 1 "02Mar05" mtools-3.9.10 .SH Name mbadblocks - tests a floppy disk, and marks the bad blocks in the FAT '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mcat.1 mtools/mcat.1 --- mtools-3.9.10/mcat.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mcat.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mcat 1 "28Feb05" mtools-3.9.10 +.TH mcat 1 "02Mar05" mtools-3.9.10 .SH Name mcat - dump raw disk image '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mcd.1 mtools/mcd.1 --- mtools-3.9.10/mcd.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mcd.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mcd 1 "28Feb05" mtools-3.9.10 +.TH mcd 1 "02Mar05" mtools-3.9.10 .SH Name mcd - change MSDOS directory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mclasserase.1 mtools/mclasserase.1 --- mtools-3.9.10/mclasserase.1 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mclasserase.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mclasserase 1 "28Feb05" mtools-3.9.10 +.TH mclasserase 1 "02Mar05" mtools-3.9.10 .SH Name mclasserase - erase memory cards '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mclasserase.c mtools/mclasserase.c --- mtools-3.9.10/mclasserase.c 2004-02-28 19:42:27.000000000 +0100 +++ mtools/mclasserase.c 2006-05-25 22:36:45.000000000 +0200 @@ -59,12 +59,12 @@ void do_mclasserase(char drive,int debug) { struct device dev; /* Device information structure */ - struct bootsector boot0; + unsigned char boot0[MAX_BOOT]; /* Bootsector information structure has to be here. some compilers don't do preprocessor statements if they're not in first row. */ -#define boot (&boot0) + struct bootsector *boot = (struct bootsector *) boot0; int media; /* Just used to enter some in find_device */ char name[EXPAND_BUF]; Stream_t *Stream; diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mcopy.1 mtools/mcopy.1 --- mtools-3.9.10/mcopy.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mcopy.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mcopy 1 "28Feb05" mtools-3.9.10 +.TH mcopy 1 "02Mar05" mtools-3.9.10 .SH Name mcopy - copy MSDOS files to/from Unix '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mdel.1 mtools/mdel.1 --- mtools-3.9.10/mdel.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mdel.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mdel 1 "28Feb05" mtools-3.9.10 +.TH mdel 1 "02Mar05" mtools-3.9.10 .SH Name mdel - delete an MSDOS file mdeltree - recursively delete an MSDOS directory and its contents diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mdel.c mtools/mdel.c --- mtools-3.9.10/mdel.c 2005-02-13 15:49:22.000000000 +0100 +++ mtools/mdel.c 2005-10-11 23:20:06.000000000 +0200 @@ -125,7 +125,7 @@ fprintf(stderr, "Mtools version %s, dated %s\n", mversion, mdate); fprintf(stderr, - "Usage: %s [-v] msdosfile [msdosfiles...]", progname); + "Usage: %s [-v] msdosfile [msdosfiles...]\n", progname); exit(1); } diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mdeltree.1 mtools/mdeltree.1 --- mtools-3.9.10/mdeltree.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mdeltree.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mdeltree 1 "28Feb05" mtools-3.9.10 +.TH mdeltree 1 "02Mar05" mtools-3.9.10 .SH Name mdeltree - recursively delete an MSDOS directory and its contents '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mdir.1 mtools/mdir.1 --- mtools-3.9.10/mdir.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mdir.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mdir 1 "28Feb05" mtools-3.9.10 +.TH mdir 1 "02Mar05" mtools-3.9.10 .SH Name mdir - display an MSDOS directory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mdu.1 mtools/mdu.1 --- mtools-3.9.10/mdu.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mdu.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mdu 1 "28Feb05" mtools-3.9.10 +.TH mdu 1 "02Mar05" mtools-3.9.10 .SH Name mdu - display the amount of space occupied by an MSDOS directory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mformat.1 mtools/mformat.1 --- mtools-3.9.10/mformat.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mformat.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mformat 1 "28Feb05" mtools-3.9.10 +.TH mformat 1 "02Mar05" mtools-3.9.10 .SH Name mformat - add an MSDOS filesystem to a low-level formatted floppy disk '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mformat.c mtools/mformat.c --- mtools-3.9.10/mformat.c 2004-05-04 20:18:31.000000000 +0200 +++ mtools/mformat.c 2006-03-04 14:54:37.000000000 +0100 @@ -689,6 +689,51 @@ exit(1); } +static int get_block_geom(int fd, struct MT_STAT *buf, struct device *dev, + char *errmsg) { + struct hd_geometry geom; + long size; + int heads=dev->heads; + int sectors=dev->sectors; + int sect_per_track; + + if (ioctl(fd, HDIO_GETGEO, &geom) < 0) { + sprintf(errmsg, "Could not get geometry of device (%s)", + strerror(errno)); + return -1; + } + + if (ioctl(fd, BLKGETSIZE, &size) < 0) { + sprintf(errmsg, "Could not get size of device (%s)", + strerror(errno)); + return -1; + } + + if(!heads) + heads = geom.heads; + if(!sectors) + sectors = geom.sectors; + + sect_per_track = heads * sectors; + if(!dev->hidden) { + int hidden; + hidden = geom.start % sect_per_track; + if(hidden && hidden != sectors) { + sprintf(errmsg, + "Hidden (%d) does not match sectors (%d)\n", + hidden, sectors); + return -1; + } + dev->hidden = hidden; + } + dev->heads = heads; + dev->sectors = sectors; + if(!dev->tracks) + dev->tracks = (size + dev->hidden) / sect_per_track; + size = dev->tracks * dev->heads * dev->sectors + dev->hidden; + return 0; +} + void mformat(int argc, char **argv, int dummy) { int r; /* generic return value */ @@ -997,29 +1042,9 @@ continue; } - if (S_ISBLK(buf.st_mode)) { - struct hd_geometry geom; - long size; - int sect_per_track; - - if (ioctl(fd, HDIO_GETGEO, &geom) < 0) { - sprintf(errmsg, "Could not get geometry of device (%s)", - strerror(errno)); - continue; - } - - if (ioctl(fd, BLKGETSIZE, &size) < 0) { - sprintf(errmsg, "Could not get size of device (%s)", - strerror(errno)); - continue; - } - - sect_per_track = geom.heads * geom.sectors; - used_dev.heads = geom.heads; - used_dev.sectors = geom.sectors; - used_dev.hidden = geom.start % sect_per_track; - used_dev.tracks = (size + used_dev.hidden) / sect_per_track; - } + if (S_ISBLK(buf.st_mode) && + get_block_geom(fd, &buf, &used_dev, errmsg) < 0) + continue; } #endif @@ -1091,7 +1116,7 @@ if(bootSector) { int fd; - fd = open(bootSector, O_RDONLY | O_LARGEFILE); + fd = open(bootSector, O_RDONLY | O_BINARY | O_LARGEFILE); if(fd < 0) { perror("open boot sector"); exit(1); diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/minfo.1 mtools/minfo.1 --- mtools-3.9.10/minfo.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/minfo.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH minfo 1 "28Feb05" mtools-3.9.10 +.TH minfo 1 "02Mar05" mtools-3.9.10 .SH Name minfo - print the parameters of a MSDOS filesystem '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/minfo.c mtools/minfo.c --- mtools-3.9.10/minfo.c 2003-05-17 15:01:29.000000000 +0200 +++ mtools/minfo.c 2006-05-25 21:59:57.000000000 +0200 @@ -42,8 +42,9 @@ void minfo(int argc, char **argv, int type) { - struct bootsector boot0; -#define boot (&boot0) + unsigned char boot0[MAX_BOOT]; + struct bootsector *boot = (struct bootsector *) boot0; + char name[EXPAND_BUF]; int media; int tot_sectors; diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/misc.c mtools/misc.c --- mtools-3.9.10/misc.c 2002-05-01 11:57:02.000000000 +0200 +++ mtools/misc.c 2005-10-11 23:14:10.000000000 +0200 @@ -103,58 +103,6 @@ } -/* Fix the info in the MCWD file to be a proper directory name. - * Always has a leading separator. Never has a trailing separator - * (unless it is the path itself). */ - -const char *fix_mcwd(char *ans) -{ - FILE *fp; - char *s; - char buf[MAX_PATH]; - - fp = open_mcwd("r"); - if(!fp){ - strcpy(ans, "A:/"); - return ans; - } - - if (!fgets(buf, MAX_PATH, fp)) - return("A:/"); - - buf[strlen(buf) -1] = '\0'; - fclose(fp); - /* drive letter present? */ - s = buf; - if (buf[0] && buf[1] == ':') { - strncpy(ans, buf, 2); - ans[2] = '\0'; - s = &buf[2]; - } else - strcpy(ans, "A:"); - /* add a leading separator */ - if (*s != '/' && *s != '\\') { - strcat(ans, "/"); - strcat(ans, s); - } else - strcat(ans, s); - -#if 0 - /* translate to upper case */ - for (s = ans; *s; ++s) { - *s = toupper(*s); - if (*s == '\\') - *s = '/'; - } -#endif - /* if only drive, colon, & separator */ - if (strlen(ans) == 3) - return(ans); - /* zap the trailing separator */ - if (*--s == '/') - *s = '\0'; - return ans; -} void *safe_malloc(size_t size) { diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mkmanifest.1 mtools/mkmanifest.1 --- mtools-3.9.10/mkmanifest.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mkmanifest.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mkmanifest 1 "28Feb05" mtools-3.9.10 +.TH mkmanifest 1 "02Mar05" mtools-3.9.10 .SH Name mkmanifest - makes list of file names and their DOS 8+3 equivalent '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mlabel.1 mtools/mlabel.1 --- mtools-3.9.10/mlabel.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mlabel.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mlabel 1 "28Feb05" mtools-3.9.10 +.TH mlabel 1 "02Mar05" mtools-3.9.10 .SH Name mlabel - make an MSDOS volume label '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mmd.1 mtools/mmd.1 --- mtools-3.9.10/mmd.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mmd.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mmd 1 "28Feb05" mtools-3.9.10 +.TH mmd 1 "02Mar05" mtools-3.9.10 .SH Name mmd - make an MSDOS subdirectory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mmount.1 mtools/mmount.1 --- mtools-3.9.10/mmount.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mmount.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mmount 1 "28Feb05" mtools-3.9.10 +.TH mmount 1 "02Mar05" mtools-3.9.10 .SH Name mmount - mount an MSDOS disk '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mmount.c mtools/mmount.c --- mtools-3.9.10/mmount.c 2002-11-02 00:16:50.000000000 +0100 +++ mtools/mmount.c 2006-05-25 22:01:44.000000000 +0200 @@ -27,7 +27,8 @@ struct device dev; char name[EXPAND_BUF]; int media; - struct bootsector boot; + unsigned char boot0[MAX_BOOT]; + struct bootsector *boot = (struct bootsector *) boot0; Stream_t *Stream; if (argc<2 || !argv[1][0] || argv[1][1] != ':' || argv[1][2]){ @@ -35,7 +36,7 @@ exit(1); } drive = toupper(argv[1][0]); - Stream = find_device(drive, O_RDONLY, &dev, &boot, name, &media, 0); + Stream = find_device(drive, O_RDONLY, &dev, boot, name, &media, 0); if(!Stream) exit(1); FREE(&Stream); @@ -55,12 +56,12 @@ exit(1); case 0: close(2); - open("/dev/null", O_RDWR | O_LARGEFILE); + open("/dev/null", O_RDWR | O_BINARY | O_LARGEFILE); argv[1] = strdup("mount"); if ( argc > 2 ) execvp("mount", argv + 1 ); else - execlp("mount", "mount", name, 0); + execlp("mount", "mount", name, NULL); perror("exec mount"); exit(1); default: @@ -77,7 +78,7 @@ if ( argc > 2 ) execvp("mount", argv); else - execlp("mount", "mount","-r", name, 0); + execlp("mount", "mount","-r", name, NULL); exit(1); } diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mmove.1 mtools/mmove.1 --- mtools-3.9.10/mmove.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mmove.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mmove 1 "28Feb05" mtools-3.9.10 +.TH mmove 1 "02Mar05" mtools-3.9.10 .SH Name mmove - move or rename an MSDOS file or subdirectory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mpartition.1 mtools/mpartition.1 --- mtools-3.9.10/mpartition.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mpartition.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mpartition 1 "28Feb05" mtools-3.9.10 +.TH mpartition 1 "02Mar05" mtools-3.9.10 .SH Name mpartition - partition an MSDOS hard disk '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mpartition.c mtools/mpartition.c --- mtools-3.9.10/mpartition.c 2003-05-17 15:25:48.000000000 +0200 +++ mtools/mpartition.c 2006-05-25 22:04:10.000000000 +0200 @@ -78,11 +78,12 @@ } int consistencyCheck(struct partition *partTable, int doprint, int verbose, - int *has_activated, unsigned int *last_end, int *j, + int *has_activated, unsigned int *last_end, + unsigned int *j, struct device *used_dev, int target_partition) { - int i; - int inconsistency; + unsigned int i; + unsigned int inconsistency; *j = 0; *last_end = 1; @@ -504,7 +505,7 @@ if(initialize) { if (bootSector) { int fd; - fd = open(bootSector, O_RDONLY | O_LARGEFILE); + fd = open(bootSector, O_RDONLY | O_BINARY | O_LARGEFILE); if (fd < 0) { perror("open boot sector"); exit(1); diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mrd.1 mtools/mrd.1 --- mtools-3.9.10/mrd.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mrd.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mrd 1 "28Feb05" mtools-3.9.10 +.TH mrd 1 "02Mar05" mtools-3.9.10 .SH Name mrd - remove an MSDOS subdirectory '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mren.1 mtools/mren.1 --- mtools-3.9.10/mren.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mren.1 2005-03-02 21:56:04.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mren 1 "28Feb05" mtools-3.9.10 +.TH mren 1 "02Mar05" mtools-3.9.10 .SH Name mren - rename an existing MSDOS file '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/msdos.h mtools/msdos.h --- mtools-3.9.10/msdos.h 2003-05-17 15:00:22.000000000 +0200 +++ mtools/msdos.h 2006-05-25 21:58:51.000000000 +0200 @@ -162,6 +162,8 @@ struct oldboot_t old; } ext; }; +#define MAX_BOOT 4096 + #define CHAR(x) (boot->x[0]) #define WORD(x) (_WORD(boot->x)) diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mshowfat.1 mtools/mshowfat.1 --- mtools-3.9.10/mshowfat.1 2005-02-28 23:14:32.000000000 +0100 +++ mtools/mshowfat.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mshowfat 1 "28Feb05" mtools-3.9.10 +.TH mshowfat 1 "02Mar05" mtools-3.9.10 .SH Name mshowfat - shows FAT clusters allocated to file '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtools.1 mtools/mtools.1 --- mtools-3.9.10/mtools.1 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mtools.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,5 +1,5 @@ '\" t -.TH mtools.1 3 "28Feb05" mtools-3.9.10 +.TH mtools.1 3 "02Mar05" mtools-3.9.10 .SH Name mtools - utilities to access DOS disks in Unix. '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtools.5 mtools/mtools.5 --- mtools-3.9.10/mtools.5 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mtools.5 2005-03-02 21:56:05.000000000 +0100 @@ -1,5 +1,5 @@ '\" t -.TH mtools.1 3 "28Feb05" MTOOLS MTOOLS +.TH mtools.1 3 "02Mar05" MTOOLS MTOOLS .SH Name mtools.conf - mtools configuration files '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtools.h mtools/mtools.h --- mtools-3.9.10/mtools.h 2005-02-13 14:41:29.000000000 +0100 +++ mtools/mtools.h 2006-05-25 22:33:32.000000000 +0200 @@ -156,6 +156,7 @@ extern int batchmode; +char get_default_drive(void); void set_cmd_line_image(char *img, int flags); void read_config(void); extern struct device *devices; @@ -224,7 +225,6 @@ char *get_homedir(void); #define EXPAND_BUF 2048 const char *expand(const char *, char *); -const char *fix_mcwd(char *); FILE *open_mcwd(const char *mode); void unlink_mcwd(void); @@ -233,4 +233,8 @@ #define ROUND_DOWN(value, grain) ((value) - (value) % (grain)) #define ROUND_UP(value, grain) ROUND_DOWN((value) + (grain)-1, (grain)) +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtools.spec mtools/mtools.spec --- mtools-3.9.10/mtools.spec 2005-03-02 22:18:40.000000000 +0100 +++ mtools/mtools.spec 2005-11-15 22:18:55.000000000 +0100 @@ -1,10 +1,11 @@ Summary: mtools, read/write/list/format DOS disks under Unix Name: mtools Version: 3.9.10 -Release: 1 +Release: 2 Group: Utilities/System URL: http://mtools.linux.lu Source0: mtools-%{version}.tar.gz +Patch1: mtools-%{version}-20051011.diff.gz Buildroot: %{_tmppath}/%{name}-%{version}-buildroot License: GPL %description @@ -16,6 +17,7 @@ %prep %setup -q +%patch1 -p1 ./configure --prefix=%{buildroot}%{_prefix} --sysconfdir=/etc --infodir=%{buildroot}%{_infodir} --mandir=%{buildroot}%{_mandir} %build @@ -30,6 +32,7 @@ strip %{buildroot}%{_bindir}/mtools %{buildroot}%{_bindir}/mkmanifest %{buildroot}%{_bindir}/floppyd %files +%defattr(-,root,root) %{_infodir}/mtools.info* %{_mandir}/man1/floppyd.1* %{_mandir}/man1/floppyd_installtest.1.gz diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtoolstest.1 mtools/mtoolstest.1 --- mtools-3.9.10/mtoolstest.1 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mtoolstest.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mtoolstest 1 "28Feb05" mtools-3.9.10 +.TH mtoolstest 1 "02Mar05" mtools-3.9.10 .SH Name mtoolstest - tests and displays the configuration '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mtype.1 mtools/mtype.1 --- mtools-3.9.10/mtype.1 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mtype.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mtype 1 "28Feb05" mtools-3.9.10 +.TH mtype 1 "02Mar05" mtools-3.9.10 .SH Name mtype - display contents of an MSDOS file '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/mzip.1 mtools/mzip.1 --- mtools-3.9.10/mzip.1 2005-02-28 23:14:33.000000000 +0100 +++ mtools/mzip.1 2005-03-02 21:56:05.000000000 +0100 @@ -1,4 +1,4 @@ -.TH mzip 1 "28Feb05" mtools-3.9.10 +.TH mzip 1 "02Mar05" mtools-3.9.10 .SH Name mzip - change protection mode and eject disk on Zip/Jaz drive '\" t diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/partition.h mtools/partition.h --- mtools-3.9.10/partition.h 2003-05-17 15:27:13.000000000 +0200 +++ mtools/partition.h 2006-05-25 22:04:31.000000000 +0200 @@ -24,7 +24,8 @@ #define sys_ind end.byte0 int consistencyCheck(struct partition *partTable, int doprint, int verbose, - int *has_activated, unsigned int *last_end, int *j, + int *has_activated, unsigned int *last_end, + unsigned int *j, struct device *used_dev, int target_partition); void setBeginEnd(struct partition *partTable, int begin, int end, diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/patchlevel.c mtools/patchlevel.c --- mtools-3.9.10/patchlevel.c 2005-03-02 22:18:58.000000000 +0100 +++ mtools/patchlevel.c 2006-05-25 23:00:59.000000000 +0200 @@ -1,2 +1,5 @@ const char *mversion="3.9.10"; -const char *mdate = "March 2nd, 2005"; + +/* Multiple releases on same day should be marked with (b), (cd), (d) after + * date string below */ +const char *mdate = "May 25th, 2006"; diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/plain_io.c mtools/plain_io.c --- mtools-3.9.10/plain_io.c 2005-02-22 23:13:37.000000000 +0100 +++ mtools/plain_io.c 2006-05-25 22:18:23.000000000 +0200 @@ -17,10 +17,6 @@ #include "partition.h" #include "llong.h" -#ifndef O_BINARY -#define O_BINARY 0 -#endif - typedef struct SimpleFile_t { Class_t *Class; int refs; @@ -673,7 +669,8 @@ while(!(mode2 & NO_OFFSET) && dev && dev->partition && dev->partition <= 4) { - int has_activated, last_end, j; + int has_activated; + unsigned int last_end, j; unsigned char buf[2048]; struct partition *partTable=(struct partition *)(buf+ 0x1ae); size_t partOff; diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/scsi.c mtools/scsi.c --- mtools-3.9.10/scsi.c 2002-11-02 13:09:28.000000000 +0100 +++ mtools/scsi.c 2005-04-10 09:20:04.000000000 +0200 @@ -73,7 +73,7 @@ else return -1; #else - return open(name, O_RDONLY | O_LARGEFILE | + return open(name, O_RDONLY | O_LARGEFILE | O_BINARY | #ifdef O_NDELAY O_NDELAY #endif diff -ur --new-file --exclude-from=/home/aknaff/Projects/exclude mtools-3.9.10/stream.h mtools/stream.h --- mtools-3.9.10/stream.h 2002-05-01 11:57:02.000000000 +0200 +++ mtools/stream.h 2005-10-11 22:54:23.000000000 +0200 @@ -58,8 +58,6 @@ int force_write(Stream_t *Stream, char *buf, mt_off_t start, size_t len); int force_read(Stream_t *Stream, char *buf, mt_off_t start, size_t len); -extern struct Stream_t *default_drive; - int get_data_pass_through(Stream_t *Stream, time_t *date, mt_size_t *size, int *type, int *address);