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/unigbrk/test-uc-is-grapheme-break.c | |
parent | 84e26c587987e8484d55db4165f188b40c09e94b (diff) | |
parent | 630f99f29bd31a76d8d24da2975a045452c763ef (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/unigbrk/test-uc-is-grapheme-break.c')
-rw-r--r-- | tests/unigbrk/test-uc-is-grapheme-break.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/unigbrk/test-uc-is-grapheme-break.c b/tests/unigbrk/test-uc-is-grapheme-break.c index 92674a07..939b09b3 100644 --- a/tests/unigbrk/test-uc-is-grapheme-break.c +++ b/tests/unigbrk/test-uc-is-grapheme-break.c @@ -59,10 +59,10 @@ int main (int argc, char *argv[]) { const char *filename; - char line[1024]; - int exit_code; FILE *stream; + int exit_code; int lineno; + char line[1024]; if (argc != 2) { @@ -82,9 +82,18 @@ main (int argc, char *argv[]) exit_code = 0; lineno = 0; - while (fgets (line, sizeof line, stream)) + while (fgets (line, sizeof (line), stream)) { - char *comment; + lineno++; + + /* 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 prev; int last_char_prop; @@ -95,14 +104,6 @@ main (int argc, char *argv[]) bool emoji_modifier_sequence_before_last_char; size_t ri_count; - lineno++; - - comment = strchr (line, '#'); - if (comment != NULL) - *comment = '\0'; - if (line[strspn (line, " \t\r\n")] == '\0') - continue; - last_char_prop = -1; incb_consonant_extended = false; incb_consonant_extended_linker = false; |