summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-17 17:33:30 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-17 17:33:30 +0300
commit02939c15fa5441aff46c5f2cbf28086fe67d4d24 (patch)
tree82f92ae32f0c6e48c7f211cd0ca35a7f961324be
parent64e0af29bd38a1f8ca6573ec9734ae475ed8909b (diff)
downloadrpm-02939c15fa5441aff46c5f2cbf28086fe67d4d24.tar.gz
rpm-02939c15fa5441aff46c5f2cbf28086fe67d4d24.tar.bz2
rpm-02939c15fa5441aff46c5f2cbf28086fe67d4d24.zip
More accurate filtering of .rpmnew etc when reading macros
- strstr() can give false positives, use rpmFileHasSuffix() instead
-rw-r--r--rpmio/macro.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 06b2b5a79..8b41373d6 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -1575,9 +1575,9 @@ rpmInitMacros(rpmMacroContext mc, const char * macrofiles)
/* Read macros from each file. */
for (i = 0; i < ac; i++) {
- if (strstr(av[i], ".rpmnew") ||
- strstr(av[i], ".rpmsave") ||
- strstr(av[i], ".rpmorig")) {
+ if (rpmFileHasSuffix(av[i], ".rpmnew") ||
+ rpmFileHasSuffix(av[i], ".rpmsave") ||
+ rpmFileHasSuffix(av[i], ".rpmorig")) {
continue;
}
(void) rpmLoadMacroFile(mc, av[i]);