OSDN Git Service

Cleanup iconv.
authorRob Landley <rob@landley.net>
Fri, 29 Dec 2017 22:43:38 +0000 (16:43 -0600)
committerRob Landley <rob@landley.net>
Fri, 29 Dec 2017 22:43:38 +0000 (16:43 -0600)
commit78c3fcd224c83b454e80a2160ec62e8daf3be5ab
treefa6e849b67993b6dcc697d2f37c232a66e2ff553
parent12a0b40d09546839f67c8c216d0f20a6609716b2
Cleanup iconv.

Implement -c, fix endless loop when illegal char happens with
!outleft (don't need to check errno, just in == toybuf), refill
buffer each time (less efficient handling of illegal chars but never
have to worry about how long constitutes a valid sequence in unknown
encoding).

Fix input longer than 2k (memmove() has src/dest switched, second time through
loop in starts at offset inleft...) Made it start at beginning every time.

Switch iconv_open() error msg to show to/from and errno (rather than
hardwired english text).
toys/pending/iconv.c