Attempt to fix line endings in stdio doors

This commit is contained in:
Andrew Pamment 2016-04-09 10:33:05 +10:00
parent 90986ffbe9
commit d315c1eaa7
3 changed files with 7 additions and 2 deletions

View File

@ -200,6 +200,11 @@ void rundoor(int socket, struct user_record *user, char *cmd, int stdio) {
disconnect(socket);
return;
}
if (c == '\r') {
c == '\n';
} else if (c == '\n' || c == '\0') {
continue;
}
write(master, &c, 1);
} else if (FD_ISSET(master, &fdset)) {
len = read(master, &c, 1);

View File

@ -1,4 +1,4 @@
CC = gcc $(CPPFLAGS) $(CFLAGS) -D__LINUX__ $(LDFLAGS) -Wall
CC = cc $(CPPFLAGS) $(CFLAGS) -D__LINUX__ $(LDFLAGS) -Wall
AR = ar -ru
RM = rm -f