Mercurial > mplayer.hg
comparison gui/ui/main.c @ 35384:9c7bba653bfb
Avoid a duplicate strrchr() call.
author | ib |
---|---|
date | Sun, 25 Nov 2012 15:04:44 +0000 |
parents | 6e07bbde3e46 |
children | 8b8534de8b83 |
comparison
equal
deleted
inserted
replaced
35383:fa7a7312c47a | 35384:9c7bba653bfb |
---|---|
607 struct stat buf; | 607 struct stat buf; |
608 int f = 0; | 608 int f = 0; |
609 | 609 |
610 char* subtitles = NULL; | 610 char* subtitles = NULL; |
611 char* filename = NULL; | 611 char* filename = NULL; |
612 char* s; | |
612 | 613 |
613 if (num <= 0) | 614 if (num <= 0) |
614 return; | 615 return; |
615 | 616 |
616 | 617 |
648 listMgr(PLAYLIST_DELETE,0); | 649 listMgr(PLAYLIST_DELETE,0); |
649 } | 650 } |
650 | 651 |
651 item = calloc(1,sizeof(plItem)); | 652 item = calloc(1,sizeof(plItem)); |
652 | 653 |
654 s = strrchr( str,'/' ); | |
655 | |
653 /* FIXME: decompose file name ? */ | 656 /* FIXME: decompose file name ? */ |
654 /* yes -- Pontscho */ | 657 /* yes -- Pontscho */ |
655 if ( strrchr( str,'/' ) ) { | 658 if ( s ) { |
656 char * s = strrchr( str,'/' ); *s=0; s++; | 659 *s=0; s++; |
657 item->name = gstrdup( s ); | 660 item->name = gstrdup( s ); |
658 item->path = gstrdup( str ); | 661 item->path = gstrdup( str ); |
659 } else { | 662 } else { |
660 item->name = strdup(str); | 663 item->name = strdup(str); |
661 item->path = strdup(""); | 664 item->path = strdup(""); |