Mercurial > mplayer.hg
comparison input/input.c @ 8274:be311f828476
Fix endless-loop if no newline at input.conf EOF
author | atmos4 |
---|---|
date | Mon, 25 Nov 2002 13:28:40 +0000 |
parents | 772d6d27fd66 |
children | 1fb6b78d62d6 |
comparison
equal
deleted
inserted
replaced
8273:226e6866212d | 8274:be311f828476 |
---|---|
1237 continue; | 1237 continue; |
1238 mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading input config file %s : %s\n",file,strerror(errno)); | 1238 mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading input config file %s : %s\n",file,strerror(errno)); |
1239 mp_input_free_binds(binds); | 1239 mp_input_free_binds(binds); |
1240 close(fd); | 1240 close(fd); |
1241 return 0; | 1241 return 0; |
1242 } else if(r == 0) | 1242 } else if(r == 0) { |
1243 eof = 1; | 1243 eof = 1; |
1244 else { | 1244 } else { |
1245 bs += r+1; | 1245 bs += r+1; |
1246 buffer[bs-1] = '\0'; | 1246 buffer[bs-1] = '\0'; |
1247 } | 1247 } |
1248 } | 1248 } |
1249 // Empty buffer : return | 1249 // Empty buffer : return |
1250 if(bs <= 0) { | 1250 if(eof || (bs <= 0)) { |
1251 mp_msg(MSGT_INPUT,MSGL_INFO,"Input config file %s parsed : %d binds\n",file,n_binds); | 1251 mp_msg(MSGT_INPUT,MSGL_INFO,"Input config file %s parsed : %d binds\n",file,n_binds); |
1252 if(binds) | 1252 if(binds) |
1253 cmd_binds = binds; | 1253 cmd_binds = binds; |
1254 close(fd); | 1254 close(fd); |
1255 return 1; | 1255 return 1; |