comparison input/input.c @ 30737:8a9667eccbf7

Support all line ending types in mp_input_read_cmd.
author reimar
date Sat, 27 Feb 2010 23:09:15 +0000
parents d218228dc74d
children 76a13038105e
comparison
equal deleted inserted replaced
30736:5a451be4f907 30737:8a9667eccbf7
955 955
956 while(1) { 956 while(1) {
957 int l = 0; 957 int l = 0;
958 // Find the cmd end 958 // Find the cmd end
959 mp_fd->buffer[mp_fd->pos] = '\0'; 959 mp_fd->buffer[mp_fd->pos] = '\0';
960 end = strchr(mp_fd->buffer,'\r');
961 if (end) *end = '\n';
960 end = strchr(mp_fd->buffer,'\n'); 962 end = strchr(mp_fd->buffer,'\n');
961 // No cmd end ? 963 // No cmd end ?
962 if(!end) { 964 if(!end) {
963 // If buffer is full we must drop all until the next \n 965 // If buffer is full we must drop all until the next \n
964 if(mp_fd->size - mp_fd->pos <= 1) { 966 if(mp_fd->size - mp_fd->pos <= 1) {