diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-25 02:00:16 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-25 02:00:16 +0100 |
commit | 307b24c85172a40909d634e615a68c8c65770697 (patch) | |
tree | 04e23e5c5d09233ad4b58adde7a1d88a6884c294 | |
parent | 2315c8854c2be911283c5b4b7eb3f37332758abb (diff) | |
download | busybox-w32-307b24c85172a40909d634e615a68c8c65770697.tar.gz busybox-w32-307b24c85172a40909d634e615a68c8c65770697.tar.bz2 busybox-w32-307b24c85172a40909d634e615a68c8c65770697.zip |
testsuite-discovered fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/unicode.c | 8 | ||||
-rw-r--r-- | testsuite/date/date-works-1 | 2 | ||||
-rwxr-xr-x | testsuite/mdev.tests | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/libbb/unicode.c b/libbb/unicode.c index 844c154e0..39b173e9c 100644 --- a/libbb/unicode.c +++ b/libbb/unicode.c | |||
@@ -203,11 +203,13 @@ size_t FAST_FUNC mbstowcs(wchar_t *dest, const char *src, size_t n) | |||
203 | 203 | ||
204 | while (n) { | 204 | while (n) { |
205 | wchar_t wc; | 205 | wchar_t wc; |
206 | const char *rc = mbstowc_internal(dest ? dest : &wc, src); | 206 | src = mbstowc_internal(&wc, src); |
207 | if (rc == NULL) /* error */ | 207 | if (src == NULL) /* error */ |
208 | return (size_t) -1L; | 208 | return (size_t) -1L; |
209 | if (dest) | 209 | if (dest) |
210 | dest++; | 210 | *dest++ = wc; |
211 | if (wc == 0) /* end-of-string */ | ||
212 | break; | ||
211 | n--; | 213 | n--; |
212 | } | 214 | } |
213 | 215 | ||
diff --git a/testsuite/date/date-works-1 b/testsuite/date/date-works-1 index bd984c0be..1b3e47ab0 100644 --- a/testsuite/date/date-works-1 +++ b/testsuite/date/date-works-1 | |||
@@ -126,4 +126,4 @@ test x"$res" = xOK | |||
126 | 126 | ||
127 | # This should error out (by showing usage text). Testing for that | 127 | # This should error out (by showing usage text). Testing for that |
128 | dt=`busybox date -d 012311332000.30 %+c 2>&1 | head -n 1` | 128 | dt=`busybox date -d 012311332000.30 %+c 2>&1 | head -n 1` |
129 | test x"${dt#BusyBox * multi-call binary}" = x | 129 | test x"${dt##BusyBox * multi-call binary*}" = x"" |
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests index 319c670da..036738e52 100755 --- a/testsuite/mdev.tests +++ b/testsuite/mdev.tests | |||
@@ -7,9 +7,9 @@ | |||
7 | # ls -ln is showing date. Need to remove that, it's variable | 7 | # ls -ln is showing date. Need to remove that, it's variable |
8 | # sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces | 8 | # sed: (1) "maj, min" -> "maj,min" (2) coalesce spaces |
9 | # cut: remove date | 9 | # cut: remove date |
10 | FILTER_LS="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-5,9-" | 10 | FILTER_LS="grep -v '^total ' | sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-5,9-" |
11 | # cut: remove size+date | 11 | # cut: remove size+date |
12 | FILTER_LS2="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-" | 12 | FILTER_LS2="grep -v '^total ' | sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-" |
13 | 13 | ||
14 | # testing "test name" "options" "expected result" "file input" "stdin" | 14 | # testing "test name" "options" "expected result" "file input" "stdin" |
15 | 15 | ||