summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-28 15:06:43 +0100
committerwm4 <wm4@nowhere>2013-12-28 15:06:43 +0100
commit4b695e7972d41f4615beb4c515dceb2566bc7470 (patch)
tree1a002ab568713d90a0f972721e3434999a19934f
parentf146e9b15a3d3db5155351d32204af61626f9e01 (diff)
downloadmpv-4b695e7972d41f4615beb4c515dceb2566bc7470.tar.bz2
mpv-4b695e7972d41f4615beb4c515dceb2566bc7470.tar.xz
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.
-rw-r--r--input/input.c12
1 files changed, 8 insertions, 4 deletions
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);