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-618


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-618-g90e1d42
Date: Wed, 25 Mar 2015 00:33:14 +0000

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  90e1d42a99178608ec22216f7f35dadcad5a8b3a (commit)
      from  981e106b111672aac520fbb397ee82c64f3c4f2a (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=90e1d42a99178608ec22216f7f35dadcad5a8b3a

commit 90e1d42a99178608ec22216f7f35dadcad5a8b3a
Author: Andrew J. Schorr <address@hidden>
Date:   Tue Mar 24 20:32:42 2015 -0400

    Fix bug where exit with no argument was setting the exit status to zero.

diff --git a/ChangeLog b/ChangeLog
index b8b3ee9..a3496dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-24         Andrew J. Schorr     <address@hidden>
+
+       * interpret.h (r_interpret): When Op_K_exit has an argument of
+       Nnull_string, do not update exit_val, since no value was supplied.
+
 2015-03-18         Arnold D. Robbins     <address@hidden>
 
        * config.guess, config.sub: Updated, from libtool 2.4.6.
diff --git a/interpret.h b/interpret.h
index b16dc12..372679d 100644
--- a/interpret.h
+++ b/interpret.h
@@ -1313,17 +1313,18 @@ match_re:
                                fatal(_("`exit' cannot be called in the current 
context"));
 
                        exiting = true;
-                       t1 = POP_NUMBER();
-                       exit_val = (int) get_number_si(t1);
-                       DEREF(t1);
+                       if ((t1 = POP_NUMBER()) != Nnull_string) {
+                               exit_val = (int) get_number_si(t1);
 #ifdef VMS
-                       if (exit_val == 0)
-                               exit_val = EXIT_SUCCESS;
-                       else if (exit_val == 1)
-                               exit_val = EXIT_FAILURE;
-                       /* else
-                               just pass anything else on through */
+                               if (exit_val == 0)
+                                       exit_val = EXIT_SUCCESS;
+                               else if (exit_val == 1)
+                                       exit_val = EXIT_FAILURE;
+                               /* else
+                                       just pass anything else on through */
 #endif
+                       }
+                       DEREF(t1);
 
                        if (currule == BEGINFILE || currule == ENDFILE) {
 
diff --git a/test/ChangeLog b/test/ChangeLog
index c33ac10..862b849 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-24         Andrew J. Schorr     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok.
+       (BASIC_TESTS): Add new test exitval3.
+       * exitval3.awk, exitval3.ok: New files.
+
 2015-03-17         Andrew J. Schorr     <address@hidden>
 
        * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line
diff --git a/test/Makefile.am b/test/Makefile.am
index f1a0a27..1b5a2a5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -221,6 +221,8 @@ EXTRA_DIST = \
        exitval2.awk \
        exitval2.ok \
        exitval2.w32 \
+       exitval3.awk \
+       exitval3.ok \
        fcall_exit.awk \
        fcall_exit.ok \
        fcall_exit2.awk \
@@ -1001,7 +1003,7 @@ BASIC_TESTS = \
        callparam childin clobber closebad clsflnam compare compare2 concat1 
concat2 \
        concat3 concat4 convfmt \
        datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress 
dynlj \
-       eofsplit exit2 exitval1 exitval2 \
+       eofsplit exit2 exitval1 exitval2 exitval3 \
        fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
        fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
        fstabplus funsemnl funsmnam funstack \
diff --git a/test/Makefile.in b/test/Makefile.in
index b794e04..d5f3944 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -478,6 +478,8 @@ EXTRA_DIST = \
        exitval2.awk \
        exitval2.ok \
        exitval2.w32 \
+       exitval3.awk \
+       exitval3.ok \
        fcall_exit.awk \
        fcall_exit.ok \
        fcall_exit2.awk \
@@ -1257,7 +1259,7 @@ BASIC_TESTS = \
        callparam childin clobber closebad clsflnam compare compare2 concat1 
concat2 \
        concat3 concat4 convfmt \
        datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress 
dynlj \
-       eofsplit exit2 exitval1 exitval2 \
+       eofsplit exit2 exitval1 exitval2 exitval3 \
        fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
        fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
        fstabplus funsemnl funsmnam funstack \
@@ -2709,6 +2711,11 @@ exitval2:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+exitval3:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 fcall_exit:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 8c27086..58a1d67 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -230,6 +230,11 @@ exitval2:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+exitval3:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 fcall_exit:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/exitval3.awk b/test/exitval3.awk
new file mode 100644
index 0000000..33e8c43
--- /dev/null
+++ b/test/exitval3.awk
@@ -0,0 +1,2 @@
+BEGIN { exit 42 }
+END { exit }
diff --git a/test/exitval3.ok b/test/exitval3.ok
new file mode 100644
index 0000000..20f64b8
--- /dev/null
+++ b/test/exitval3.ok
@@ -0,0 +1 @@
+EXIT CODE: 42

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

Summary of changes:
 ChangeLog         |    5 +++++
 interpret.h       |   19 ++++++++++---------
 test/ChangeLog    |    6 ++++++
 test/Makefile.am  |    4 +++-
 test/Makefile.in  |    9 ++++++++-
 test/Maketests    |    5 +++++
 test/exitval3.awk |    2 ++
 test/exitval3.ok  |    1 +
 8 files changed, 40 insertions(+), 11 deletions(-)
 create mode 100644 test/exitval3.awk
 create mode 100644 test/exitval3.ok


hooks/post-receive
-- 
gawk



reply via email to

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