1 --- rpm-4.5/rpmdb/header.c~ 2009-05-13 18:25:56.000000000 +0300
2 +++ rpm-4.5/rpmdb/header.c 2009-05-13 18:26:01.729564093 +0300
4 static char * shescapeFormat(HE_t he, /*@null@*/ const char ** av)
7 - rpmTagData data = { .ptr = he->p.ptr };
11 @@ -2985,34 +2984,37 @@
12 if (he->t == RPM_INT32_TYPE) {
15 - snprintf(val, nb, "%d", data.i32p[0]);
16 + snprintf(val, nb, "%d", he->p.i32p[0]);
18 } else if (he->t == RPM_INT64_TYPE) {
21 - snprintf(val, nb, "%lld", data.i64p[0]);
22 + snprintf(val, nb, "%lld", he->p.i64p[0]);
24 } else if (he->t == RPM_STRING_TYPE) {
25 - const char * s = data.str;
26 + const char * s = he->p.str;
30 - nb = strlen(data.str) + 1;
31 - /* XXX count no. of escapes instead. */
32 - t = xmalloc(4 * nb + 3);
34 + for (s = he->p.str; (c = (int)*s) != 0; s++) {
40 + t = val = xmalloc(nb);
42 - while ((c = *s++) != 0) {
44 + for (s = he->p.str; (c = (int)*s) != 0; s++) {
45 + if (c == (int)'\'') {
56 - val = xrealloc(t, nb);
58 val = xstrdup(_("invalid type"));