Commit 6d316cc7 authored by Benjamin Pracht's avatar Benjamin Pracht

fixes a infinite loop in the search function.

parent 31d87e5d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin * playlist.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.46 2003/11/20 02:39:09 hartman Exp $ * $Id: playlist.m,v 1.47 2003/12/10 12:57:12 bigben Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
- (IBAction)searchItem:(id)sender - (IBAction)searchItem:(id)sender
{ {
int i_current = 0; int i_current = -1;
NSString *o_current_name; NSString *o_current_name;
NSString *o_current_author; NSString *o_current_author;
...@@ -280,15 +280,17 @@ ...@@ -280,15 +280,17 @@
if ([o_table_view selectedRow] == [o_table_view numberOfRows]-1 ) if ([o_table_view selectedRow] == [o_table_view numberOfRows]-1 )
{ {
i_current = 0; i_current =-1;
} }
else else
{ {
i_current = [o_table_view selectedRow]+1; i_current = [o_table_view selectedRow];
} }
while (i_current != [o_table_view selectedRow]) do
{ {
i_current++;
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_current_name = [NSString stringWithUTF8String: o_current_name = [NSString stringWithUTF8String:
p_playlist->pp_items[i_current]->psz_name]; p_playlist->pp_items[i_current]->psz_name];
...@@ -306,13 +308,10 @@ ...@@ -306,13 +308,10 @@
} }
if ( i_current == [o_table_view numberOfRows] - 1 ) if ( i_current == [o_table_view numberOfRows] - 1 )
{ {
i_current = 0; i_current = -1;
}
else
{
i_current++;
} }
} }
while (i_current != [o_table_view selectedRow]);
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment