+2025-01-03 Bruno Haible <bruno@clisp.org>
+
+ git-merge-changelog, gen-uni-tables: Use str_startswith.
+ * lib/git-merge-changelog.c (main): Use str_startswith.
+ * lib/gen-uni-tables.c (output_predicate, is_property_composite,
+ is_nonspacing): Likewise.
+ * modules/git-merge-changelog (Depends-on): Add str_startswith.
+ * modules/gen-uni-tables (Depends-on): Likewise.
+
2025-01-03 Bruno Haible <bruno@clisp.org>
str_endswith: Add tests.
fprintf (stream, "\n");
output_library_license (stream,
strcmp (filename, "unictype/categ_M.h") == 0
- || strncmp (filename, "unictype/ctype_", 15) == 0
+ || str_startswith (filename, "unictype/ctype_")
|| strcmp (filename, "uniwidth/width2.h") == 0);
fprintf (stream, "\n");
if (decomp[0] == ' ')
decomp++;
}
- return strchr (decomp, ' ') != NULL && strncmp (decomp, "0020 ", 5) != 0;
+ return strchr (decomp, ' ') != NULL && str_startswith (decomp, "0020 ");
}
return false;
}
|| is_category_Cc (ch)
|| (is_category_Cf (ch)
&& !is_property_prepended_concatenation_mark (ch))
- || strncmp (unicode_attributes[ch].name, "ZERO WIDTH ", 11) == 0
+ || str_startswith (unicode_attributes[ch].name, "ZERO WIDTH ")
|| (ch >= 0x1160 && ch <= 0x11A7) || (ch >= 0xD7B0 && ch <= 0xD7C6) /* jungseong */
|| (ch >= 0x11A8 && ch <= 0x11FF) || (ch >= 0xD7CB && ch <= 0xD7FB) /* jongseong */
) );
printf ("GIT_REFLOG_ACTION=|%s|\n", var);
#endif
if (var != NULL
- && ((strncmp (var, "pull", 4) == 0
+ && ((str_startswith (var, "pull")
&& c_strstr (var, " --rebase") == NULL)
- || strncmp (var, "merge origin", 12) == 0))
+ || str_startswith (var, "merge origin")))
downstream = true;
else
{