Timidity: honor the return code from recursive read_config_file() call. stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 15 Jun 2011 16:01:08 -0400
branchstable-1.0
changeset 592 f31f9ceddec9
parent 591 f3fd207c0eea
child 593 941847b13998
Timidity: honor the return code from recursive read_config_file() call.

Fixes Bugzilla #1231.

Thanks to Ozkan Sezer for the patch!
(transplanted from 37e51293133382270277a2b5fb333c60464d723d)
decoders/timidity/timidity.c
--- a/decoders/timidity/timidity.c	Wed Jun 15 16:04:05 2011 -0400
+++ b/decoders/timidity/timidity.c	Wed Jun 15 16:01:08 2011 -0400
@@ -227,9 +227,14 @@
       }
       for (i=1; i<words; i++)
       {
+	int status;
 	rcf_count++;
-	read_config_file(w[i]);
+	status = read_config_file(w[i]);
 	rcf_count--;
+	if (status != 0) {
+	  SDL_RWclose(rw);
+	  return status;
+	}
       }
     }
     else if (!strcmp(w[0], "default"))