summaryrefslogtreecommitdiff
path: root/src/xine-engine/load_plugins.c
diff options
context:
space:
mode:
authorDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-12-15 19:13:59 +0100
committerDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-12-15 19:13:59 +0100
commit4c90da28e5dd01cb5fa01a293c418690d395d9f6 (patch)
treea7f262652b9a62bab6ec567bfced62528f4e4b9d /src/xine-engine/load_plugins.c
parent9c92484c911e0f3d401a0230c90c4bcf40b84c05 (diff)
parente5be769581739cdafd385d55896abca4816ea29e (diff)
downloadxine-lib-4c90da28e5dd01cb5fa01a293c418690d395d9f6.tar.gz
xine-lib-4c90da28e5dd01cb5fa01a293c418690d395d9f6.tar.bz2
Merge from 1.1; update PO files; make buildable.
--HG-- rename : include/xine.h.in => include/xine.h rename : src/xine-utils/attributes.h => include/xine/attributes.h rename : src/xine-engine/buffer.h => include/xine/buffer.h rename : m4/_xine.m4 => m4/types.m4 rename : po/libxine1.pot => po/libxine2.pot rename : src/libfaad/xine_faad_decoder.c => src/audio_dec/xine_faad_decoder.c rename : src/libspucc/cc_decoder.h => src/spu_dec/cc_decoder.h rename : src/libspucmml/xine_cmml_decoder.c => src/spu_dec/cmml_decoder.c rename : src/libspudec/xine_spu_decoder.c => src/spu_dec/spu_decoder.c rename : src/libspudvb/xine_spudvb_decoder.c => src/spu_dec/spudvb_decoder.c rename : src/libspucc/xine_cc_decoder.c => src/spu_dec/xine_cc_decoder.c rename : src/libmpeg2/mpeg2.h => src/video_dec/libmpeg2/mpeg2.h
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r--src/xine-engine/load_plugins.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 7f0497e78..6f5653cb9 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2006 the xine project
+ * Copyright (C) 2000-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -1261,15 +1261,23 @@ void _x_scan_plugins (xine_t *this) {
XINE_PROFILE(load_cached_catalog (this));
if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL && *pluginpath) {
- char *p = pluginpath - 1;
- while (p[1])
+ char *p = pluginpath;
+ while (p && p[0])
{
- char *dir, *q = p;
- p = strchr (p + 1, XINE_PATH_SEPARATOR_CHAR);
+ size_t len;
+ char *dir, *q;
+
+ q = p;
+ p = strchr (p, XINE_PATH_SEPARATOR_CHAR);
+ if (p) {
+ p++;
+ len = p - q;
+ } else
+ len = strlen(q);
if (q[0] == '~' && q[1] == '/')
- asprintf (&dir, "%s%.*s", homedir, (int)(p - q - 1), q + 1);
+ asprintf (&dir, "%s%.*s", homedir, (int)(len - 1), q + 1);
else
- dir = strndup (q, p - q);
+ dir = strndup (q, len);
push_if_dir (plugindirs, dir); /* store or free it */
}
} else {
@@ -2599,12 +2607,11 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) {
* @param joining String to use to join the various strings together.
* @param final_length The pre-calculated final length of the string.
*/
-static char *_x_concatenate_with_string(char **strings, size_t count, char *joining, size_t final_length) {
+static char *_x_concatenate_with_string(char const **strings, size_t count, char *joining, size_t final_length) {
size_t i;
char *const result = malloc(final_length+1); /* Better be safe */
char *str = result;
- size_t pos = 0;
for(i = 0; i < count; i++, strings++) {
if ( *strings ) {
int offset = snprintf(str, final_length, "%s%s", *strings, joining);