From: Sebastian B. <sb...@us...> - 2014-01-19 18:41:06
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23615 Modified Files: index_external.c Log Message: Improved the dumping of the index. For instance, newlines are no longer shown. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- index_external.c 19 Jan 2014 18:40:46 -0000 1.25 +++ index_external.c 19 Jan 2014 18:41:04 -0000 1.26 @@ -330,11 +330,30 @@ char buf[16]; e = bnode_get_ith_element_of_node(idx, tmp, i); - str = bnode_read_string(idx, e); + if (!(str = bnode_read_string(idx, e))) + { + fprintf(stderr, "Couldn't read string!\n"); + exit(-1); + } snprintf(buf,sizeof(buf),"%s", str); - printf("%d: %d: %d: %s\n", level, block, i, buf); + { + int k; + for (k=0;k<level;k++) + printf(" "); + } + printf("l%d: b%d: i%d: o%04d ", level, block, i, e->str_offset); + { + int k; + for (k=0;k<strlen(buf);k++) + { + if (!buf[k]) break; + if (buf[k] == 10) buf[k] = ' '; + printf("%c", buf[k]); + } + printf("\n"); + } if (!tmp->leaf) dump_index(idx, e->gchild, level + 1); |