diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:22:21 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:22:21 +0200 |
commit | 1d8b9e17ea13630aec475484da09ebba0366f7c8 (patch) | |
tree | 0c801f68561bfb0930a4ade80d7ca3a7940887ab /tests/uniwbrk/test-uc-wordbreaks.c | |
parent | 84e26c587987e8484d55db4165f188b40c09e94b (diff) | |
parent | 630f99f29bd31a76d8d24da2975a045452c763ef (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/uniwbrk/test-uc-wordbreaks.c')
-rw-r--r-- | tests/uniwbrk/test-uc-wordbreaks.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/tests/uniwbrk/test-uc-wordbreaks.c b/tests/uniwbrk/test-uc-wordbreaks.c index 8213446f..1c7bb101 100644 --- a/tests/uniwbrk/test-uc-wordbreaks.c +++ b/tests/uniwbrk/test-uc-wordbreaks.c @@ -65,10 +65,10 @@ int main (int argc, char *argv[]) { const char *filename; - char line[4096]; - int exit_code; FILE *stream; + int exit_code; int lineno; + char line[4096]; if (argc != 2) { @@ -88,26 +88,24 @@ main (int argc, char *argv[]) exit_code = 0; lineno = 0; - while (fgets (line, sizeof line, stream)) + while (fgets (line, sizeof (line), stream)) { - char *comment; - const char *p; - uint32_t input[100]; - char breaks[101]; - char breaks_expected[101]; - int i; - lineno++; - memset (breaks, 0, sizeof (breaks)); - memset (breaks_expected, 0, sizeof (breaks_expected)); - - 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; + uint32_t input[100]; + char breaks[100]; + char breaks_expected[101]; + int i; + i = 0; p = line; do @@ -170,7 +168,7 @@ main (int argc, char *argv[]) input[j], wordbreakproperty_to_string (input_wbp)); } fprintf (stderr, "\n"); - fprintf (stderr, "%s:%d: actual: ", filename, lineno); + fprintf (stderr, "%s:%d: actual: ", filename, lineno); for (j = 0; j < i - 1; j++) { int input_wbp = uc_wordbreak_property (input[j]); |