gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-937


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-937-gb891ac9
Date: Mon, 18 Jul 2016 02:51:05 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-4.1-stable has been updated
       via  b891ac9e41cd87d603ebd161a0f30261a6f2fa22 (commit)
       via  f3c40366f29a270cb659cedf241b708fcfedb679 (commit)
      from  87e61996806174f405b0aab9c92688945b9dca77 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b891ac9e41cd87d603ebd161a0f30261a6f2fa22

commit b891ac9e41cd87d603ebd161a0f30261a6f2fa22
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Jul 18 05:50:36 2016 +0300

    Sync dfa.c with GNU grep.

diff --git a/ChangeLog b/ChangeLog
index c341c68..ff16c73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2016-07-17         Arnold D. Robbins     <address@hidden>
+2016-07-18         Arnold D. Robbins     <address@hidden>
 
        * main.c (locale_dir): New variable, init to LOCALEDIR (set by
        configure).
@@ -10,6 +10,10 @@
        locale debugging, call set_locale_stuff again if arg parsing changed
        the locale.
 
+       Unrelated:
+
+       * dfa.c: Sync with GNU grep.
+
 2016-07-17         Arnold D. Robbins     <address@hidden>
 
        * eval.c (set_LINT): Reset lintfunc to `warning' for LINT="invalid".
diff --git a/dfa.c b/dfa.c
index f9e8eb0..fcc0dd4 100644
--- a/dfa.c
+++ b/dfa.c
@@ -1981,7 +1981,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
 
 /* Copy one set to another.  */
 static void
-copy (position_set const *src, position_set * dst)
+copy (position_set const *src, position_set *dst)
 {
   if (dst->alloc < src->nelem)
     {
@@ -1994,7 +1994,7 @@ copy (position_set const *src, position_set * dst)
 }
 
 static void
-alloc_position_set (position_set * s, size_t size)
+alloc_position_set (position_set *s, size_t size)
 {
   s->elems = xnmalloc (size, sizeof *s->elems);
   s->alloc = size;
@@ -2006,7 +2006,7 @@ alloc_position_set (position_set * s, size_t size)
    then merge (logically-OR) P's constraints into the one in S.
    S->elems must point to an array large enough to hold the resulting set.  */
 static void
-insert (position p, position_set * s)
+insert (position p, position_set *s)
 {
   size_t count = s->nelem;
   size_t lo = 0, hi = count;
@@ -2036,7 +2036,7 @@ insert (position p, position_set * s)
 /* Merge two sets of positions into a third.  The result is exactly as if
    the positions of both sets were inserted into an initially empty set.  */
 static void
-merge (position_set const *s1, position_set const *s2, position_set * m)
+merge (position_set const *s1, position_set const *s2, position_set *m)
 {
   size_t i = 0, j = 0;
 
@@ -2065,7 +2065,7 @@ merge (position_set const *s1, position_set const *s2, 
position_set * m)
 
 /* Delete a position from a set.  */
 static void
-delete (position p, position_set * s)
+delete (position p, position_set *s)
 {
   size_t i;
 
@@ -2644,8 +2644,8 @@ dfastate (state_num s, struct dfa *d, state_num trans[])
       prtok (d->tokens[pos.index]);
       fprintf (stderr, " of");
       for (j = 0; j < NOTCHAR; j++)
-      if (tstbit (j,  matches))
-        fprintf (stderr, " 0x%02zx", j);
+        if (tstbit (j, matches))
+          fprintf (stderr, " 0x%02zx", j);
       fprintf (stderr, "\n");
 #endif
 

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=f3c40366f29a270cb659cedf241b708fcfedb679

commit f3c40366f29a270cb659cedf241b708fcfedb679
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Jul 18 05:35:19 2016 +0300

    Reenable translation during arg parsing.

diff --git a/ChangeLog b/ChangeLog
index 0cd422a..c341c68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2016-07-17         Arnold D. Robbins     <address@hidden>
 
+       * main.c (locale_dir): New variable, init to LOCALEDIR (set by
+       configure).
+       (set_locale_stuff): Move calls to bindtextdomain and
+       textdomain to here; they must be done after calling setlocale.
+       Use locale_dir instead of LOCALEDIR.
+       (main): Move call to set_locale_stuff() to before parsing arguments.
+       Check for GAWK_LOCALE_DIR env var and use it if there. If doing
+       locale debugging, call set_locale_stuff again if arg parsing changed
+       the locale.
+
+2016-07-17         Arnold D. Robbins     <address@hidden>
+
        * eval.c (set_LINT): Reset lintfunc to `warning' for LINT="invalid".
        Thanks to Andy Schorr for the report.
 
diff --git a/NEWS b/NEWS
index 8474e69..ca891f8 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,14 @@ Changes from 4.1.3 to 4.1.4
 
 11. The -d option now allows -d- to print to standard output.
 
