Code

Cleanup update_view's read loop
authorJonas Fonseca <fonseca@diku.dk>
Mon, 19 Jan 2009 14:33:43 +0000 (15:33 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 19 Jan 2009 14:39:08 +0000 (15:39 +0100)
tig.c

diff --git a/tig.c b/tig.c
index b16fe244d0fd2d9b26d4208fd99c9ffaecf4b338..6d3191e2f9032f0add961b9f69a2f48b57eb0d03 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2703,11 +2703,9 @@ update_view(struct view *view)
        }
 
        for (; (line = io_get(view->pipe, '\n', can_read)); can_read = FALSE) {
-               size_t linelen = strlen(line);
-
                if (opt_iconv != ICONV_NONE) {
                        ICONV_CONST char *inbuf = line;
-                       size_t inlen = linelen + 1;
+                       size_t inlen = strlen(line) + 1;
 
                        char *outbuf = out_buffer;
                        size_t outlen = sizeof(out_buffer);
@@ -2715,10 +2713,8 @@ update_view(struct view *view)
                        size_t ret;
 
                        ret = iconv(opt_iconv, &inbuf, &inlen, &outbuf, &outlen);
-                       if (ret != (size_t) -1) {
+                       if (ret != (size_t) -1)
                                line = out_buffer;
-                               linelen = strlen(out_buffer);
-                       }
                }
 
                if (!view->ops->read(view, line))