diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:21:43 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:21:43 +0200 |
commit | 4682deeb62247d34de87f8e777f99e2d337fd377 (patch) | |
tree | 5bd5b5605b5f3a4b3c8ea7468c34c23094afdef4 /tests/uniwbrk/test-uc-wordbreaks.c | |
parent | 00893e79fc62966067af1a106567db96bd170338 (diff) |
New upstream version 1.3upstream/1.3upstream
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]); |