[MPlayer-cvslog] r34181 - trunk/gui/win32/dialogs.c

ib subversion at mplayerhq.hu
Thu Oct 6 14:21:46 CEST 2011


Author: ib
Date: Thu Oct  6 14:21:46 2011
New Revision: 34181

Log:
Simplify building filename by using strcpy().

Additionally, don't add filespec if it's empty.

Modified:
   trunk/gui/win32/dialogs.c

Modified: trunk/gui/win32/dialogs.c
==============================================================================
--- trunk/gui/win32/dialogs.c	Thu Oct  6 14:09:05 2011	(r34180)
+++ trunk/gui/win32/dialogs.c	Thu Oct  6 14:21:46 2011	(r34181)
@@ -127,10 +127,13 @@ int display_openfilewindow(gui_t *gui, i
         do
         {
             filespec = &fileopen.lpstrFile[fileopen.nFileOffset];
-            filename[0] = 0;
-            strcat(filename, directory);
+            strcpy(filename, directory);
+
+            if (*filespec)
+            {
             strcat(filename, "/");
             strcat(filename, filespec);
+            }
 
             if (GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY)
                 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] %s is a directory, skipping...\n", filename);


More information about the MPlayer-cvslog mailing list