From d41903f522d57fe600b916a6fea1c6a8c3a1b632 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 12 Mar 2014 20:37:04 +0000 Subject: patch: fix and enable by default for mingw32 --- configs/mingw32_defconfig | 4 ++-- libbb/read_printf.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 45155ba66..05d69109d 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.23.0.git -# Wed Mar 12 19:53:20 2014 +# Wed Mar 12 20:11:13 2014 # CONFIG_HAVE_DOT_CONFIG=y # CONFIG_PLATFORM_POSIX is not set @@ -374,7 +374,7 @@ CONFIG_DIFF=y CONFIG_FEATURE_DIFF_LONG_OPTIONS=y CONFIG_FEATURE_DIFF_DIR=y CONFIG_ED=y -# CONFIG_PATCH is not set +CONFIG_PATCH=y CONFIG_SED=y CONFIG_VI=y CONFIG_FEATURE_VI_MAX_LEN=4096 diff --git a/libbb/read_printf.c b/libbb/read_printf.c index 5ed6e3632..ef4911cd5 100644 --- a/libbb/read_printf.c +++ b/libbb/read_printf.c @@ -93,6 +93,11 @@ char* FAST_FUNC xmalloc_reads(int fd, size_t *maxsz_p) break; p++; } +#if ENABLE_PLATFORM_MINGW32 + if ( p != buf && *(p-1) == '\r' ) { + --p; + } +#endif *p = '\0'; if (maxsz_p) *maxsz_p = p - buf; -- cgit v1.2.3-55-g6feb