From 4fdfe5d4647b2f536ea2c55404a089e3af7b1946 Mon Sep 17 00:00:00 2001 From: Michael Palimaka Date: Thu, 12 Jul 2012 03:26:57 +1000 Subject: [kde-base/pykde4] Fix problem with plugin not loading due to trailing newlines. Patch by Franz Fellner . (Portage version: 2.1.11.5/git/Linux x86_64, unsigned Manifest commit) --- kde-base/pykde4/files/kpythonpluginfactorywrapper.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'kde-base/pykde4/files/kpythonpluginfactorywrapper.c') diff --git a/kde-base/pykde4/files/kpythonpluginfactorywrapper.c b/kde-base/pykde4/files/kpythonpluginfactorywrapper.c index 3915a0d122b..067c042ef15 100644 --- a/kde-base/pykde4/files/kpythonpluginfactorywrapper.c +++ b/kde-base/pykde4/files/kpythonpluginfactorywrapper.c @@ -34,10 +34,18 @@ static void init() { char buf[VERSION_LEN + 1]; memset(buf, 0, VERSION_LEN + 1); get_python_version(buf); + char *s = buf; + while(*s != '\0') { + if(*s == '\n') { + *s = '\0'; + break; + } + ++s; + } int length = strlen(FORMAT) + strlen(buf) + 1; char *name = malloc(length + 1); snprintf(name, length, FORMAT, buf); - void *handle = dlopen(name, RTLD_NOW); + handle = dlopen(name, RTLD_NOW); free(name); wrapped_qt_plugin_instance = dlsym(handle, "qt_plugin_instance"); } -- cgit v1.2.3