texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/main/translations.c: Exdent prepr


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/XS/main/translations.c: Exdent preprocessor to avoid wrapping the rest of the function in the #else block.
Date: Sat, 18 Nov 2023 05:12:59 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a51a2b8239 * tp/Texinfo/XS/main/translations.c: Exdent preprocessor to 
avoid wrapping the rest of the function in the #else block.
a51a2b8239 is described below

commit a51a2b8239283e3680a8936b7ffe5cef3fbbcea9
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Nov 18 10:12:52 2023 +0000

    * tp/Texinfo/XS/main/translations.c: Exdent preprocessor
    to avoid wrapping the rest of the function in the #else block.
---
 ChangeLog                         |  6 ++++++
 tp/Texinfo/XS/main/translations.c | 18 +++++++-----------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 27562ceaec..e941ec3c3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-11-18  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/main/translations.c: Exdent preprocessor
+       #ifndef directives.  Add a return statement to #ifndef block
+       to avoid wrapping the rest of the function in the #else block.
+
 2023-11-18  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XS/main/translations.c: Remove commented-out
diff --git a/tp/Texinfo/XS/main/translations.c 
b/tp/Texinfo/XS/main/translations.c
index 6dc247cc22..99477990ef 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -179,11 +179,11 @@ translate_string (OPTIONS *options, const char * string,
   return strdup (string);
    */
 
-  #ifndef ENABLE_NLS
-  
+#ifndef ENABLE_NLS
   translated_string = strdup (string);
+  return translated_string;
+#endif ENABLE_NLS
 
-  #else
   /* with the following code valgrind reports issues in perl memory */
 
   /* if a code calls setlocale and accesses global locale while perl
@@ -200,7 +200,7 @@ translate_string (OPTIONS *options, const char * string,
   and (b) this could interfere with the LC_CTYPE setting in XSParagraph.
    */
 
-  #ifndef _WIN32
+#ifndef _WIN32
   /* In
    
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html
     Note: The variable LANGUAGE is ignored if the locale is set to ā€˜Cā€™. In
@@ -228,7 +228,7 @@ translate_string (OPTIONS *options, const char * string,
 
   switch_messages_locale ();
 
-  #endif
+#endif
 
   saved_LANGUAGE = getenv ("LANGUAGE");
 
@@ -334,8 +334,7 @@ translate_string (OPTIONS *options, const char * string,
 
   free (language_locales.text);
 
-  #ifndef _WIN32
-
+#ifndef _WIN32
   if (saved_LANG)
     {
       setenv ("LANG", saved_LANG, 1);
@@ -351,13 +350,10 @@ translate_string (OPTIONS *options, const char * string,
     }
   else
     setlocale (LC_MESSAGES, "");
-
-  #endif
+#endif
 
   call_sync_locale ();
 
-  #endif
-
   return translated_string;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]