void *func = NULL;
for (ext = rpmHeaderFormats; ext->name != NULL; ext++) {
- if (!strcmp(ext->name, fmt)) {
+ if (rstreq(ext->name, fmt)) {
func = ext->func;
break;
}
const char *fe;
/* First try a complete match. */
- if (strlen(td) == (le-l) && !strncmp(td, l, (le - l)))
+ if (strlen(td) == (le-l) && rstreqn(td, l, (le - l)))
return 1;
/* Next, try stripping optional dialect and matching. */
for (fe = l; fe < le && *fe != '@'; fe++)
{};
- if (fe < le && !strncmp(td, l, (fe - l)))
+ if (fe < le && rstreqn(td, l, (fe - l)))
return 1;
/* Next, try stripping optional codeset and matching. */
for (fe = l; fe < le && *fe != '.'; fe++)
{};
- if (fe < le && !strncmp(td, l, (fe - l)))
+ if (fe < le && rstreqn(td, l, (fe - l)))
return 1;
/* Finally, try stripping optional country code and matching. */
for (fe = l; fe < le && *fe != '_'; fe++)
{};
- if (fe < le && !strncmp(td, l, (fe - l)))
+ if (fe < le && rstreqn(td, l, (fe - l)))
return 2;
return 0;
{ const char * l = table->data;
for (langNum = 0; langNum < table->info.count; langNum++) {
- if (!strcmp(l, lang)) break;
+ if (rstreq(l, lang)) break;
l += strlen(l) + 1;
}
}
stag->fmt = NULL;
stag->tag = -1;
- if (!strcmp(tagname, "*")) {
+ if (rstreq(tagname, "*")) {
stag->tag = -2;
goto bingo;
}
- if (strncmp("RPMTAG_", tagname, sizeof("RPMTAG_")-1) == 0) {
+ if (rstreqn("RPMTAG_", tagname, sizeof("RPMTAG_")-1)) {
tagname += sizeof("RPMTAG");
}
spft = token->u.array.format;
isxml = (spft->type == PTOK_TAG && spft->u.tag.type != NULL &&
- !strcmp(spft->u.tag.type, "xml"));
+ rstreq(spft->u.tag.type, "xml"));
if (isxml) {
const char * tagN = rpmTagGetName(spft->u.tag.tag);
(hsa.format->type == PTOK_ARRAY
? &hsa.format->u.array.format->u.tag :
NULL));
- isxml = (tag != NULL && tag->tag == -2 && tag->type != NULL && !strcmp(tag->type, "xml"));
+ isxml = (tag != NULL && tag->tag == -2 && tag->type != NULL && rstreq(tag->type, "xml"));
if (isxml) {
need = sizeof("<rpmHeader>\n") - 1;
if (!payloadfmt)
return RPMRC_OK;
- if (payloadfmt && strncmp(payloadfmt, "cpio", strlen("cpio")) == 0) {
+ if (payloadfmt && rstreq(payloadfmt, "cpio")) {
rc = RPMRC_OK;
} else {
char *nevra = headerGetNEVRA(h, NULL);
- if (payloadfmt && strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) {
+ if (payloadfmt && rstreq(payloadfmt, "drpm")) {
rpmlog(RPMLOG_ERR,
_("%s is a Delta RPM and cannot be directly installed\n"),
nevra);
(void) rpmDigestFinal(ctx, (void **)&SHA1, NULL, 1);
- if (SHA1 == NULL || strlen(SHA1) != strlen(sig) || strcmp(SHA1, sig)) {
+ if (SHA1 == NULL || strlen(SHA1) != strlen(sig) || !rstreq(SHA1, sig)) {
rasprintf(msg, "%s %s Expected(%s) != (%s)\n", title,
rpmSigString(res), sig, SHA1 ? SHA1 : "(nil)");
} else {