From 4b695e7972d41f4615beb4c515dceb2566bc7470 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 28 Dec 2013 15:06:43 +0100 Subject: input: print an error if reading input.conf fails stream_read_complete() fails if the file is larger than the requested maximum size. But input.c didn't check for this case, and no indication that something went wrong was printed. --- input/input.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'input') diff --git a/input/input.c b/input/input.c index 94ee64cd4f..ee37ee03d6 100644 --- a/input/input.c +++ b/input/input.c @@ -1426,10 +1426,14 @@ static int parse_config_file(struct input_ctx *ictx, char *file, bool warn) goto done; } bstr data = stream_read_complete(s, tmp, 1000000); - MP_VERBOSE(ictx, "Parsing input config file %s\n", file); - int n_binds = parse_config(ictx, false, data, file, NULL); - MP_VERBOSE(ictx, "Input config file %s parsed: %d binds\n", file, n_binds); - r = 1; + if (data.start) { + MP_VERBOSE(ictx, "Parsing input config file %s\n", file); + int num = parse_config(ictx, false, data, file, NULL); + MP_VERBOSE(ictx, "Input config file %s parsed: %d binds\n", file, num); + r = 1; + } else { + MP_ERR(ictx, "Error reading input config file %s\n", file); + } done: free_stream(s); -- cgit v1.2.3