2008-08-20 17:00:34 +03:00
|
|
|
--- a/archival/libipkg/pkg.c
|
|
|
|
+++ b/archival/libipkg/pkg.c
|
2008-01-03 19:07:02 +02:00
|
|
|
@@ -575,25 +575,28 @@
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
- len = 14 ;
|
|
|
|
+ len = sizeof("Conffiles:") ;
|
|
|
|
for (iter = pkg->conffiles.head; iter; iter = iter->next) {
|
|
|
|
if (iter->data->name && iter->data->value) {
|
|
|
|
- len = len + (strlen(iter->data->name)+strlen(iter->data->value)+5);
|
|
|
|
- }
|
|
|
|
+ /* " <filename> <md5hash>" */
|
|
|
|
+ len += 1+strlen(iter->data->name)+1+strlen(iter->data->value);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
+ len +=2; /* "\n\0" */
|
|
|
|
temp = (char *)realloc(temp,len);
|
|
|
|
if ( temp == NULL ){
|
|
|
|
fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
|
2008-01-03 04:25:16 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
temp[0]='\0';
|
|
|
|
- strncpy(temp, "Conffiles:\n", 12);
|
2008-01-03 19:07:02 +02:00
|
|
|
+ strcpy(temp, "Conffiles:");
|
2008-01-03 04:25:16 +02:00
|
|
|
for (iter = pkg->conffiles.head; iter; iter = iter->next) {
|
|
|
|
if (iter->data->name && iter->data->value) {
|
|
|
|
- snprintf(line_str, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
|
2008-01-03 19:07:02 +02:00
|
|
|
+ snprintf(line_str, LINE_LEN, " %s %s", iter->data->name, iter->data->value);
|
2008-01-03 04:25:16 +02:00
|
|
|
strncat(temp, line_str, strlen(line_str));
|
|
|
|
}
|
|
|
|
}
|
2008-01-03 19:07:02 +02:00
|
|
|
+ strcat(temp, "\n");
|
2008-01-03 04:25:16 +02:00
|
|
|
} else if (strcasecmp(field, "Conflicts") == 0) {
|
|
|
|
int i;
|
|
|
|
|
2008-08-20 17:00:34 +03:00
|
|
|
--- a/archival/libipkg/pkg_parse.c
|
|
|
|
+++ b/archival/libipkg/pkg_parse.c
|
|
|
|
@@ -88,17 +88,14 @@
|
|
|
|
if(!strncmp(raw, "Conffiles:", 10))
|
2008-01-03 19:07:02 +02:00
|
|
|
raw += strlen("Conffiles:");
|
|
|
|
|
|
|
|
+ while(*raw && isspace(*raw)) raw++;
|
|
|
|
while(*raw && (sscanf(raw, "%s%s", file_name, md5sum) == 2)){
|
|
|
|
conffile_list_append(&pkg->conffiles, file_name, md5sum);
|
|
|
|
/* fprintf(stderr, "%s %s ", file_name, md5sum);*/
|
|
|
|
- while (*raw && isspace(*raw)) {
|
|
|
|
- raw++;
|
|
|
|
- }
|
2008-08-20 17:00:34 +03:00
|
|
|
raw += strlen(file_name);
|
2008-01-03 19:07:02 +02:00
|
|
|
- while (*raw && isspace(*raw)) {
|
|
|
|
- raw++;
|
|
|
|
- }
|
|
|
|
+ while(*raw && isspace(*raw)) raw++;
|
2008-08-20 17:00:34 +03:00
|
|
|
raw += strlen(md5sum);
|
|
|
|
+ while(*raw && isspace(*raw)) raw++;
|
2008-01-03 19:07:02 +02:00
|
|
|
}
|
2008-08-20 17:00:34 +03:00
|
|
|
}
|
|
|
|
|