[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: -do gettext setup for each library/domai
From: |
gnunet |
Subject: |
[gnunet] branch master updated: -do gettext setup for each library/domain, not only once |
Date: |
Tue, 28 Jun 2022 12:05:28 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 7b99bec5d -do gettext setup for each library/domain, not only once
7b99bec5d is described below
commit 7b99bec5d82a749bf060f2eb8874678c5a6f09ab
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jun 28 12:05:25 2022 +0200
-do gettext setup for each library/domain, not only once
---
src/util/os_installation.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 171bb5baa..1835c6e84 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- Copyright (C) 2006-2018 GNUnet e.V.
+ Copyright (C) 2006-2018, 2022 GNUnet e.V.
GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
@@ -80,11 +80,12 @@ static const struct GNUNET_OS_ProjectData default_pd = {
static const struct GNUNET_OS_ProjectData *current_pd = &default_pd;
/**
- * Whether or not gettext has been initialized for the library.
+ * PD for which gettext has been initialized last.
* Note that the gettext initialization done within
* GNUNET_PROGRAM_run2 is for the specific application.
*/
-static int gettextinit = 0;
+static const struct GNUNET_OS_ProjectData *gettextinit;
+
/**
* Return default project data used by 'libgnunetutil' for GNUnet.
@@ -102,13 +103,15 @@ GNUNET_OS_project_data_default (void)
const struct GNUNET_OS_ProjectData *
GNUNET_OS_project_data_get ()
{
- if (0 == gettextinit)
+ if (current_pd != gettextinit)
{
char *path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LOCALEDIR);
+
if (NULL != path)
- bindtextdomain (PACKAGE, path);
+ bindtextdomain (PACKAGE,
+ path);
GNUNET_free (path);
- gettextinit = 1;
+ gettextinit = current_pd;
}
return current_pd;
}
@@ -122,16 +125,18 @@ GNUNET_OS_project_data_get ()
void
GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd)
{
- if (0 == gettextinit)
+ GNUNET_assert (NULL != pd);
+ current_pd = pd;
+ if (pd != gettextinit)
{
char *path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LOCALEDIR);
+
if (NULL != path)
- bindtextdomain (PACKAGE, path);
+ bindtextdomain (PACKAGE,
+ path);
GNUNET_free (path);
- gettextinit = 1;
+ gettextinit = pd;
}
- GNUNET_assert (NULL != pd);
- current_pd = pd;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: -do gettext setup for each library/domain, not only once,
gnunet <=