changeset 8274:be311f828476

Fix endless-loop if no newline at input.conf EOF
author atmos4
date Mon, 25 Nov 2002 13:28:40 +0000
parents 226e6866212d
children 1fb6b78d62d6
files input/input.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Mon Nov 25 02:19:27 2002 +0000
+++ b/input/input.c	Mon Nov 25 13:28:40 2002 +0000
@@ -1239,15 +1239,15 @@
 	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;