Skip to content

Commit

Permalink
Fixed bug #517
Browse files Browse the repository at this point in the history
Sam Lantinga - Sat Oct  3 02:49:41 PDT 2009
 * Added TIMIDITY_CFG environment variable to fully locate timidity.cfg
  • Loading branch information
slouken committed Oct 3, 2009
1 parent 315a17d commit 6bbd26a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,4 +1,6 @@
1.2.9:
Sam Lantinga - Sat Oct 3 02:49:41 PDT 2009
* Added TIMIDITY_CFG environment variable to fully locate timidity.cfg
O.Sezer - 2009-10-02 08:41:50 PDT
* Fixed memory corruption in music initialization
Sam Lantinga - Sat Oct 3 07:53:24 2009 UTC
Expand Down
2 changes: 1 addition & 1 deletion timidity/config.h
Expand Up @@ -174,7 +174,7 @@ typedef char int8;
#define CONFIG_FILE_ETC_TIMIDITY "/etc/timidity/timidity.cfg"

#if defined(__WIN32__) || defined(__OS2__)
#define DEFAULT_PATH "\\TIMIDITY"
#define DEFAULT_PATH "C:\\TIMIDITY"
#else
#define DEFAULT_PATH "/usr/local/lib/timidity"
#endif
Expand Down
11 changes: 7 additions & 4 deletions timidity/timidity.c
Expand Up @@ -294,10 +294,13 @@ static int read_config_file(char *name)

int Timidity_Init(int rate, int format, int channels, int samples)
{
if (read_config_file(CONFIG_FILE)<0) {
if (read_config_file(CONFIG_FILE_ETC)<0) {
if (read_config_file(CONFIG_FILE_ETC_TIMIDITY)<0) {
return(-1);
const char *env = getenv("TIMIDITY_CFG");
if (!env || read_config_file(env)<0) {
if (read_config_file(CONFIG_FILE)<0) {
if (read_config_file(CONFIG_FILE_ETC)<0) {
if (read_config_file(CONFIG_FILE_ETC_TIMIDITY)<0) {
return(-1);
}
}
}
}
Expand Down

0 comments on commit 6bbd26a

Please sign in to comment.