From fb9eb45ecf6702f7b3612194617e36a3a1f43872 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Sat, 10 Jul 2004 16:26:54 +0000 Subject: [PATCH] patch obj_write{,_nocheck}() to use bput_attr_str() to support both V30 and V33 buckets --- lib/object.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/object.c b/lib/object.c index 371d9b36..32beab2e 100644 --- a/lib/object.c +++ b/lib/object.c @@ -2,6 +2,7 @@ * Sherlock Library -- Object Functions * * (c) 1997--2004 Martin Mares + * (c) 2004 Robert Spalek * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -87,17 +88,14 @@ obj_write(struct fastbuf *f, struct odes *d) for(struct oattr *b=a; b; b=b->same) { byte *z; - bputc(f, a->attr); - for(z = b->val; *z; z++) - if (*z >= ' ' || *z == '\t') - bputc(f, *z); - else + for (z = b->val; *z; z++) + if (*z < ' ' && *z != '\t') { - bputc(f, '?'); log(L_ERROR, "obj_dump: Found non-ASCII characters (URL might be %s)", obj_find_aval(d, 'U')); + *z = '?'; } ASSERT(z - b->val <= MAX_ATTR_SIZE-2); - bputc(f, '\n'); + bput_attr_str(f, a->attr, b->val); } } @@ -106,10 +104,7 @@ obj_write_nocheck(struct fastbuf *f, struct odes *d) { for(struct oattr *a=d->attrs; a; a=a->next) for(struct oattr *b=a; b; b=b->same) - { - bputc(f, a->attr); - bputsn(f, b->val); - } + bput_attr_str(f, a->attr, b->val); } struct oattr * -- 2.39.2