LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mpg123-remove_reldir_fallback.patch of Package mpg123 (Project home:computersalat:devel:mlibs)

Index: src/module.c
===================================================================
--- src/module.c.orig
+++ src/module.c
@@ -23,15 +23,6 @@
 #define MODULE_SYMBOL_PREFIX 	"mpg123_"
 #define MODULE_SYMBOL_SUFFIX 	"_module_info"
 
-/* It's nasty to hardcode that here...
-   also it does need hacking around libtool's hardcoded .la paths:
-   When the .la file is in the same dir as .so file, you need libdir='.' in there. */
-static const char* modulesearch[] =
-{
-	 "../lib/mpg123"
-	,"plugins"
-};
-
 static char *get_the_cwd(); /* further down... */
 static char *get_module_dir()
 {
@@ -58,35 +49,6 @@ static char *get_module_dir()
 		}
 		closedir(dir);
 	}
-	else /* Search relative to binary. */
-	{
-		size_t i;
-		for(i=0; i<sizeof(modulesearch)/sizeof(char*); ++i)
-		{
-			const char *testpath = modulesearch[i];
-			size_t l;
-			if(binpath != NULL) l = strlen(binpath) + strlen(testpath) + 1;
-			else l = strlen(testpath);
-
-			moddir = malloc(l+1);
-			if(moddir != NULL)
-			{
-				if(binpath==NULL) /* a copy of testpath, when there is no prefix */
-				snprintf(moddir, l+1, "%s", testpath);
-				else
-				snprintf(moddir, l+1, "%s/%s", binpath, testpath);
-
-				moddir[l] = 0;
-				if(param.verbose > 1) fprintf(stderr, "Looking for module dir: %s\n", moddir);
-
-				dir = opendir(moddir);
-				closedir(dir);
-
-				if(dir != NULL) break; /* found it! */
-				else{ free(moddir); moddir=NULL; }
-			}
-		}
-	}
 	if(param.verbose > 1) fprintf(stderr, "Module dir: %s\n", moddir != NULL ? moddir : "<nil>");
 	return moddir;
 }