[MPlayer-cvslog] r35478 - trunk/gui/ui/main.c

ib subversion at mplayerhq.hu
Sun Nov 25 16:04:44 CET 2012


Author: ib
Date: Sun Nov 25 16:04:44 2012
New Revision: 35478

Log:
Avoid a duplicate strrchr() call.

Modified:
   trunk/gui/ui/main.c

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Sun Nov 25 15:46:47 2012	(r35477)
+++ trunk/gui/ui/main.c	Sun Nov 25 16:04:44 2012	(r35478)
@@ -609,6 +609,7 @@ void uiDandDHandler(int num,char** files
 
   char* subtitles = NULL;
   char* filename = NULL;
+  char* s;
 
   if (num <= 0)
     return;
@@ -650,10 +651,12 @@ void uiDandDHandler(int num,char** files
 
       item = calloc(1,sizeof(plItem));
 
+      s = strrchr( str,'/' );
+
       /* FIXME: decompose file name ? */
       /* yes -- Pontscho */
-      if ( strrchr( str,'/' ) ) {
-	char * s = strrchr( str,'/' ); *s=0; s++;
+      if ( s ) {
+	*s=0; s++;
 	item->name = gstrdup( s );
 	item->path = gstrdup( str );
       } else {


More information about the MPlayer-cvslog mailing list