1 --- mpg123-1.12.3/src/module.c.orig 2010-07-05 00:03:03.000000000 +0200
2 +++ mpg123-1.12.3/src/module.c 2010-08-12 16:06:12.000000000 +0200
4 size_t module_path_len = 0;
5 char* module_symbol = NULL;
6 size_t module_symbol_len = 0;
7 - char *workdir = NULL;
9 - workdir = get_the_cwd();
10 moddir = get_module_dir();
11 - if(workdir == NULL || moddir == NULL)
14 - error("Failure getting workdir or moddir!");
15 - if(workdir != NULL) free(workdir);
16 + error("Failure getting moddir!");
17 if(moddir != NULL) free(moddir);
21 /* Initialize libltdl */
22 if (lt_dlinit()) error( "Failed to initialise libltdl" );
24 - if(chdir(moddir) != 0)
26 - error2("Failed to enter module directory %s: %s", moddir, strerror(errno));
29 /* Work out the path of the module to open */
30 /* Note that we need to open ./file, not just file! */
31 - module_path_len = 2 + strlen(type) + 1 + strlen(name) + strlen(MODULE_FILE_SUFFIX) + 1;
32 + module_path_len = strlen(moddir) + 1 + strlen(type) + 1 + strlen(name) + strlen(MODULE_FILE_SUFFIX) + 1;
33 module_path = malloc( module_path_len );
34 if (module_path == NULL) {
35 error1( "Failed to allocate memory for module name: %s", strerror(errno) );
38 - snprintf( module_path, module_path_len, "./%s_%s%s", type, name, MODULE_FILE_SUFFIX );
39 + snprintf( module_path, module_path_len, "%s/%s_%s%s", moddir, type, name, MODULE_FILE_SUFFIX );
40 /* Display the path of the module created */
41 if(param.verbose > 1) fprintf(stderr, "Module path: %s\n", module_path );