From c693169deeabf8f9a65a824699cc0c98cedd491f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sun, 27 Jan 2008 16:00:40 +0200 Subject: [PATCH] Use the suffix checker in rpmfc instead of inline defined version --- build/rpmfc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/rpmfc.c b/build/rpmfc.c index 82fe232..d69d704 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -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. */ -- 2.7.4