summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--lib/formats.c11
-rw-r--r--lib/fs.c6
-rw-r--r--lib/header.c2
-rw-r--r--lib/rpmlib.h2
-rw-r--r--rpm2cpio.c2
6 files changed, 15 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index c2d5cf490..95831655a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -33,6 +33,8 @@
under the LGPL
- applied man page changes from Alex deVries
- configure.in builds up LIBS by appending (Benedict Lofstedt)
+ - rpm2cpio reported wrong zlib error string
+ - removed \n from (none) generated by query format code
2.4.2 -> 2.4.3:
- implemented install time prerequisites
diff --git a/lib/formats.c b/lib/formats.c
index 9d9784469..10a5a84c8 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -164,16 +164,13 @@ static int fsnamesTag(Header h, int_32 * type, void ** data, int_32 * count,
char ** list;
int i;
- if (rpmGetFilesystemList(&list)) {
+ if (rpmGetFilesystemList(&list, count)) {
return 1;
}
*type = RPM_STRING_ARRAY_TYPE;
*((char ***) data) = list;
- for (i = 0; list[i]; i++) ;
- *count = i;
-
*freeData = 0;
return 0;
@@ -185,15 +182,19 @@ static int fssizesTag(Header h, int_32 * type, void ** data, int_32 * count,
int_32 * filesizes;
uint_32 * usages;
int numFiles;
+ int i;
headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &filenames, NULL);
headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, &numFiles);
+ if (rpmGetFilesystemList(NULL, count)) {
+ return 1;
+ }
+
if (rpmGetFilesystemUsage(filenames, filesizes, numFiles, &usages, 0))
return 1;
*type = RPM_INT32_TYPE;
- *count = 20;
*freeData = 1;
*data = usages;
diff --git a/lib/fs.c b/lib/fs.c
index 3b34800ec..4243ae7f1 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -191,12 +191,14 @@ static int getFilesystemList(void) {
}
#endif
-int rpmGetFilesystemList(char *** listptr) {
+int rpmGetFilesystemList(char *** listptr, int * num) {
if (!fsnames)
if (getFilesystemList())
return 1;
- *listptr = fsnames;
+ if (listptr) *listptr = fsnames;
+ if (num) *num = numFilesystems;
+
return 0;
}
diff --git a/lib/header.c b/lib/header.c
index 12626840f..dd6f9c00e 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -1686,7 +1686,7 @@ static char * singleSprintf(Header h, struct sprintfToken * token,
if (numElements == -1) {
val = malloc(20);
- strcpy(val, "(none)\n");
+ strcpy(val, "(none)");
} else {
alloced = numElements * token->u.array.numTokens * 20;
val = malloc(alloced);
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index 108d32429..81d6800f3 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -458,7 +458,7 @@ void rpmFreeSignature(Header h);
int rpmVerifySignature(char *file, int_32 sigTag, void *sig, int count,
char *result);
-int rpmGetFilesystemList(char *** listptr);
+int rpmGetFilesystemList(char *** listptr, int * num);
int rpmGetFilesystemUsage(char ** filelist, int_32 * fssizes, int numFiles,
uint_32 ** usagesPtr, int flags);
diff --git a/rpm2cpio.c b/rpm2cpio.c
index a5ba3fef4..67b6c2295 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
gzclose(stream);
return 1;
}
- fprintf (stderr, "rpm2cpio: zlib: %s error\n", zlib_err [-zerror]);
+ fprintf (stderr, "rpm2cpio: zlib: %s error\n", zlib_err [-zerror - 1]);
}
gzclose(stream);