+12. Error messages for --help and in other instances should now get
+    translated correctly.
+
+13. A new environment variable GAWK_LOCALE_DIR may be set to locate the .mo
+    file for gawk itself.
+
+14. A number of bugs have been fixed. See the ChangeLog.
+
 Changes from 4.1.2 to 4.1.3
 ---------------------------
 
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 24929ef..d06f563 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-17         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in: Document GAWK_LOCALE_DIR env var and also to not
+       use LANGUAGE env var.
+
 2016-07-12         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in (Auto-set): Add example use of multiply function.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 6bf97ae..002936c 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -4477,6 +4477,11 @@ are generated.  Its purpose is to help isolate the 
source of a
 message, as there are multiple places that produce the
 same warning or error message.
 
address@hidden GAWK_LOCALE_DIR
+Specifies the location of compiled message object files
+for @command{gawk} itself. This is passed to the @code{bindtextdomain()}
+function when @command{gawk} starts up.
+
 @item GAWK_NO_DFA
 If this variable exists, @command{gawk} does not use the DFA regexp matcher
 for ``does it match'' kinds of tests. This can cause @command{gawk}
@@ -27400,6 +27405,26 @@ before or after the day in a date, local month 
abbreviations, and so on.
 All of the above.  (Not too useful in the context of @command{gettext}.)
 @end table
 
address@hidden NOTE
address@hidden @env{LANGUAGE} environment variable
+As described in @ref{Locales}, environment variables with the same
+name as the locale categories (@env{LC_CTYPE}, @env{LC_ALL}, etc.)
+influence @command{gawk}'s behavior (and that of other utilities).
+
+Normally, these variables also affect how the @code{gettext} library
+finds translations.  However, the @env{LANGUAGE} environment variable
+overrides the @address@hidden variables. Many GNU/Linux systems
+may define this variable without your knowledge, causing @command{gawk}
+to not find the correct translations.  If this happens to you,
+look to see if @env{LANGAUGE} is defined, and if so, use the shell's
address@hidden command to remove it.
address@hidden quotation
+
+For testing translations of @command{gawk} itself, you can set
+the @env{GAWK_LOCALE_DIR} environment variable. See the documentation
+for the C @code{bindtextdomain()} function and also see
address@hidden Environment Variables}.
+
 @node Programmer i18n
 @section Internationalizing @command{awk} Programs
 @cindex @command{awk} programs, internationalizing
diff --git a/main.c b/main.c
index 82b86a8..be21003 100644
--- a/main.c
+++ b/main.c
@@ -152,6 +152,7 @@ static int do_nostalgia = false;    /* provide a blast from 
the past */
 static int do_binary = false;          /* hands off my data! */
 static int do_version = false;         /* print version info */
 static const char *locale = "";                /* default value to setlocale */
+static char *locale_dir = LOCALEDIR;   /* default locale dir */
 
 int use_lc_numeric = false;    /* obey locale for decimal point */
 
@@ -219,6 +220,10 @@ main(int argc, char **argv)
        char *extra_stack;
        int have_srcfile = 0;
        SRCFILE *s;
+       char *cp;
+#if defined(LOCALEDEBUG)
+       const char *initial_locale;
+#endif
 
        /* do these checks early */
        if (getenv("TIDYMEM") != NULL)
@@ -237,8 +242,13 @@ main(int argc, char **argv)
        if (argc < 2)
                usage(EXIT_FAILURE, stderr);
 
-       (void) bindtextdomain(PACKAGE, LOCALEDIR);
-       (void) textdomain(PACKAGE);
+       if ((cp = getenv("GAWK_LOCALE_DIR")) != NULL)
+               locale_dir = cp;
+
+#if defined(LOCALEDEBUG)
+       initial_locale = locale;
+#endif
+       set_locale_stuff();
 
        (void) signal(SIGFPE, catchsig);
 #ifdef SIGBUS
@@ -286,7 +296,10 @@ main(int argc, char **argv)
 
        parse_args(argc, argv);
 
-       set_locale_stuff();
+#if defined(LOCALEDEBUG)
+       if (locale != initial_locale)
+               set_locale_stuff();
+#endif
 
        /*
         * In glibc, MB_CUR_MAX is actually a function.  This value is
@@ -1683,4 +1696,8 @@ set_locale_stuff(void)
 #if defined(LC_TIME)
        setlocale(LC_TIME, locale);
 #endif
+
+       /* These must be done after calling setlocale */
+       (void) bindtextdomain(PACKAGE, locale_dir);
+       (void) textdomain(PACKAGE);
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |   16 ++++++++++++++++
 NEWS            |    8 ++++++++
 dfa.c           |   14 +++++++-------
 doc/ChangeLog   |    5 +++++
 doc/gawktexi.in |   25 +++++++++++++++++++++++++
 main.c          |   23 ++++++++++++++++++++---
 6 files changed, 81 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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