diff options
Diffstat (limited to 'tests/unigbrk/test-uc-grapheme-breaks.c')
-rw-r--r-- | tests/unigbrk/test-uc-grapheme-breaks.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/unigbrk/test-uc-grapheme-breaks.c b/tests/unigbrk/test-uc-grapheme-breaks.c index afaab06b..49eed04c 100644 --- a/tests/unigbrk/test-uc-grapheme-breaks.c +++ b/tests/unigbrk/test-uc-grapheme-breaks.c @@ -97,10 +97,9 @@ int main (int argc, char *argv[]) { const char *filename; - char line[1024]; - int exit_code; FILE *stream; int lineno; + char line[1024]; if (argc != 2) { @@ -118,24 +117,24 @@ main (int argc, char *argv[]) exit (1); } - exit_code = 0; lineno = 0; - while (fgets (line, sizeof line, stream)) + while (fgets (line, sizeof (line), stream)) { - char *comment; - const char *p; - ucs4_t s[16]; - char breaks[16]; - size_t i = 0; - lineno++; - comment = strchr (line, '#'); + /* Cut off the trailing comment, if any. */ + char *comment = strchr (line, '#'); if (comment != NULL) *comment = '\0'; + /* Is the remaining line blank? */ if (line[strspn (line, " \t\r\n")] == '\0') continue; + const char *p; + ucs4_t s[16]; + char breaks[16]; + size_t i = 0; + s[0] = 0; p = line; do @@ -186,5 +185,5 @@ main (int argc, char *argv[]) test_uc_grapheme_breaks (breaks, s, i, filename, lineno); } - return exit_code; + return test_exit_status; } |