summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-27 16:00:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-27 16:00:40 +0200
commitc693169deeabf8f9a65a824699cc0c98cedd491f (patch)
tree5777a170b701088010bbbf77ad7d88f00be3e340
parentf0f392cce6c07fd4a41a392bc912a76238ee14eb (diff)
downloadrpm-c693169deeabf8f9a65a824699cc0c98cedd491f.tar.gz
rpm-c693169deeabf8f9a65a824699cc0c98cedd491f.tar.bz2
rpm-c693169deeabf8f9a65a824699cc0c98cedd491f.zip
Use the suffix checker in rpmfc instead of inline defined version
-rw-r--r--build/rpmfc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 82fe23229..d69d70449 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -6,6 +6,7 @@
#include <rpm/argv.h>
#include <rpm/rpmfc.h>
#include <rpm/rpmlog.h>
+#include <rpm/rpmfileutil.h>
#include <rpm/rpmds.h>
#include <rpm/rpmfi.h>
@@ -1267,19 +1268,16 @@ assert(s != NULL);
case S_IFLNK:
case S_IFREG:
default:
-#define _suffix(_s, _x) \
- (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x)))
-
/* XXX all files with extension ".pm" are perl modules for now. */
- if (_suffix(s, ".pm"))
+ if (rpmFileHasSuffix(s, ".pm"))
ftype = "Perl5 module source text";
/* XXX all files with extension ".la" are libtool for now. */
- else if (_suffix(s, ".la"))
+ else if (rpmFileHasSuffix(s, ".la"))
ftype = "libtool library file";
/* XXX all files with extension ".pc" are pkgconfig for now. */
- else if (_suffix(s, ".pc"))
+ else if (rpmFileHasSuffix(s, ".pc"))
ftype = "pkgconfig file";
/* XXX skip all files in /dev/ which are (or should be) %dev dummies. */