Skip to content

Commit

Permalink
Added /usr/share/timidity to the default path
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 10, 2009
1 parent 7741747 commit 5e62835
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 8 additions & 2 deletions timidity/common.c
Expand Up @@ -112,12 +112,18 @@ FILE *open_file(const char *name, int decompress, int noise_mode)
return 0;
}

#ifdef DEFAULT_PATH
if (pathlist==NULL) {
/* Generate path list */
#ifdef DEFAULT_PATH
add_to_pathlist(DEFAULT_PATH);
}
#endif
#ifdef DEFAULT_PATH1
add_to_pathlist(DEFAULT_PATH1);
#endif
#ifdef DEFAULT_PATH2
add_to_pathlist(DEFAULT_PATH2);
#endif
}

/* First try the given name */

Expand Down
5 changes: 3 additions & 2 deletions timidity/config.h
Expand Up @@ -171,12 +171,13 @@ typedef char int8;
then specify the library directory in the configuration file. */
#define CONFIG_FILE "timidity.cfg"
#define CONFIG_FILE_ETC "/etc/timidity.cfg"
#define CONFIG_FILE_ETC_TIMIDITY "/etc/timidity/timidity.cfg"

#if defined(__WIN32__) || defined(__OS2__)
#define DEFAULT_PATH "C:\\TIMIDITY"
#else
#define DEFAULT_PATH "/usr/local/lib/timidity"
#define DEFAULT_PATH "/etc/timidity"
#define DEFAULT_PATH1 "/usr/share/timidity"
#define DEFAULT_PATH2 "/usr/local/lib/timidity"
#endif

/* These affect general volume */
Expand Down
4 changes: 1 addition & 3 deletions timidity/timidity.c
Expand Up @@ -298,9 +298,7 @@ int Timidity_Init(int rate, int format, int channels, int samples)
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);
}
return(-1);
}
}
}
Expand Down

0 comments on commit 5e62835

Please sign in to comment.