Copy the result from 'nl_langinfo' before it can be overwritten.
authorMark H Weaver <mhw@netris.org>
Thu, 14 Aug 2014 02:47:32 +0000 (22:47 -0400)
committerMark H Weaver <mhw@netris.org>
Thu, 14 Aug 2014 02:47:32 +0000 (22:47 -0400)
commitcfefef6bd96294b373104e85d80bc3f4f3fb482b
treec38a28ef0e5c0f2ad055d73b7bddc42955783be6
parent7c848fe5724666edf667e753b5c828c21748fe31
Copy the result from 'nl_langinfo' before it can be overwritten.

Based on a patch by Eli Zaretskii <eliz@gnu.org>.

* libguile/i18n.c (copy_string_or_null): New static function.
  (scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from
  'nl_langinfo' and 'nl_langinfo_l' before the next call and before
  releasing the locale mutex.
libguile/i18n.c