Use rpmFileHasSuffix() instead of doing it manually
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 10 Jun 2008 10:40:51 +0000 (13:40 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 10 Jun 2008 10:40:51 +0000 (13:40 +0300)
lib/psm.c

index 705127b..682e16f 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -330,9 +330,8 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
     if (i == fi->fc) {
        /* Find the spec file by name. */
        for (i = 0; i < fi->fc; i++) {
-           const char * t = fi->apath[i];
-           t += strlen(fi->apath[i]) - 5;
-           if (!strcmp(t, ".spec")) break;
+           if (rpmFileHasSuffix(fi->apath[i], ".spec"))
+               break;
        }
     }