]> git.pld-linux.org Git - packages/mpg123.git/blob - mpg123-no-la.patch
7ebe0c7ba69dd73526b4b6c95de4e2b3e774edd5
[packages/mpg123.git] / mpg123-no-la.patch
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
3 @@ -102,14 +102,11 @@
4         size_t module_path_len = 0;
5         char* module_symbol = NULL;
6         size_t module_symbol_len = 0;
7 -       char *workdir = NULL;
8         char *moddir  = NULL;
9 -       workdir = get_the_cwd();
10         moddir  = get_module_dir();
11 -       if(workdir == NULL || moddir == NULL)
12 +       if(moddir == NULL)
13         {
14 -               error("Failure getting workdir or moddir!");
15 -               if(workdir != NULL) free(workdir);
16 +               error("Failure getting moddir!");
17                 if(moddir  != NULL) free(moddir);
18                 return NULL;
19         }
20 @@ -117,20 +114,15 @@
21         /* Initialize libltdl */
22         if (lt_dlinit()) error( "Failed to initialise libltdl" );
23  
24 -       if(chdir(moddir) != 0)
25 -       {
26 -               error2("Failed to enter module directory %s: %s", moddir, strerror(errno));
27 -               goto om_bad;
28 -       }
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) );
36                 goto om_bad;
37         }
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 );
42  
43 @@ -179,9 +171,7 @@
44  om_bad:
45         module = NULL;
46  om_end:
47 -       chdir(workdir);
48         free(moddir);
49 -       free(workdir);
50         return module;
51  }
52  
This page took 0.220148 seconds and 2 git commands to generate.