]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Signal a change of the loaded catalogs in libintl_setlocale.
authorDaiki Ueno <ueno@gnu.org>
Thu, 7 Mar 2013 08:47:37 +0000 (17:47 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 25 Jun 2013 07:38:33 +0000 (16:38 +0900)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/setlocale.c

index 8b1f4dae3bf6934be0a1e476d2cdae5dbda6bcf9..562c282ac9525951fa9f6e1c35f7162d4e90fd63 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-07  Daiki Ueno  <ueno@gnu.org>
+
+       * setlocale.c (libintl_setlocale): Signal a change of the loaded
+       catalogs by incrementing _nl_msg_cat_cntr.
+       Reported by Guido Flohr at <https://savannah.gnu.org/bugs/?38162>.
+
 2013-05-30  Thomas Petazzoni <thomas.petazzoni@free-electrons.com>  (tiny change)
 
        * Makefile.in (SHELL): Use @SHELL@ instead of /bin/sh.
index b33bff5d5e2b880cb0375c14e11823c925d337fc..45fbc7b75b90347155fb2aea66cab6f8807bf135 100644 (file)
@@ -884,6 +884,7 @@ libintl_setlocale (int category, const char *locale)
             }
 
           /* All steps were successful.  */
+          ++_nl_msg_cat_cntr;
           free (saved_locale);
           return setlocale (LC_ALL, NULL);
 
@@ -895,12 +896,16 @@ libintl_setlocale (int category, const char *locale)
         }
       else
         {
+          char *result;
           const char *name =
             gl_locale_name_environ (category, category_to_name (category));
           if (name == NULL)
             name = gl_locale_name_default ();
 
-          return setlocale_single (category, name);
+          result = setlocale_single (category, name);
+          if (result != NULL)
+            ++_nl_msg_cat_cntr;
+          return result;
         }
     }
   else
@@ -936,12 +941,18 @@ libintl_setlocale (int category, const char *locale)
             }
 
           /* It was really successful.  */
+          ++_nl_msg_cat_cntr;
           free (saved_locale);
           return setlocale (LC_ALL, NULL);
         }
       else
 # endif
-        return setlocale_single (category, locale);
+        {
+          char *result = setlocale_single (category, locale);
+          if (result != NULL)
+            ++_nl_msg_cat_cntr;
+          return result;
+        }
     }
 }