qulogic/libgnt

Make C_ a bit easier to read.

2019-10-03, Gary Kramlich
a94fe28b9ca7
Parents bf1681ecc819
Children ed46cdad68e9
Make C_ a bit easier to read.
  • +10 -6
    gntmain.c
  • --- a/gntmain.c Thu Oct 03 06:35:32 2019 -0500
    +++ b/gntmain.c Thu Oct 03 22:44:56 2019 -0500
    @@ -932,7 +932,11 @@
    */
    const char *C_(const char *x)
    {
    - static char *c = NULL;
    + static gchar *c = NULL;
    +
    + /* clear the old value we had for cm since it's no longer needed */
    + g_free(c);
    +
    if (gnt_need_conversation_to_locale) {
    GError *error = NULL;
    gchar *newc = NULL;
    @@ -947,12 +951,12 @@
    }
    if(newc != NULL) {
    - g_free(c);
    c = newc;
    - }
    - return c != NULL ? c : x;
    - } else
    - return x;
    + return c;
    + }
    + }
    +
    + return x;
    }