--- src/osd/osd_parser.c	Sat Sep  8 14:48:29 2007
+++ src/osd/osd_parser.c	Tue Sep 18 18:33:08 2007
@@ -340,13 +340,12 @@
         size_t i_len = 0;
         long pos = 0;
 
+        /* read images path */
+        result = fscanf(fd, "%24s %255s", &action[0], &path[0] );
+
         /* override images path ? */
         psz_path = config_GetPsz( p_this, "osdmenu-file-path" );
-        if( psz_path == NULL )
-        {
-            result = fscanf(fd, "%24s %255s", &action[0], &path[0] );
-        }
-        else
+        if( psz_path != NULL )
         {
             /* psz_path is not null and therefor &path[0] cannot be NULL
              * it might be null terminated.
@@ -361,10 +360,10 @@
         if( i_len == MAX_FILE_PATH )
             i_len--; /* truncate to prevent buffer overflow */
 #if defined(WIN32) || defined(UNDER_CE)
-        if( (i_len > 0) && path[i_len] != '\\' )
+        if( (i_len > 0) && path[i_len-1] != '\\' && path[i_len-1] != '/' )
             path[i_len] = '\\';
 #else
-        if( (i_len > 0) && path[i_len] != '/' )
+        if( (i_len > 0) && path[i_len-1] != '/' )
             path[i_len] = '/';
 #endif
         path[i_len+1] = '\0';
