From: root Date: Wed, 14 Feb 1996 16:12:32 +0000 (+0000) Subject: fixed for packages w/o any groups X-Git-Tag: tznext/4.11.0.1.tizen20130304~11702 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9da1bde9e6022eff490c3971b74d25129413e6bd;p=tools%2Flibrpm-tizen.git fixed for packages w/o any groups CVS patchset: 258 CVS date: 1996/02/14 16:12:32 --- diff --git a/lib/package.c b/lib/package.c index 3a26eb6..429d70f 100644 --- a/lib/package.c +++ b/lib/package.c @@ -89,7 +89,11 @@ static int readOldHeader(int fd, Header * hdr, int * isSource) { addEntry(dbentry, RPMTAG_VENDOR, STRING_TYPE, spec.vendor, 1); addEntry(dbentry, RPMTAG_SIZE, INT32_TYPE, &oldheader.size, 1); addEntry(dbentry, RPMTAG_COPYRIGHT, STRING_TYPE, spec.copyright, 1); - addEntry(dbentry, RPMTAG_GROUP, STRING_TYPE, oldheader.group, 1); + + if (oldheader.group) + addEntry(dbentry, RPMTAG_GROUP, STRING_TYPE, oldheader.group, 1); + else + addEntry(dbentry, RPMTAG_GROUP, STRING_TYPE, "Unknown", 1); if (spec.prein) addEntry(dbentry, RPMTAG_PREIN, STRING_TYPE, spec.prein, 1); @@ -178,5 +182,7 @@ static int readOldHeader(int fd, Header * hdr, int * isSource) { free(fileStatesList); } + oldhdrFree(&oldheader); + return 0; }