]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Unconditionally call __gconv_get_path when reading iconv configuration
authorArjun Shankar <arjun@redhat.com>
Mon, 5 Nov 2018 14:45:07 +0000 (15:45 +0100)
committerArjun Shankar <arjun@redhat.com>
Mon, 5 Nov 2018 14:45:07 +0000 (15:45 +0100)
__gconv_read_conf is only ever called once during the program's lifetime.
This means that __gconv_path_elem is always uninitialized when the function
begins executing.  __gconv_get_path has an assert to ensure that this
expected runtime behaviour is always exhibited.  Given this, checking for a
NULL value before calling __gconv_get_path is unnecessary.  This commit
drops the condition and calls __gconv_get_path unconditionally.

ChangeLog
iconv/gconv_conf.c

index 5268012d249a9020eab17ee3059c534b75154a33..d7ee676cf8ccce17b459f2d598b848f2786cc259 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-05  Arjun Shankar  <arjun@redhat.com>
+
+       * iconv/gconv_conf.c (__gconv_read_conf): Remove NULL check for
+       __gconv_path_elem and call __gconv_get_path unconditionally.
+
 2018-11-05  Andreas Schwab  <schwab@suse.de>
 
        [BZ #22927]
index 78010491e6e5d2ca43f248f239f979b462b4f6f3..2b73dd8f459ca99c6c6e4b174332ce0e713a4b17 100644 (file)
@@ -552,8 +552,7 @@ __gconv_read_conf (void)
 
 #ifndef STATIC_GCONV
   /* Find out where we have to look.  */
-  if (__gconv_path_elem == NULL)
-    __gconv_get_path ();
+  __gconv_get_path ();
 
   for (cnt = 0; __gconv_path_elem[cnt].name != NULL; ++cnt)
     {