# HG changeset patch # User pl # Date 1060373258 0 # Node ID 928c02fa994997f99a3229b21e45a5e57beb13f0 # Parent ac7cf57f21533fda8acbacd7e5721b3b600f3953 fix the bug where only the last file of the command line is found diff -r ac7cf57f2153 -r 928c02fa9949 parser-mpcmd.c --- a/parser-mpcmd.c Fri Aug 08 09:28:39 2003 +0000 +++ b/parser-mpcmd.c Fri Aug 08 20:07:38 2003 +0000 @@ -49,13 +49,13 @@ 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 @@ tmp = is_entry_option(opt,(i+1 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 @@ // 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 }