From: Sven Hoexter Date: Tue, 22 Dec 2015 13:15:15 +0000 (+0100) Subject: Imported Upstream version 1.2.3 X-Git-Tag: upstream/1.2.3^0 X-Git-Url: https://git.sven.stormbind.net/?a=commitdiff_plain;h=fc55662109c1fccea581594f8d6af49da79f456b;p=sven%2Fexfat-utils.git Imported Upstream version 1.2.3 --- diff --git a/ChangeLog b/ChangeLog index d6f99d0..05cd191 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1.2.3 (2015-12-19) + +* Fixed clusters loss when file renaming replaces target. + 1.2.2 (2015-11-09) * Improved reliability in case of a sudden unplug: FS will be in a clean state diff --git a/configure b/configure index 3f05b77..f605681 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.2. +# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.3. # # Report bugs to . # @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Free exFAT implementation' PACKAGE_TARNAME='exfat-utils' -PACKAGE_VERSION='1.2.2' -PACKAGE_STRING='Free exFAT implementation 1.2.2' +PACKAGE_VERSION='1.2.3' +PACKAGE_STRING='Free exFAT implementation 1.2.3' PACKAGE_BUGREPORT='relan@users.noreply.github.com' PACKAGE_URL='https://github.com/relan/exfat' @@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Free exFAT implementation 1.2.2 to adapt to many kinds of systems. +\`configure' configures Free exFAT implementation 1.2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1294,7 +1294,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Free exFAT implementation 1.2.2:";; + short | recursive ) echo "Configuration of Free exFAT implementation 1.2.3:";; esac cat <<\_ACEOF @@ -1386,7 +1386,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Free exFAT implementation configure 1.2.2 +Free exFAT implementation configure 1.2.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1441,7 +1441,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Free exFAT implementation $as_me 1.2.2, which was +It was created by Free exFAT implementation $as_me 1.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2304,7 +2304,7 @@ fi # Define the identity of the package. PACKAGE='exfat-utils' - VERSION='1.2.2' + VERSION='1.2.3' cat >>confdefs.h <<_ACEOF @@ -4611,7 +4611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Free exFAT implementation $as_me 1.2.2, which was +This file was extended by Free exFAT implementation $as_me 1.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4678,7 +4678,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Free exFAT implementation config.status 1.2.2 +Free exFAT implementation config.status 1.2.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index c6fc314..a1dcd87 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # AC_INIT([Free exFAT implementation], - [1.2.2], + [1.2.3], [relan@users.noreply.github.com], [exfat-utils], [https://github.com/relan/exfat]) diff --git a/libexfat/node.c b/libexfat/node.c index d05f20d..4dd4dc6 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -1129,6 +1129,16 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path) } exfat_put_node(ef, existing); if (rc != 0) + { + /* free clusters even if something went wrong; overwise they + will be just lost */ + exfat_cleanup_node(ef, existing); + exfat_put_node(ef, dir); + exfat_put_node(ef, node); + return rc; + } + rc = exfat_cleanup_node(ef, existing); + if (rc != 0) { exfat_put_node(ef, dir); exfat_put_node(ef, node);