From: Darren S. <li...@yo...> - 2008-07-02 18:29:07
|
I demand that Matthias Ringwald may or may not have written... > I've somehow managed to compile xine-lib-1.1.13 using mingw on windows > (patches for build fixes will follow soon). > muxine.c (without the x11 part) crashes in xine_get_pluginroot() in line > 400 which was recently added with the comment "... completely untested". :) > > in xine-utils/utils.c: > 396 char *sep, *sep2; > 397 strcpy (pluginroot, xine_get_plugindir ()); > 398 sep = strrchr (pluginroot, '/'); > 399 sep2 = strrchr (pluginroot, '\\'); > 400 *(sep < sep2 ? sep : sep2) = 0; > > for me, the xine_get_plugindir() gives "c:\lib\xine\plugins\1.2" if the > path does _not_ contain both '\' and '/', either sep or sep2 will be NULL > which leads to a segfault. (I guess the compare operator should be > switched.) This *should* fix it: diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -397,7 +397,12 @@ const char *xine_get_pluginroot(void) { strcpy (pluginroot, xine_get_plugindir ()); sep = strrchr (pluginroot, '/'); sep2 = strrchr (pluginroot, '\\'); - *(sep < sep2 ? sep : sep2) = 0; + if (sep > sep2) + *sep = 0; + else if (sep2) + *sep2 = 0; + else + strcpy (pluginroot, "."); } return pluginroot; > however, on linux, xine_get_plugindir is just hardcoded to something > like "c:\lib\xine\plugins\1." Hmm? Not something like /usr/local/lib/c:\\lib\\xine\\plugins\\1? ;-) > should the dynamic xine_get_plugindir retrieve " "../xine/plugins/1." ? Not sure. Whatever's appropriate on Wndws; xine_get_pluginroot just follows the rest being dynamic on that OS. [snip] -- | Darren Salt | linux or ds at | nr. Ashington, | Toon | RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army | + Use more efficient products. Use less. BE MORE ENERGY EFFICIENT. "... sometimes I've travelled quite widely in the universe ..." - Tom Baker |