X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Ftools.c;h=2c047adaeaa0170d17c9f8ced0bcf23006e42342;hb=bb679ff347dbaab788e62d4fe2f8ad6eb0bd910a;hp=71cd40d756b6858f272bb5d123cc60a8c8d4d821;hpb=264200e128e3fe63788ebefc5b80788aa544b446;p=NeonServV5.git diff --git a/src/tools.c b/src/tools.c index 71cd40d..2c047ad 100644 --- a/src/tools.c +++ b/src/tools.c @@ -180,7 +180,7 @@ int table_set_bold(struct Table *table, int collum, int bold) { } char **table_end(struct Table *table) { - int row, col, tablewidth = 0, pos,i; + int row, col, tablewidth = 0, pos,i,j,k; if(!table->entrys) return NULL; for(col = 0; col < table->width; col++) { tablewidth += table->maxwidth[col]+1; @@ -196,11 +196,23 @@ char **table_end(struct Table *table) { if(table->col_flags[col] & TABLE_FLAG_COL_BOLD) table->table_lines[row][pos++] = '\002'; i = 0; + j = 0; if(table->contents[row][col]) { for(; i < strlen(table->contents[row][col]); i++) { table->table_lines[row][pos++] = table->contents[row][col][i]; + if(table->contents[row][col][i] == '\002') j++; + else if(table->contents[row][col][i] == '\003') { + j++; + for(k = 1; k < 2; k++) { + if(isdigit(table->contents[row][col][i+k])) + j++; + else + break; + } + } } } + i -= j; if(col < table->width-1) { for(;i < table->maxwidth[col]; i++) { table->table_lines[row][pos++] = ' ';