summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-30 21:22:24 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-30 21:22:24 +0100
commitfd3e9a424015a7fa6de4027658628e2c5c9263a6 (patch)
tree864aefac4e4b458775ef04db879a35cf0f91c601 /playlist.c
parent9ffb5924be3a78c5c0e5512b2616d1307ee35944 (diff)
fixed bug in uri location handler (pl_insert_file)
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/playlist.c b/playlist.c
index 1427fe02..06b6970c 100644
--- a/playlist.c
+++ b/playlist.c
@@ -550,7 +550,7 @@ pl_insert_pls (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
playItem_t *
pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(playItem_t *it, void *data), void *user_data) {
- if (!fname) {
+ if (!fname || !(*fname)) {
return NULL;
}
@@ -580,7 +580,7 @@ pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(pla
if (strncasecmp (fname, "file://", 7)) {
const char *p = fname;
int detect_on_access = 1;
- for (p = fname; *p; p++) {
+ for (; *p; p++) {
if (!strncmp (p, "://", 3)) {
break;
}
@@ -589,7 +589,7 @@ pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(pla
break;
}
}
- if (detect_on_access && *fname != ':') {
+ if (detect_on_access && *p == ':') {
playItem_t *it = pl_item_alloc ();
it->decoder = NULL;
it->fname = strdup (fname);