From 6f68af620831f6883852edea63693507bb6af39a Mon Sep 17 00:00:00 2001 From: atmos4 Date: Mon, 25 Nov 2002 13:28:40 +0000 Subject: Fix endless-loop if no newline at input.conf EOF git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8275 b3059339-0415-0410-9bf9-f77b7e298cf2 --- input/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'input') diff --git a/input/input.c b/input/input.c index e68f9632f8..f6b6b823bb 100644 --- a/input/input.c +++ b/input/input.c @@ -1239,15 +1239,15 @@ mp_input_parse_config(char *file) { mp_input_free_binds(binds); close(fd); return 0; - } else if(r == 0) + } else if(r == 0) { eof = 1; - else { + } else { bs += r+1; buffer[bs-1] = '\0'; } } // Empty buffer : return - if(bs <= 0) { + if(eof || (bs <= 0)) { mp_msg(MSGT_INPUT,MSGL_INFO,"Input config file %s parsed : %d binds\n",file,n_binds); if(binds) cmd_binds = binds; -- cgit v1.2.3