diff --git a/mail_menu.c b/mail_menu.c index 4bd6831..ba11ec0 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -820,38 +820,50 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh ansi = z; while (strchr("ABCDEFGHIGJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", body[z]) == NULL) z++; - if (body[z] == 'm' || body[z] == 'C' || body[z] == 'D') { + if (body[z] == 'm') { strncpy(buffer, &body[ansi], (z - ansi) + 1); buffer[z - ansi + 1] = '\0'; s_putstring(socket, buffer); } if (body[z] == 'A') { - if (lines >= atoi(&body[ansi + 2])) { - lines -= atoi(&body[ansi + 2]); - strncpy(buffer, &body[ansi], (z - ansi) + 1); - buffer[z - ansi + 1] = '\0'; - s_putstring(socket, buffer); + for (i=0;i 0) { + s_putstring(socket, "\e[1A"); + lines--; + } else { + break; + } } } if (body[z] == 'C') { - chars += atoi(&body[ansi + 2]); - if (chars > 79) { - lines++; - chars -= 79; + for (i=0;i 0) { + s_putstring(socket, "\e[1D"); + chars--; + } else { + break; + } + } } - } else if (body[z] != '\n') { chars++; s_putchar(socket, body[z]);