upgrade busybox to v1.11.1 and add current upstream fixes
[openwrt.git] / package / busybox / patches / 523-conffiles_fix.patch
1 --- a/archival/libipkg/pkg.c
2 +++ b/archival/libipkg/pkg.c
3 @@ -575,25 +575,28 @@
4 return temp;
5 }
6
7 - len = 14 ;
8 + len = sizeof("Conffiles:") ;
9 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
10 if (iter->data->name && iter->data->value) {
11 - len = len + (strlen(iter->data->name)+strlen(iter->data->value)+5);
12 - }
13 + /* " <filename> <md5hash>" */
14 + len += 1+strlen(iter->data->name)+1+strlen(iter->data->value);
15 + }
16 }
17 + len +=2; /* "\n\0" */
18 temp = (char *)realloc(temp,len);
19 if ( temp == NULL ){
20 fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
21 return NULL;
22 }
23 temp[0]='\0';
24 - strncpy(temp, "Conffiles:\n", 12);
25 + strcpy(temp, "Conffiles:");
26 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
27 if (iter->data->name && iter->data->value) {
28 - snprintf(line_str, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
29 + snprintf(line_str, LINE_LEN, " %s %s", iter->data->name, iter->data->value);
30 strncat(temp, line_str, strlen(line_str));
31 }
32 }
33 + strcat(temp, "\n");
34 } else if (strcasecmp(field, "Conflicts") == 0) {
35 int i;
36
37 --- a/archival/libipkg/pkg_parse.c
38 +++ b/archival/libipkg/pkg_parse.c
39 @@ -88,17 +88,14 @@
40 if(!strncmp(raw, "Conffiles:", 10))
41 raw += strlen("Conffiles:");
42
43 + while(*raw && isspace(*raw)) raw++;
44 while(*raw && (sscanf(raw, "%s%s", file_name, md5sum) == 2)){
45 conffile_list_append(&pkg->conffiles, file_name, md5sum);
46 /* fprintf(stderr, "%s %s ", file_name, md5sum);*/
47 - while (*raw && isspace(*raw)) {
48 - raw++;
49 - }
50 raw += strlen(file_name);
51 - while (*raw && isspace(*raw)) {
52 - raw++;
53 - }
54 + while(*raw && isspace(*raw)) raw++;
55 raw += strlen(md5sum);
56 + while(*raw && isspace(*raw)) raw++;
57 }
58 }
59
This page took 0.044112 seconds and 5 git commands to generate.