I THINK I GOT IT!

This commit is contained in:
Andrew Pamment 2016-04-22 16:14:08 +10:00
parent 7afd4aac39
commit cd5790559f

View File

@ -710,7 +710,7 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
struct fido_addr *from_addr = NULL; struct fido_addr *from_addr = NULL;
struct fido_addr *dest; struct fido_addr *dest;
int wwiv_to = 0; int wwiv_to = 0;
int i; int i, j;
char *wwiv_addressee; char *wwiv_addressee;
char *dest_addr; char *dest_addr;
int to_us; int to_us;
@ -825,7 +825,11 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
buffer[z - ansi + 1] = '\0'; buffer[z - ansi + 1] = '\0';
s_putstring(socket, buffer); s_putstring(socket, buffer);
} else if (body[z] == 'A') { } else if (body[z] == 'A') {
for (i=0;i<atoi(&body[ansi + 2]);i++) { j = atoi(&body[ansi + 2]);
if (j == 0) {
j = 1;
}
for (i=0;i<j;i++) {
if (lines - 1 >= 0) { if (lines - 1 >= 0) {
s_putstring(socket, "\e[1A"); s_putstring(socket, "\e[1A");
lines--; lines--;
@ -834,7 +838,11 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
} }
} }
} else if (body[z] == 'C') { } else if (body[z] == 'C') {
for (i=0;i<atoi(&body[ansi + 2]);i++) { j = atoi(&body[ansi + 2]);
if (j == 0) {
j = 1;
}
for (i=0;i<j;i++) {
if (chars + 1 <= 79) { if (chars + 1 <= 79) {
s_putstring(socket, "\e[1C"); s_putstring(socket, "\e[1C");
chars++; chars++;
@ -843,7 +851,11 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
} }
} }
} else if (body[z] == 'B') { } else if (body[z] == 'B') {
for (i=0;i<atoi(&body[ansi + 2]);i++) { j = atoi(&body[ansi + 2]);
if (j == 0) {
j = 1;
}
for (i=0;i<j;i++) {
if (lines + 1 <= 17) { if (lines + 1 <= 17) {
s_putstring(socket, "\e[1B"); s_putstring(socket, "\e[1B");
lines++; lines++;
@ -852,7 +864,11 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
} }
} }
} else if (body[z] == 'D') { } else if (body[z] == 'D') {
for (i=0;i<atoi(&body[ansi + 2]);i++) { j = atoi(&body[ansi + 2]);
if (j == 0) {
j = 1;
}
for (i=0;i<j;i++) {
if (chars - 1 >= 0) { if (chars - 1 >= 0) {
s_putstring(socket, "\e[1D"); s_putstring(socket, "\e[1D");
chars--; chars--;
@ -860,8 +876,6 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
break; break;
} }
} }
} else {
printf("%c\n", body[z]);
} }
} else { } else {
chars++; chars++;