support for more table_buffer columns

This commit is contained in:
joonicks 2025-11-08 14:53:31 +01:00
parent 1d116d7942
commit 53442cff3f

View File

@ -293,9 +293,10 @@ void table_send(const char *from, const int space)
char message[MAXLEN]; char message[MAXLEN];
Strp *sp,*next; Strp *sp,*next;
char *src,*o,*end; char *src,*o,*end;
int i,u,g,x,z[6]; int i,u,g,x,tabs[16];
memset(tabs,0,sizeof(tabs));
z[0] = z[1] = z[2] = z[3] = z[4] = z[5] = 0;
for(sp=e_table;sp;sp=sp->next) for(sp=e_table;sp;sp=sp->next)
{ {
u = i = 0; u = i = 0;
@ -307,8 +308,8 @@ void table_send(const char *from, const int space)
if (*src == '\t' || *src == '\r') if (*src == '\t' || *src == '\r')
{ {
x = (src - o) - u; x = (src - o) - u;
if (x > z[i]) if (x > tabs[i])
z[i] = x; tabs[i] = x;
i++; i++;
o = src+1; o = src+1;
u = 0; u = 0;
@ -340,9 +341,9 @@ void table_send(const char *from, const int space)
if (*src == '\t' || *src == '\r') if (*src == '\t' || *src == '\r')
{ {
if (*src == '\r') if (*src == '\r')
g = z[i+1]; g = tabs[i+1];
src++; src++;
x += (z[i++] + space); x += (tabs[i++] + space);
while(o < (message + x)) while(o < (message + x))
*(o++) = ' '; *(o++) = ' ';
} }