diff options
author | Rob Landley <rob@landley.net> | 2018-08-26 14:16:49 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-08-26 14:16:49 -0500 |
commit | 009b55edc4bad5b46ace88f3c255bbff8671d137 (patch) | |
tree | f4f856ef871104e37a5d123aa3ec3d01246c9e10 /toys/posix/iconv.c | |
parent | 1aaef2d2b72800a5c6bedae04941304ce8e153be (diff) | |
download | toybox-009b55edc4bad5b46ace88f3c255bbff8671d137.tar.gz |
Convert more commands to the new option/GLOBALS code style.
Diffstat (limited to 'toys/posix/iconv.c')
-rw-r--r-- | toys/posix/iconv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/toys/posix/iconv.c b/toys/posix/iconv.c index a31d713b..e3cf7bae 100644 --- a/toys/posix/iconv.c +++ b/toys/posix/iconv.c @@ -27,8 +27,7 @@ config ICONV #include <iconv.h> GLOBALS( - char *from; - char *to; + char *f, *t; void *ic; ) @@ -64,11 +63,11 @@ static void do_iconv(int fd, char *name) void iconv_main(void) { - if (!TT.to) TT.to = "utf8"; - if (!TT.from) TT.from = "utf8"; + if (!TT.t) TT.t = "utf8"; + if (!TT.f) TT.f = "utf8"; - if ((iconv_t)-1 == (TT.ic = iconv_open(TT.to, TT.from))) - perror_exit("%s/%s", TT.to, TT.from); + if ((iconv_t)-1 == (TT.ic = iconv_open(TT.t, TT.f))) + perror_exit("%s/%s", TT.t, TT.f); loopfiles(toys.optargs, do_iconv); if (CFG_TOYBOX_FREE) iconv_close(TT.ic); } |