vlc | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Fri Jun 12 
23:16:17 2015 +0300| [a6e49e68a0f8772999bbcf2918da2f2ec117e83d] | committer: 
Rémi Denis-Courmont

config: assume UTF-8 vlcrc

8 and a half years should have been enough to transition.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6e49e68a0f8772999bbcf2918da2f2ec117e83d
---

 src/config/file.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/config/file.c b/src/config/file.c
index b445698..3c1712a 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -174,16 +174,10 @@ int config_LoadConfigFile( vlc_object_t *p_this )
     if (file == NULL)
         return VLC_EGENERIC;
 
-    /* Look for UTF-8 Byte Order Mark */
-    char * (*convert) (const char *) = strdupnull;
+    /* Skip UTF-8 Byte Order Mark if present */
     char bom[3];
-
-    if ((fread (bom, 1, 3, file) != 3)
-     || memcmp (bom, "\xEF\xBB\xBF", 3))
-    {
-        convert = FromLocaleDup;
+    if (fread (bom, 1, 3, file) != 3 || memcmp (bom, "\xEF\xBB\xBF", 3))
         rewind (file); /* no BOM, rewind */
-    }
 
     char *line = NULL;
     size_t bufsize;
@@ -243,7 +237,7 @@ int config_LoadConfigFile( vlc_object_t *p_this )
 
             default:
                 free ((char *)item->value.psz);
-                item->value.psz = convert (psz_option_value);
+                item->value.psz = strdupnull (psz_option_value);
                 break;
         }
     }

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to