gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-5.0-stable, updated. gawk-4.1.0-370


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-5.0-stable, updated. gawk-4.1.0-3709-g9abeda3
Date: Thu, 18 Apr 2019 13:15:36 -0400 (EDT)

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-5.0-stable has been updated
       via  9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0 (commit)
       via  33218616b4987c7afd860d0b3f4dad9cdb703547 (commit)
       via  e5851c224d9fd7dce31ba06ee58f07f8370bec48 (commit)
       via  eb2b214d7471660ea087ecee5bc684a23c02395d (commit)
       via  5e739d0e99d4833092dff655bc4e9d9e05046e74 (commit)
      from  c67cff427d7a0628786cac067f3d55e53892e5c8 (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=9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0

commit 9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 18 20:15:15 2019 +0300

    Fix core dump upon syntax error.

diff --git a/ChangeLog b/ChangeLog
index 582aa91..b18a7ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,13 @@
        * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
        * CheckList: Updated.
 
+       Fix core dump reported by Steve Kemp <address@hidden>:
+
+       * awk.h (errcount): Declare.
+       * awkgram.y (errcount): No longer static.
+       * command.y (dbg_errcount): Renamed from errcount.j
+       * main.c (catchsig, catchsegv): If errcount > 0, just exit,
+       don't abort.  
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * configure.ac: Update version to 5.0.0.
diff --git a/awk.h b/awk.h
index 2d87d5a..19a5eb5 100644
--- a/awk.h
+++ b/awk.h
@@ -1116,6 +1116,7 @@ extern NODE *Null_field;
 extern NODE **fields_arr;
 extern int sourceline;
 extern char *source;
+extern int errcount;
 extern int (*interpret)(INSTRUCTION *);        /* interpreter routine */
 extern NODE *(*make_number)(double);   /* double instead of AWKNUM on purpose 
*/
 extern NODE *(*str2number)(NODE *);
diff --git a/awkgram.c b/awkgram.c
index a568f5d..150cfdc 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -198,7 +198,7 @@ static int continue_allowed;        /* kludge for continue 
*/
 static char *tokstart = NULL;
 static char *tok = NULL;
 static char *tokend;
-static int errcount = 0;
+int errcount = 0;
 
 extern char *source;
 extern int sourceline;
diff --git a/awkgram.y b/awkgram.y
index 87570df..08bd096 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -154,7 +154,7 @@ static int continue_allowed;        /* kludge for continue 
*/
 static char *tokstart = NULL;
 static char *tok = NULL;
 static char *tokend;
-static int errcount = 0;
+int errcount = 0;
 
 extern char *source;
 extern int sourceline;
diff --git a/command.c b/command.c
index 16c9967..87211ee 100644
--- a/command.c
+++ b/command.c
@@ -94,7 +94,7 @@ static bool want_nodeval = false;
 static int cmd_idx = -1;               /* index of current command in cmd 
table */
 static int repeat_idx = -1;            /* index of last repeatable command in 
command table */
 static CMDARG *arg_list = NULL;                /* list of arguments */
-static long errcount = 0;
+static long dbg_errcount = 0;
 static char *lexptr_begin = NULL;
 static bool in_commands = false;
 static int num_dim;
@@ -1553,7 +1553,7 @@ yyreduce:
   case 5:
 #line 130 "command.y" /* yacc.c:1652  */
     {
-               if (errcount == 0 && cmd_idx >= 0) {
+               if (dbg_errcount == 0 && cmd_idx >= 0) {
                        Func_cmd cmdfunc;
                        bool terminate = false;
                        CMDARG *args;
@@ -1621,7 +1621,7 @@ yyreduce:
   case 23:
 #line 219 "command.y" /* yacc.c:1652  */
     {
-               if (errcount == 0) {
+               if (dbg_errcount == 0) {
                        /* don't free arg_list; passed on to statement_list
                         * non-terminal (empty rule action). See below.
                         */
@@ -1788,7 +1788,7 @@ yyreduce:
                if (yyvsp[0] != NULL)
                        num = yyvsp[0]->a_int;
 
-               if (errcount != 0)
+               if (dbg_errcount != 0)
                        ;
                else if (in_commands)
                        yyerror(_("Can't use command `commands' for 
breakpoint/watchpoint commands"));
@@ -2774,7 +2774,7 @@ yyerror(const char *mesg, ...)
        vfprintf(out_fp, mesg, args);
        fprintf(out_fp, "\n");
        va_end(args);
-       errcount++;
+       dbg_errcount++;
        repeat_idx = -1;
 }
 
@@ -2796,9 +2796,9 @@ yylex(void)
 
        yylval = (CMDARG *) NULL;
 
-       if (errcount > 0 && lexptr_begin == NULL) {
+       if (dbg_errcount > 0 && lexptr_begin == NULL) {
                /* fake a new line */
-               errcount = 0;
+               dbg_errcount = 0;
                return '\n';
        }
 
diff --git a/command.y b/command.y
index 1af3ad1..6d2c9ef 100644
--- a/command.y
+++ b/command.y
@@ -44,7 +44,7 @@ static bool want_nodeval = false;
 static int cmd_idx = -1;               /* index of current command in cmd 
table */
 static int repeat_idx = -1;            /* index of last repeatable command in 
command table */
 static CMDARG *arg_list = NULL;                /* list of arguments */
-static long errcount = 0;
+static long dbg_errcount = 0;
 static char *lexptr_begin = NULL;
 static bool in_commands = false;
 static int num_dim;
@@ -128,7 +128,7 @@ line
        : nls
        | command nls
          {
-               if (errcount == 0 && cmd_idx >= 0) {
+               if (dbg_errcount == 0 && cmd_idx >= 0) {
                        Func_cmd cmdfunc;
                        bool terminate = false;
                        CMDARG *args;
@@ -217,7 +217,7 @@ set_want_nodeval
 eval_prologue
        : D_EVAL set_want_nodeval opt_param_list nls
          {
-               if (errcount == 0) {
+               if (dbg_errcount == 0) {
                        /* don't free arg_list; passed on to statement_list
                         * non-terminal (empty rule action). See below.
                         */
@@ -335,7 +335,7 @@ command
                if ($2 != NULL)
                        num = $2->a_int;
 
-               if (errcount != 0)
+               if (dbg_errcount != 0)
                        ;
                else if (in_commands)
                        yyerror(_("Can't use command `commands' for 
breakpoint/watchpoint commands"));
@@ -1017,7 +1017,7 @@ yyerror(const char *mesg, ...)
        vfprintf(out_fp, mesg, args);
        fprintf(out_fp, "\n");
        va_end(args);
-       errcount++;
+       dbg_errcount++;
        repeat_idx = -1;
 }
 
@@ -1039,9 +1039,9 @@ yylex(void)
 
        yylval = (CMDARG *) NULL;
 
-       if (errcount > 0 && lexptr_begin == NULL) {
+       if (dbg_errcount > 0 && lexptr_begin == NULL) {
                /* fake a new line */
-               errcount = 0;
+               dbg_errcount = 0;
                return '\n';
        }
 
diff --git a/main.c b/main.c
index d6e3426..8327cc7 100644
--- a/main.c
+++ b/main.c
@@ -1262,6 +1262,9 @@ catchsig(int sig)
                || sig == SIGBUS
 #endif
        ) {
+               if (errcount > 0)       // assume a syntax error corrupted our 
data structures
+                       exit(EXIT_FATAL);
+
                set_loc(__FILE__, __LINE__);
                msg(_("fatal error: internal error"));
                /* fatal won't abort() if not compiled for debugging */
@@ -1279,6 +1282,9 @@ catchsig(int sig)
 static int
 catchsegv(void *fault_address, int serious)
 {
+       if (errcount > 0)       // assume a syntax error corrupted our data 
structures
+               exit(EXIT_FATAL);
+
        set_loc(__FILE__, __LINE__);
        msg(_("fatal error: internal error: segfault"));
        fflush(NULL);
diff --git a/test/ChangeLog b/test/ChangeLog
index ef4f632..a639897 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,8 @@
 2019-04-18         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
+       (synerr3): New test.
+       * synerr3.awk, synerr3.ok: New files.
 
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
diff --git a/test/Makefile.am b/test/Makefile.am
index a7e972a..8c794d6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1188,6 +1188,8 @@ EXTRA_DIST = \
        synerr1.ok \
        synerr2.awk \
        synerr2.ok \
+       synerr3.awk \
+       synerr3.ok \
        tailrecurse.awk \
        tailrecurse.ok \
        testext.ok \
@@ -1311,7 +1313,7 @@ BASIC_TESTS = \
        scalar sclforin sclifin setrec0 setrec1 \
        sigpipe1 sortempty sortglos spacere splitargv splitarr \
        splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \
-       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 
\
+       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 
synerr3 \
        tailrecurse tradanch trailbs tweakfld \
        uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \
        wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 305277e..ee821c9 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1447,6 +1447,8 @@ EXTRA_DIST = \
        synerr1.ok \
        synerr2.awk \
        synerr2.ok \
+       synerr3.awk \
+       synerr3.ok \
        tailrecurse.awk \
        tailrecurse.ok \
        testext.ok \
@@ -1570,7 +1572,7 @@ BASIC_TESTS = \
        scalar sclforin sclifin setrec0 setrec1 \
        sigpipe1 sortempty sortglos spacere splitargv splitarr \
        splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \
-       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 
\
+       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 
synerr3 \
        tailrecurse tradanch trailbs tweakfld \
        uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \
        wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
@@ -3841,6 +3843,11 @@ synerr2:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+synerr3:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 tailrecurse:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index e557cb2..dadba2e 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1104,6 +1104,11 @@ synerr2:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+synerr3:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 tailrecurse:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/synerr3.awk b/test/synerr3.awk
new file mode 100644
index 0000000..49b9e30
--- /dev/null
+++ b/test/synerr3.awk
@@ -0,0 +1 @@
+for (i = ) in foo bar baz
diff --git a/test/synerr3.ok b/test/synerr3.ok
new file mode 100644
index 0000000..b8b9dd8
--- /dev/null
+++ b/test/synerr3.ok
@@ -0,0 +1,5 @@
+gawk: synerr3.awk:1: for (i = ) in foo bar baz
+gawk: synerr3.awk:1: ^ syntax error
+gawk: synerr3.awk:1: for (i = ) in foo bar baz
+gawk: synerr3.awk:1:          ^ syntax error
+EXIT CODE: 2

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

commit 33218616b4987c7afd860d0b3f4dad9cdb703547
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 18 20:05:35 2019 +0300

    Update Italian manual.

diff --git a/doc/it/ChangeLog b/doc/it/ChangeLog
index a384a80..739d60d 100644
--- a/doc/it/ChangeLog
+++ b/doc/it/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Antonio Giovanni Colombo   <address@hidden>
+
+       * gawktexi.in: Updated.
+
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * 5.0.0: Release tar ball made.
diff --git a/doc/it/gawktexi.in b/doc/it/gawktexi.in
index b0ff86e..2c7e5eb 100644
--- a/doc/it/gawktexi.in
+++ b/doc/it/gawktexi.in
@@ -6711,15 +6711,14 @@ un programma insensibile a maiuscolo/minuscolo senza 
doverlo modificare.
 
 @c @cindex ISO 8859-1
 @c @cindex ISO Latin-1
-In localizzazioni multibyte,
-le equivalenze tra caratteri maiuscoli
+In localizzazioni multibyte, le equivalenze tra caratteri maiuscoli
 e minuscoli sono controllate usando i valori in formato esteso
 dell'insieme di caratteri della localizzazione.
-Per il resto, i caratteri sono controllati usando l'insieme di caratteri
-ISO-8859-1 (ISO Latin-1).
-Questo insieme di caratteri @`e un'estensione del tradizionale insieme con 128
-caratteri ASCII, che include anche molti caratteri adatti
-per le lingue address@hidden questo sembra oscuro,
+Prima della @value{PVERSION} 5.0, i caratteri che usano un solo byte
+erano confrontati usando l'insieme di caratteri ISO-8859-1 (ISO Latin-1).
+Tuttavia, a partire dalla @value{PVERSION} 5.0, i caratteri che usano
+un solo byte sono confrontati usando anche i valori dell'insieme di
+caratteri della address@hidden questo sembra oscuro,
 non c'@`e ragione di preoccuparsi; significa solo che @command{gawk} fa
 la cosa giusta.}
 

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

commit e5851c224d9fd7dce31ba06ee58f07f8370bec48
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 18 20:02:38 2019 +0300

    Ensure that ChangeLog.1 gets into the distribution.

diff --git a/ChangeLog b/ChangeLog
index 47e5cdd..582aa91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2019-04-18         Arnold D. Robbins     <address@hidden>
 
        * msg.c (msg): Add an undocumented feature. "Use the Source, Luke."
+       * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
+       * CheckList: Updated.
 
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
diff --git a/Checklist b/Checklist
index e5aa393..579e618 100644
--- a/Checklist
+++ b/Checklist
@@ -1,4 +1,4 @@
-Thu Feb 28 21:19:43 IST 2019
+Thu Apr 18 20:01:43 IDT 2019
 ============================
 
 A checklist for making releases
@@ -59,6 +59,8 @@ run the following command just before rolling a new release:
 
 Major releases:
 - Rotate the ChangeLog and NEWS files.
+- When doing so, update any necessary Makefile.am files to
+  list the rotated ChangeLog file!
 
 ========== For Releasing ============
 
diff --git a/Makefile.am b/Makefile.am
index d544b1c..3b55ff3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,7 @@ AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 # Makefile.am files
 EXTRA_DIST = \
        ChangeLog.0 \
+       ChangeLog.1 \
        COPYING \
        INSTALL \
        NEWS \
diff --git a/Makefile.in b/Makefile.in
index b8b0b44..61f37a2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -467,6 +467,7 @@ AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 # Makefile.am files
 EXTRA_DIST = \
        ChangeLog.0 \
+       ChangeLog.1 \
        COPYING \
        INSTALL \
        NEWS \
diff --git a/awklib/ChangeLog b/awklib/ChangeLog
index 862c2b8..ef4f632 100644
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
+
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * ChangeLog.1: Rotated ChangeLog into this file.
diff --git a/awklib/Makefile.am b/awklib/Makefile.am
index adb607b..20e9edb 100644
--- a/awklib/Makefile.am
+++ b/awklib/Makefile.am
@@ -23,7 +23,8 @@
 
 ## process this file with automake to produce Makefile.in
 
-EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
+EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.1 \
+               extract.awk eg $(srcdir)/stamp-eg
 # With some locales, the script extract.awk fails.
 # So we fix the locale to some sensible value.
 
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index c198acc..449a5bf 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -327,7 +327,9 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
+EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.1 \
+               extract.awk eg $(srcdir)/stamp-eg
+
 @address@hidden = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)"
 # With some locales, the script extract.awk fails.
 # So we fix the locale to some sensible value.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index f396401..d51a9a1 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,6 +1,7 @@
 2019-04-18         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in (Undocumented): Note an undocumented feature.
+       * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
 
 2019-04-14         Arnold D. Robbins     <address@hidden>
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 1e5d86a..24dd040 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -28,7 +28,8 @@ info_TEXINFOS = gawk.texi gawkinet.texi gawkworkflow.texi
 
 man_MANS = gawk.1
 
-EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
+EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.1 \
+       README.card ad.block setter.outline \
        awkcard.in awkforai.txt texinfo.tex cardfonts \
        api-figure1.eps api-figure1.fig api-figure1.pdf \
        api-figure1.png api-figure1.txt \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 7fd6603..9bce117 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -357,7 +357,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 info_TEXINFOS = gawk.texi gawkinet.texi gawkworkflow.texi
 man_MANS = gawk.1
-EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
+EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.1 \
+       README.card ad.block setter.outline \
        awkcard.in awkforai.txt texinfo.tex cardfonts \
        api-figure1.eps api-figure1.fig api-figure1.pdf \
        api-figure1.png api-figure1.txt \
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 862c2b8..ef4f632 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
+
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * ChangeLog.1: Rotated ChangeLog into this file.
diff --git a/extension/Makefile.am b/extension/Makefile.am
index 58650ca..f8be8d2 100644
--- a/extension/Makefile.am
+++ b/extension/Makefile.am
@@ -138,6 +138,7 @@ uninstall-recursive: uninstall-so
 EXTRA_DIST = build-aux/config.rpath  \
        ChangeLog \
        ChangeLog.0 \
+       ChangeLog.1 \
        ext_custom.h \
        fts.3 \
        m4 \
diff --git a/extension/Makefile.in b/extension/Makefile.in
index 8a904ba..13d8ffd 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -635,6 +635,7 @@ readdir_test_la_LIBADD = $(MY_LIBS)
 EXTRA_DIST = build-aux/config.rpath  \
        ChangeLog \
        ChangeLog.0 \
+       ChangeLog.1 \
        ext_custom.h \
        fts.3 \
        m4 \
diff --git a/test/ChangeLog b/test/ChangeLog
index 862c2b8..ef4f632 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): Add ChangeLog.1 to the list. Ooops.
+
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * ChangeLog.1: Rotated ChangeLog into this file.
diff --git a/test/Makefile.am b/test/Makefile.am
index 57d0444..a7e972a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -27,6 +27,7 @@ EXTRA_DIST = \
        reg \
        lib \
        ChangeLog.0 \
+       ChangeLog.1 \
        Gentests \
        Maketests \
        README \
diff --git a/test/Makefile.in b/test/Makefile.in
index fea5458..305277e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -286,6 +286,7 @@ EXTRA_DIST = \
        reg \
        lib \
        ChangeLog.0 \
+       ChangeLog.1 \
        Gentests \
        Maketests \
        README \

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

commit eb2b214d7471660ea087ecee5bc684a23c02395d
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 18 20:00:10 2019 +0300

    Fix permissions on top-level ChangeLog.1.

diff --git a/ChangeLog.1 b/ChangeLog.1
old mode 100755
new mode 100644

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

commit 5e739d0e99d4833092dff655bc4e9d9e05046e74
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 18 19:58:51 2019 +0300

    Add an easter egg in msg.c.

diff --git a/ChangeLog b/ChangeLog
index 8c92378..47e5cdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Arnold D. Robbins     <address@hidden>
+
+       * msg.c (msg): Add an undocumented feature. "Use the Source, Luke."
+
 2019-04-12         Arnold D. Robbins     <address@hidden>
 
        * configure.ac: Update version to 5.0.0.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 6f4467d..f396401 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2019-04-18         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in (Undocumented): Note an undocumented feature.
+
 2019-04-14         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in (Case-sensitivity): Document that single-byte
diff --git a/doc/gawk.texi b/doc/gawk.texi
index e5371c6..02481a7 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -5035,6 +5035,19 @@ returns a textual version of the flags for scalar 
variables, and the
 array back-end implementation type for arrays. This interface is subject
 to change and may not be stable.
 
+When not in POSIX or compatibility mode, if you set @code{LINENO} to a
+numeric value using the @option{-v} option, @command{gawk} adds that value
+to the real line number for use in error messages.  This is intended for
+use within Bash shell scripts, such that the error message will reflect
+the line number in the shell script, instead of in the @command{awk}
+program. To demonstrate:
+
address@hidden
+$ @kbd{gawk -v LINENO=10 'BEGIN @{ print("hi" @}'}
address@hidden gawk: cmd. line:11: BEGIN @{ print("hi" @}
address@hidden gawk: cmd. line:11:                    ^ syntax error
address@hidden example
+
 @end ignore
 
 @node Invoking Summary
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 14e20b7..0408d61 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -4945,6 +4945,19 @@ returns a textual version of the flags for scalar 
variables, and the
 array back-end implementation type for arrays. This interface is subject
 to change and may not be stable.
 
+When not in POSIX or compatibility mode, if you set @code{LINENO} to a
+numeric value using the @option{-v} option, @command{gawk} adds that value
+to the real line number for use in error messages.  This is intended for
+use within Bash shell scripts, such that the error message will reflect
+the line number in the shell script, instead of in the @command{awk}
+program. To demonstrate:
+
address@hidden
+$ @kbd{gawk -v LINENO=10 'BEGIN @{ print("hi" @}'}
address@hidden gawk: cmd. line:11: BEGIN @{ print("hi" @}
address@hidden gawk: cmd. line:11:                    ^ syntax error
address@hidden example
+
 @end ignore
 
 @node Invoking Summary
diff --git a/msg.c b/msg.c
index 12cc2aa..ca988ad 100644
--- a/msg.c
+++ b/msg.c
@@ -46,10 +46,17 @@ err(bool isfatal, const char *s, const char *emsg, va_list 
argp)
 
        static bool first = true;
        static bool add_src_info = false;
+       static long lineno_val = 0;     // Easter Egg
 
        if (first) {
                first = false;
                add_src_info = (getenv("GAWK_MSG_SRC") != NULL);
+               if (! do_traditional) {
+                       NODE *n = lookup("LINENO");
+
+                       if (n != NULL && n->type == Node_var)
+                               lineno_val = get_number_d(n->var_value);
+               }
        }
 
        (void) fflush(output_fp);
@@ -67,7 +74,7 @@ err(bool isfatal, const char *s, const char *emsg, va_list 
argp)
                else
                        (void) fprintf(stderr, _("cmd. line:"));
 
-               (void) fprintf(stderr, "%d: ", sourceline);
+               (void) fprintf(stderr, "%d: ", sourceline + lineno_val);
        }
 
 #ifdef HAVE_MPFR

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

Summary of changes:
 ChangeLog             | 13 +++++++++++++
 ChangeLog.1           |  0
 Checklist             |  4 +++-
 Makefile.am           |  1 +
 Makefile.in           |  1 +
 awk.h                 |  1 +
 awkgram.c             |  2 +-
 awkgram.y             |  2 +-
 awklib/ChangeLog      |  4 ++++
 awklib/Makefile.am    |  3 ++-
 awklib/Makefile.in    |  4 +++-
 command.c             | 14 +++++++-------
 command.y             | 14 +++++++-------
 doc/ChangeLog         |  5 +++++
 doc/Makefile.am       |  3 ++-
 doc/Makefile.in       |  3 ++-
 doc/gawk.texi         | 13 +++++++++++++
 doc/gawktexi.in       | 13 +++++++++++++
 doc/it/ChangeLog      |  4 ++++
 doc/it/gawktexi.in    | 13 ++++++-------
 extension/ChangeLog   |  4 ++++
 extension/Makefile.am |  1 +
 extension/Makefile.in |  1 +
 main.c                |  6 ++++++
 msg.c                 |  9 ++++++++-
 test/ChangeLog        |  6 ++++++
 test/Makefile.am      |  5 ++++-
 test/Makefile.in      | 10 +++++++++-
 test/Maketests        |  5 +++++
 test/synerr3.awk      |  1 +
 test/synerr3.ok       |  5 +++++
 31 files changed, 139 insertions(+), 31 deletions(-)
 mode change 100755 => 100644 ChangeLog.1
 create mode 100644 test/synerr3.awk
 create mode 100644 test/synerr3.ok


hooks/post-receive
-- 
gawk



reply via email to

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