diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-01-14 10:51:41 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-01-14 10:51:41 +0900 |
commit | f905f5aada0700ef4be96749655f46a79d912c35 (patch) | |
tree | 3e448d08c452ebf020519ee8d6161a2a69f413bb | |
parent | 0ecb2dba7f37161dee9939bc6d376c0e4bede2d4 (diff) | |
download | mtools-f905f5aada0700ef4be96749655f46a79d912c35.tar.gz mtools-f905f5aada0700ef4be96749655f46a79d912c35.tar.bz2 mtools-f905f5aada0700ef4be96749655f46a79d912c35.zip |
Imported Upstream version 4.0.22upstream/4.0.22
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | config.c | 6 | ||||
-rw-r--r-- | config.h.in | 46 | ||||
-rwxr-xr-x | configure | 300 | ||||
-rw-r--r-- | configure-stamp | 0 | ||||
-rw-r--r-- | configure.in | 13 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | file_name.c | 4 | ||||
-rw-r--r-- | floppyd.1 | 2 | ||||
-rw-r--r-- | floppyd_installtest.1 | 2 | ||||
-rw-r--r-- | mainloop.c | 4 | ||||
-rw-r--r-- | match.c | 6 | ||||
-rw-r--r-- | mattrib.1 | 2 | ||||
-rw-r--r-- | mbadblocks.1 | 2 | ||||
-rw-r--r-- | mcat.1 | 2 | ||||
-rw-r--r-- | mcat.c | 2 | ||||
-rw-r--r-- | mcd.1 | 2 | ||||
-rw-r--r-- | mclasserase.1 | 2 | ||||
-rw-r--r-- | mclasserase.c | 4 | ||||
-rw-r--r-- | mcopy.1 | 2 | ||||
-rw-r--r-- | mdel.1 | 2 | ||||
-rw-r--r-- | mdeltree.1 | 2 | ||||
-rw-r--r-- | mdir.1 | 2 | ||||
-rw-r--r-- | mdu.1 | 2 | ||||
-rw-r--r-- | mformat.1 | 2 | ||||
-rw-r--r-- | mformat.c | 2 | ||||
-rw-r--r-- | minfo.1 | 2 | ||||
-rw-r--r-- | minfo.c | 4 | ||||
-rw-r--r-- | mk_direntry.c | 2 | ||||
-rw-r--r-- | mkmanifest.1 | 2 | ||||
-rw-r--r-- | mkmanifest.c | 2 | ||||
-rw-r--r-- | mlabel.1 | 2 | ||||
-rw-r--r-- | mlabel.c | 2 | ||||
-rw-r--r-- | mmd.1 | 2 | ||||
-rw-r--r-- | mmount.1 | 2 | ||||
-rw-r--r-- | mmount.c | 2 | ||||
-rw-r--r-- | mmove.1 | 2 | ||||
-rw-r--r-- | mmove.c | 4 | ||||
-rw-r--r-- | mpartition.1 | 2 | ||||
-rw-r--r-- | mpartition.c | 2 | ||||
-rw-r--r-- | mrd.1 | 2 | ||||
-rw-r--r-- | mren.1 | 2 | ||||
-rw-r--r-- | mshortname.1 | 2 | ||||
-rw-r--r-- | mshowfat.1 | 2 | ||||
-rw-r--r-- | mtools.1 | 10 | ||||
-rw-r--r-- | mtools.5 | 4 | ||||
-rw-r--r-- | mtools.h | 10 | ||||
-rw-r--r-- | mtools.info | 12 | ||||
-rw-r--r-- | mtools.spec | 5 | ||||
-rw-r--r-- | mtools.tmpl.1 | 10 | ||||
-rw-r--r-- | mtools.tmpl.5 | 4 | ||||
-rw-r--r-- | mtoolstest.1 | 2 | ||||
-rw-r--r-- | mtype.1 | 2 | ||||
-rw-r--r-- | mzip.1 | 2 | ||||
-rw-r--r-- | mzip.c | 2 | ||||
-rw-r--r-- | old_dos.c | 7 | ||||
-rw-r--r-- | patchlevel.c | 6 | ||||
-rw-r--r-- | sysincludes.h | 2 | ||||
-rw-r--r-- | version.texi | 6 |
59 files changed, 461 insertions, 84 deletions
@@ -1,3 +1,6 @@ +v4_0_22 + - Fixed -f flag for mformat (size is KBytes, rather than sectors) + - Fixed toupper/tolower usage (unsigned char rather than plain signed) v4_0_21 - Fixed compilation for MingW - After MingW compilation, make sure executable has .exe extension @@ -176,12 +176,6 @@ static switches_t dswitches[]= { { "CODEPAGE", OFFS(codepage), T_UINT } }; -static __inline__ char ch_toupper(char ch) -{ - return (char) toupper( (unsigned char) ch); -} - - static void maintain_default_drive(char drive) { if(default_drive == ':') diff --git a/config.h.in b/config.h.in index db7abbc..665b2ca 100644 --- a/config.h.in +++ b/config.h.in @@ -417,14 +417,60 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef gid_t + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + +/* Define to `long int' if <sys/types.h> does not define. */ +#undef off_t + /* Define to `unsigned int' if <sys/types.h> does not define. */ #undef size_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef ssize_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t @@ -1731,6 +1731,136 @@ fi } # ac_fn_c_try_link +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -4446,6 +4576,176 @@ fi done +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <signal.h> + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + + ac_fn_c_check_type "$LINENO" "caddr_t" "ac_cv_type_caddr_t" "$ac_includes_default" if test "x$ac_cv_type_caddr_t" = xyes; then : diff --git a/configure-stamp b/configure-stamp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/configure-stamp diff --git a/configure.in b/configure.in index 42504db..f0a856f 100644 --- a/configure.in +++ b/configure.in @@ -100,6 +100,19 @@ iconv.h wctype.h wchar.h locale.h linux/fs.h) AC_CHECK_HEADERS(termio.h sys/termio.h, [break]) AC_CHECK_HEADERS(termios.h sys/termios.h, [break]) +dnl Check for types +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_SSIZE_T +AC_TYPE_SIZE_T +AC_TYPE_OFF_T +AC_TYPE_SIGNAL +AC_TYPE_UID_T + AC_CHECK_TYPES(caddr_t) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(time_t) diff --git a/debian/changelog b/debian/changelog index 0959bf4..bd4256c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +mtools (4.0.22) stable; urgency=low + * Fixed -f flag for mformat (size is KBytes, rather than sectors) + * Fixed toupper/tolower usage (unsigned char rather than plain signed) + -- Alain Knaff <alain@knaff.lu> Sun, 2 Dec 2018 18:29:59 +0100 + mtools (4.0.21) stable; urgency=low * Fixed compilation for MingW * After MingW compilation, make sure executable has .exe extension diff --git a/file_name.c b/file_name.c index cad4381..caef196 100644 --- a/file_name.c +++ b/file_name.c @@ -169,7 +169,7 @@ wchar_t *unix_name(doscp_t *dosCp, if(Case & BASECASE) for(i=0;i<8 && tname[i];i++) - tname[i] = tolower(tname[i]); + tname[i] = ch_tolower(tname[i]); strncpy(text, ext, 3); text[3] = '\0'; @@ -178,7 +178,7 @@ wchar_t *unix_name(doscp_t *dosCp, if(Case & EXTCASE) for(i=0;i<3 && text[i];i++) - text[i] = tolower(text[i]); + text[i] = ch_tolower(text[i]); if (*text) { strcpy(ans, tname); @@ -1,5 +1,5 @@ '\" t -.TH floppyd 1 "24Nov18" mtools-4.0.21 +.TH floppyd 1 "02Dec18" mtools-4.0.22 .SH Name floppyd - floppy daemon for remote access to floppy drive '\" t diff --git a/floppyd_installtest.1 b/floppyd_installtest.1 index 9f3faa1..92d0373 100644 --- a/floppyd_installtest.1 +++ b/floppyd_installtest.1 @@ -1,5 +1,5 @@ '\" t -.TH floppyd_installtest 1 "24Nov18" mtools-4.0.21 +.TH floppyd_installtest 1 "02Dec18" mtools-4.0.22 .SH Name floppyd_installtest - tests whether floppyd is installed and running '\" t @@ -71,7 +71,7 @@ static const char *fix_mcwd(char *ans) #if 0 /* translate to upper case */ for (s = ans; *s; ++s) { - *s = toupper(*s); + *s = ch_toupper(*s); if (*s == '\\') *s = '/'; } @@ -433,7 +433,7 @@ static int common_dos_loop(MainParam_t *mp, const char *pathname, drive='\0'; cwd = ""; if(*pathname && pathname[1] == ':') { - drive = toupper(*pathname); + drive = ch_toupper(*pathname); pathname += 2; if(mp->mcwd[0] == drive) cwd = mp->mcwd+2; @@ -25,7 +25,7 @@ static int casecmp(wchar_t a, wchar_t b) { - return towupper(a) == towupper(b); + return towupper((wint_t)a) == towupper((wint_t)b); } static int exactcmp(wchar_t a,wchar_t b) @@ -81,12 +81,12 @@ static int parse_range(const wchar_t **p, const wchar_t *s, wchar_t *out, return reverse; if(is_in_range((wchar_t)towlower((wint_t)*s), &p0, &reverse)) { if(out) - *out = tolower(*s); + *out = (wchar_t)towlower((wint_t)*s); return 1 ^ reverse; } if(is_in_range((wchar_t)towupper((wint_t)*s), &p1, &reverse)) { if(out) - *out = toupper(*s); + *out = (wchar_t)towupper((wint_t)*s); return 1 ^ reverse; } return reverse; @@ -1,5 +1,5 @@ '\" t -.TH mattrib 1 "24Nov18" mtools-4.0.21 +.TH mattrib 1 "02Dec18" mtools-4.0.22 .SH Name mattrib - change MSDOS file attribute flags '\" t diff --git a/mbadblocks.1 b/mbadblocks.1 index b573c61..6c4942d 100644 --- a/mbadblocks.1 +++ b/mbadblocks.1 @@ -1,5 +1,5 @@ '\" t -.TH mbadblocks 1 "24Nov18" mtools-4.0.21 +.TH mbadblocks 1 "02Dec18" mtools-4.0.22 .SH Name mbadblocks - tests a floppy disk, and marks the bad blocks in the FAT '\" t @@ -1,5 +1,5 @@ '\" t -.TH mcat 1 "24Nov18" mtools-4.0.21 +.TH mcat 1 "02Dec18" mtools-4.0.22 .SH Name mcat - dump raw disk image '\" t @@ -92,7 +92,7 @@ void mcat(int argc, char **argv, int type UNUSEDP) usage(); } - drive = toupper(argv[optindex][0]); + drive = ch_toupper(argv[optindex][0]); /* check out a drive whose letter and parameters match */ sprintf(errmsg, "Drive '%c:' not supported", drive); @@ -1,5 +1,5 @@ '\" t -.TH mcd 1 "24Nov18" mtools-4.0.21 +.TH mcd 1 "02Dec18" mtools-4.0.22 .SH Name mcd - change MSDOS directory '\" t diff --git a/mclasserase.1 b/mclasserase.1 index 7ea5daa..01b16e6 100644 --- a/mclasserase.1 +++ b/mclasserase.1 @@ -1,5 +1,5 @@ '\" t -.TH mclasserase 1 "24Nov18" mtools-4.0.21 +.TH mclasserase 1 "02Dec18" mtools-4.0.22 .SH Name mclasserase - erase memory cards '\" t diff --git a/mclasserase.c b/mclasserase.c index 59937d1..f99dd65 100644 --- a/mclasserase.c +++ b/mclasserase.c @@ -146,7 +146,7 @@ static void do_mclasserase(char drive,int debug) } /* Forming cat command to overwrite the medias content. */ - sprintf( drivel, "%c:", tolower(drive) ); + sprintf( drivel, "%c:", ch_tolower(drive) ); #if 0 media_sectors = dev.tracks * dev.sectors; @@ -339,7 +339,7 @@ void mclasserase(int argc, char **argv, int type UNUSEDP) { usage(1); } - drive = toupper(argv[optind][0]); + drive = ch_toupper(argv[optind][0]); } } #ifdef DEBUG @@ -1,5 +1,5 @@ '\" t -.TH mcopy 1 "24Nov18" mtools-4.0.21 +.TH mcopy 1 "02Dec18" mtools-4.0.22 .SH Name mcopy - copy MSDOS files to/from Unix '\" t @@ -1,5 +1,5 @@ '\" t -.TH mdel 1 "24Nov18" mtools-4.0.21 +.TH mdel 1 "02Dec18" mtools-4.0.22 .SH Name mdel - delete an MSDOS file '\" t @@ -1,5 +1,5 @@ '\" t -.TH mdeltree 1 "24Nov18" mtools-4.0.21 +.TH mdeltree 1 "02Dec18" mtools-4.0.22 .SH Name mdeltree - recursively delete an MSDOS directory and its contents '\" t @@ -1,5 +1,5 @@ '\" t -.TH mdir 1 "24Nov18" mtools-4.0.21 +.TH mdir 1 "02Dec18" mtools-4.0.22 .SH Name mdir - display an MSDOS directory '\" t @@ -1,5 +1,5 @@ '\" t -.TH mdu 1 "24Nov18" mtools-4.0.21 +.TH mdu 1 "02Dec18" mtools-4.0.22 .SH Name mdu - display the amount of space occupied by an MSDOS directory '\" t @@ -1,5 +1,5 @@ '\" t -.TH mformat 1 "24Nov18" mtools-4.0.21 +.TH mformat 1 "02Dec18" mtools-4.0.22 .SH Name mformat - add an MSDOS filesystem to a low-level formatted floppy disk '\" t @@ -1133,7 +1133,7 @@ void mformat(int argc, char **argv, int dummy UNUSEDP) if(argc - optind == 1) { if(!argv[optind][0] || argv[optind][1] != ':') usage(1); - drive = toupper(argv[argc -1][0]); + drive = ch_toupper(argv[argc -1][0]); } else { drive = get_default_drive(); if(drive != ':') { @@ -1,5 +1,5 @@ '\" t -.TH minfo 1 "24Nov18" mtools-4.0.21 +.TH minfo 1 "02Dec18" mtools-4.0.22 .SH Name minfo - print the parameters of a MSDOS filesystem '\" t @@ -163,7 +163,7 @@ void minfo(int argc, char **argv, int type UNUSEDP) } else { if(!argv[optind][0] || argv[optind][1] != ':') usage(1); - drive = toupper(argv[optind][0]); + drive = ch_toupper(argv[optind][0]); } have_drive = 1; @@ -225,7 +225,7 @@ void minfo(int argc, char **argv, int type UNUSEDP) printf("-S %d ",size_code); if(imgFile != NULL) printf("-i \"%s\" ", imgFile); - printf("%c:\n", tolower(drive)); + printf("%c:\n", ch_tolower(drive)); printf("\n"); } diff --git a/mk_direntry.c b/mk_direntry.c index 79a3921..858e5af 100644 --- a/mk_direntry.c +++ b/mk_direntry.c @@ -677,7 +677,7 @@ int handle_clash_options(ClashHandling_t *ch, char c) isprimary = 0; else isprimary = 1; - c = tolower(c); + c = ch_tolower(c); switch(c) { case 'o': /* Overwrite if primary name matches */ diff --git a/mkmanifest.1 b/mkmanifest.1 index 191e267..b0bae8b 100644 --- a/mkmanifest.1 +++ b/mkmanifest.1 @@ -1,5 +1,5 @@ '\" t -.TH mkmanifest 1 "24Nov18" mtools-4.0.21 +.TH mkmanifest 1 "02Dec18" mtools-4.0.22 .SH Name mkmanifest - makes list of file names and their DOS 8+3 equivalent '\" t diff --git a/mkmanifest.c b/mkmanifest.c index 1b56b3d..2582fb4 100644 --- a/mkmanifest.c +++ b/mkmanifest.c @@ -79,7 +79,7 @@ static char *dos_name2(const char *name) ext = &buf[i+1]; } if (isupper((unsigned char)buf[i])) - buf[i] = tolower((unsigned char)buf[i]); + buf[i] = ch_tolower(buf[i]); } /* if no name */ if (*temp == '\0') @@ -1,5 +1,5 @@ '\" t -.TH mlabel 1 "24Nov18" mtools-4.0.21 +.TH mlabel 1 "02Dec18" mtools-4.0.22 .SH Name mlabel - make an MSDOS volume label '\" t @@ -183,7 +183,7 @@ void mlabel(int argc, char **argv, int type UNUSEDP) if(argc - optind == 1) { if(!argv[optind][0] || argv[optind][1] != ':') usage(1); - drive = toupper(argv[argc -1][0]); + drive = ch_toupper(argv[argc -1][0]); newLabel = argv[optind]+2; } else { drive = get_default_drive(); @@ -1,5 +1,5 @@ '\" t -.TH mmd 1 "24Nov18" mtools-4.0.21 +.TH mmd 1 "02Dec18" mtools-4.0.22 .SH Name mmd - make an MSDOS subdirectory '\" t @@ -1,5 +1,5 @@ '\" t -.TH mmount 1 "24Nov18" mtools-4.0.21 +.TH mmount 1 "02Dec18" mtools-4.0.22 .SH Name mmount - mount an MSDOS disk '\" t @@ -48,7 +48,7 @@ void mmount(int argc, char **argv, int type UNUSEDP) fprintf(stderr,"Usage: %s -V drive:\n", argv[0]); exit(1); } - drive = toupper(argv[1][0]); + drive = ch_toupper(argv[1][0]); Stream= find_device(drive, O_RDONLY, &dev, &boot, name, &media, 0, NULL); if(!Stream) exit(1); @@ -1,5 +1,5 @@ '\" t -.TH mmove 1 "24Nov18" mtools-4.0.21 +.TH mmove 1 "02Dec18" mtools-4.0.22 .SH Name mmove - move or rename an MSDOS file or subdirectory '\" t @@ -279,8 +279,8 @@ void mmove(int argc, char **argv, int oldsyntax) for(i=optind; i<argc; i++) if(argv[i][0] && argv[i][1] == ':' ){ if(!def_drive) - def_drive = toupper(argv[i][0]); - else if(def_drive != toupper(argv[i][0])){ + def_drive = ch_toupper(argv[i][0]); + else if(def_drive != ch_toupper(argv[i][0])){ fprintf(stderr, "Cannot move files across different drives\n"); exit(1); diff --git a/mpartition.1 b/mpartition.1 index ac30ac9..cd8f546 100644 --- a/mpartition.1 +++ b/mpartition.1 @@ -1,5 +1,5 @@ '\" t -.TH mpartition 1 "24Nov18" mtools-4.0.21 +.TH mpartition 1 "02Dec18" mtools-4.0.22 .SH Name mpartition - partition an MSDOS hard disk '\" t diff --git a/mpartition.c b/mpartition.c index 49c10a5..4aa8297 100644 --- a/mpartition.c +++ b/mpartition.c @@ -461,7 +461,7 @@ void mpartition(int argc, char **argv, int dummy UNUSEDP) !argv[optind][0] || argv[optind][1] != ':') usage(1); - drive = toupper(argv[optind][0]); + drive = ch_toupper(argv[optind][0]); /* check out a drive whose letter and parameters match */ sprintf(errmsg, "Drive '%c:' not supported", drive); @@ -1,5 +1,5 @@ '\" t -.TH mrd 1 "24Nov18" mtools-4.0.21 +.TH mrd 1 "02Dec18" mtools-4.0.22 .SH Name mrd - remove an MSDOS subdirectory '\" t @@ -1,5 +1,5 @@ '\" t -.TH mren 1 "24Nov18" mtools-4.0.21 +.TH mren 1 "02Dec18" mtools-4.0.22 .SH Name mren - rename an existing MSDOS file '\" t diff --git a/mshortname.1 b/mshortname.1 index bc7d01d..909bec3 100644 --- a/mshortname.1 +++ b/mshortname.1 @@ -1,5 +1,5 @@ '\" t -.TH mshortname 1 "24Nov18" mtools-4.0.21 +.TH mshortname 1 "02Dec18" mtools-4.0.22 .SH Name mshortname - shows short name of a file '\" t @@ -1,5 +1,5 @@ '\" t -.TH mshowfat 1 "24Nov18" mtools-4.0.21 +.TH mshowfat 1 "02Dec18" mtools-4.0.22 .SH Name mshowfat - shows FAT clusters allocated to file '\" t @@ -1,5 +1,5 @@ '\" t -.TH mtools 1 "24Nov18" mtools-4.0.21 +.TH mtools 1 "02Dec18" mtools-4.0.22 .SH Name mtools - utilities to access DOS disks in Unix. '\" t @@ -36,10 +36,10 @@ Mtools can be found at the following places (and their mirrors): .nf .ft 3 .in +0.3i -http://ftp.gnu.org/gnu/mtools/mtools-4.0.21.tar.gz -http://mtools.linux.lu/mtools-4.0.21.tar.gz -ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.21.tar.gz -ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.21.tar.gz +http://ftp.gnu.org/gnu/mtools/mtools-4.0.22.tar.gz +http://mtools.linux.lu/mtools-4.0.22.tar.gz +ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.22.tar.gz +ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.22.tar.gz .fi .in -0.3i .ft R @@ -1,5 +1,5 @@ '\" t -.TH mtools 5 "24Nov18" MTOOLS MTOOLS +.TH mtools 5 "02Dec18" MTOOLS MTOOLS .SH Name mtools.conf - mtools configuration files '\" t @@ -13,7 +13,7 @@ mtools.conf - mtools configuration files .tr \(if` .tr \(pd" -.ds St Mtools\ 4.0.21 +.ds St Mtools\ 4.0.22 .PP .SH Description .PP @@ -209,6 +209,16 @@ UNUSED(static __inline__ int compare (long ref, long testee)) return (ref && ref != testee); } +UNUSED(static __inline__ char ch_toupper(char ch)) +{ + return (char) toupper( (unsigned char) ch); +} + +UNUSED(static __inline__ char ch_tolower(char ch)) +{ + return (char) tolower( (unsigned char) ch); +} + Stream_t *GetFs(Stream_t *Fs); void label_name_uc(doscp_t *cp, const char *filename, int verbose, diff --git a/mtools.info b/mtools.info index b620b8c..0505f16 100644 --- a/mtools.info +++ b/mtools.info @@ -1,6 +1,6 @@ This is mtools.info, produced by makeinfo version 6.3 from mtools.texi. -This manual is for Mtools (version 4.0.21, November 2018), which is a +This manual is for Mtools (version 4.0.22, December 2018), which is a collection of tools to allow Unix systems to manipulate MS-DOS files. Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright @@ -41,7 +41,7 @@ preliminary mounting or initialization (assuming the default '/etc/mtools.conf' works on your machine). With mtools, one can change floppies too without unmounting and mounting. - This manual is for Mtools (version 4.0.21, November 2018), which is a + This manual is for Mtools (version 4.0.22, December 2018), which is a collection of tools to allow Unix systems to manipulate MS-DOS files. Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright @@ -75,10 +75,10 @@ File: mtools.info, Node: Location, Next: Common features, Prev: Top, Up: Top ********************* Mtools can be found at the following places (and their mirrors): - http://ftp.gnu.org/gnu/mtools/mtools-4.0.21.tar.gz - http://mtools.linux.lu/mtools-4.0.21.tar.gz - ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.21.tar.gz - ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.21.tar.gz + http://ftp.gnu.org/gnu/mtools/mtools-4.0.22.tar.gz + http://mtools.linux.lu/mtools-4.0.22.tar.gz + ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.22.tar.gz + ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.22.tar.gz Before reporting a bug, make sure that it has not yet been fixed in the Alpha patches which can be found at: diff --git a/mtools.spec b/mtools.spec index 7b3e8c0..2d6a238 100644 --- a/mtools.spec +++ b/mtools.spec @@ -1,7 +1,7 @@ %define _binary_payload w9.gzdio Name: mtools Summary: mtools, read/write/list/format DOS disks under Unix -Version: 4.0.21 +Version: 4.0.22 Release: 1 License: GPLv3+ Group: Utilities/System @@ -135,6 +135,9 @@ if [ -f %{_bindir}/install-info ] ; then fi %changelog +* Sun Dec 02 2018 Alain Knaff <alain@knaff.lu> +- Fixed -f flag for mformat (size is KBytes, rather than sectors) +- Fixed toupper/tolower usage (unsigned char rather than plain signed) * Sat Nov 24 2018 Alain Knaff <alain@knaff.lu> - Fixed compilation for MingW - After MingW compilation, make sure executable has .exe extension diff --git a/mtools.tmpl.1 b/mtools.tmpl.1 index 397d58c..a227862 100644 --- a/mtools.tmpl.1 +++ b/mtools.tmpl.1 @@ -1,5 +1,5 @@ '\" t -.TH mtools 1 "24Nov18" mtools-4.0.21 +.TH mtools 1 "02Dec18" mtools-4.0.22 .SH Name mtools - utilities to access DOS disks in Unix. '\" t @@ -36,10 +36,10 @@ Mtools can be found at the following places (and their mirrors): .nf .ft 3 .in +0.3i -http://ftp.gnu.org/gnu/mtools/mtools-4.0.21.tar.gz -http://mtools.linux.lu/mtools-4.0.21.tar.gz -ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.21.tar.gz -ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.21.tar.gz +http://ftp.gnu.org/gnu/mtools/mtools-4.0.22.tar.gz +http://mtools.linux.lu/mtools-4.0.22.tar.gz +ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.22.tar.gz +ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.22.tar.gz .fi .in -0.3i .ft R diff --git a/mtools.tmpl.5 b/mtools.tmpl.5 index 3dc7eec..56d7548 100644 --- a/mtools.tmpl.5 +++ b/mtools.tmpl.5 @@ -1,5 +1,5 @@ '\" t -.TH mtools 5 "24Nov18" MTOOLS MTOOLS +.TH mtools 5 "02Dec18" MTOOLS MTOOLS .SH Name mtools.conf - mtools configuration files '\" t @@ -13,7 +13,7 @@ mtools.conf - mtools configuration files .tr \(if` .tr \(pd" -.ds St Mtools\ 4.0.21 +.ds St Mtools\ 4.0.22 .PP .SH Description .PP diff --git a/mtoolstest.1 b/mtoolstest.1 index adee73e..8c2b4bf 100644 --- a/mtoolstest.1 +++ b/mtoolstest.1 @@ -1,5 +1,5 @@ '\" t -.TH mtoolstest 1 "24Nov18" mtools-4.0.21 +.TH mtoolstest 1 "02Dec18" mtools-4.0.22 .SH Name mtoolstest - tests and displays the configuration '\" t @@ -1,5 +1,5 @@ '\" t -.TH mtype 1 "24Nov18" mtools-4.0.21 +.TH mtype 1 "02Dec18" mtools-4.0.22 .SH Name mtype - display contents of an MSDOS file '\" t @@ -1,5 +1,5 @@ '\" t -.TH mzip 1 "24Nov18" mtools-4.0.21 +.TH mzip 1 "02Dec18" mtools-4.0.22 .SH Name mzip - change protection mode and eject disk on Zip/Jaz drive '\" t @@ -295,7 +295,7 @@ void mzip(int argc, char **argv, int type UNUSEDP) (!argv[optind][0] || argv[optind][1] != ':'))) usage(1); - drive = toupper(argc - optind == 1 ? argv[argc - 1][0] : ':'); + drive = ch_toupper(argc - optind == 1 ? argv[argc - 1][0] : ':'); for (dev = devices; dev->name; dev++) { unsigned char cdb[6] = { 0, 0, 0, 0, 0, 0 }; @@ -18,8 +18,13 @@ static struct OldDos_t old_dos[]={ { 80, 9, 1, 7, 2, 2, 0xf8 }, /* 360 KB */ }; +/** + * Get Old Dos parameters for a filesystem of size KBytes (assuming + * 512 byte sectors), i.e. number of sectors is double the size + */ struct OldDos_t *getOldDosBySize(size_t size) { size_t i; + size = size * 2; for(i=0; i < sizeof(old_dos) / sizeof(old_dos[0]); i++){ if (old_dos[i].sectors * old_dos[i].tracks * @@ -66,6 +71,6 @@ int setDeviceFromOldDos(int media, struct device *dev) { dev->tracks = params->tracks; dev->sectors = params->sectors; dev->ssize = 0x80; - dev->use_2m = ~1; + dev->use_2m = ~1u; return 0; } diff --git a/patchlevel.c b/patchlevel.c index 48f3c3d..aecdab7 100644 --- a/patchlevel.c +++ b/patchlevel.c @@ -18,10 +18,10 @@ #include "sysincludes.h" #include "msdos.h" -const char *mversion="4.0.21"; +const char *mversion="4.0.22"; /* Multiple releases on same day should be marked with (b), (cd), (d) after * date string below */ -const char *mdate = "November 24th, 2018"; +const char *mdate = "December 2nd, 2018"; -const char *mformat_banner = "MTOO4021"; +const char *mformat_banner = "MTOO4022"; diff --git a/sysincludes.h b/sysincludes.h index d01c07d..b683231 100644 --- a/sysincludes.h +++ b/sysincludes.h @@ -266,8 +266,6 @@ extern int errno; #ifndef OS_mingw32msvc #include <pwd.h> -#else -typedef unsigned int uid_t; #endif diff --git a/version.texi b/version.texi index 7eeaef1..e002dc7 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set EDITION 4.0.21 -@set VERSION 4.0.21 -@set UPDATED November 2018 +@set EDITION 4.0.22 +@set VERSION 4.0.22 +@set UPDATED December 2018 |