summaryrefslogtreecommitdiffstats
path: root/parser-mpcmd.c
diff options
context:
space:
mode:
authorpl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-08 20:07:38 +0000
committerpl <pl@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-08 20:07:38 +0000
commit8ab25e100defd27c95a41a0449c7957a80877d1b (patch)
tree232e4969e6afc5bbe74bc6d7f440108e4aa72882 /parser-mpcmd.c
parentaa1424bfa000471d40707df796abffc59feb6708 (diff)
downloadmpv-8ab25e100defd27c95a41a0449c7957a80877d1b.tar.bz2
mpv-8ab25e100defd27c95a41a0449c7957a80877d1b.tar.xz
fix the bug where only the last file of the command line is found
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10543 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r--parser-mpcmd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c
index d6ea2c0519..3be0a5df2f 100644
--- a/parser-mpcmd.c
+++ b/parser-mpcmd.c
@@ -49,13 +49,13 @@ static int is_entry_option(char *opt, char *param, play_tree_t** ret) {
return 0;
}
-static inline void add_entry(play_tree_t *last_parent,
- play_tree_t *last_entry, play_tree_t *entry) {
- if(last_entry == NULL)
- play_tree_set_child(last_parent,entry);
+static inline void add_entry(play_tree_t **last_parentp,
+ play_tree_t **last_entryp, play_tree_t *entry) {
+ if(*last_entryp == NULL)
+ play_tree_set_child(*last_parentp,entry);
else
- play_tree_append_entry(last_entry,entry);
- last_entry = entry;
+ play_tree_append_entry(*last_entryp,entry);
+ *last_entryp = entry;
}
play_tree_t*
@@ -162,7 +162,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
if(tmp > 0) { // It's an entry
if(entry) {
- add_entry(last_parent,last_entry,entry);
+ add_entry(&last_parent,&last_entry,entry);
if((last_parent->flags & PLAY_TREE_RND) && entry->child)
entry->flags |= PLAY_TREE_RND;
UNSET_GLOBAL;
@@ -203,7 +203,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
// Lock stdin if it will be used as input
if(strcasecmp(argv[i],"-") == 0)
m_config_set_option(config,"use-stdin",NULL);
- add_entry(last_parent,last_entry,entry);
+ add_entry(&last_parent,&last_entry,entry);
UNSET_GLOBAL; // We start entry specific options
}