[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1232-g9d43b5
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1232-g9d43b51 |
Date: |
Fri, 27 Mar 2015 03:32:34 +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, select has been updated
via 9d43b510f74f63806279ce40f65245ea7e5b0d53 (commit)
from bc1c92f4a9365f799c9c7a78b41a4eb1c40326b7 (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=9d43b510f74f63806279ce40f65245ea7e5b0d53
commit 9d43b510f74f63806279ce40f65245ea7e5b0d53
Author: Arnold D. Robbins <address@hidden>
Date: Fri Mar 27 06:32:13 2015 +0300
Some more cleanups. Ready to merge!
diff --git a/ChangeLog b/ChangeLog
index ae1a846..a1cbb91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-27 Arnold D. Robbins <address@hidden>
+
+ * io.c (redirect): Change not_string from int to bool.
+ * gawkapi.c (api_get_file): Minor stylistic improvements.
+
2015-03-24 Andrew J. Schorr <address@hidden>
* interpret.h (r_interpret): When Op_K_exit has an argument of
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 679e1be..f4a6f19 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-27 Arnold D. Robbins <address@hidden>
+
+ * gawktexi.in: Minor edits.
+
2015-03-24 Arnold D. Robbins <address@hidden>
* gawktexi.in: Minor fixes from Antonio Colombo and new exercise
diff --git a/doc/gawk.info b/doc/gawk.info
index 6b10734..d0312ec 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -5451,11 +5451,12 @@ how `awk' works.
encounters the end of the file. If there is some error in getting a
record, such as a file that cannot be opened, then `getline' returns
-1. In this case, `gawk' sets the variable `ERRNO' to a string
-describing the error that occurred. If `ERRNO' indicates that the I/O
-operation may be retried, and `PROCINFO["input", "RETRY"]' is set, then
--2 will be returned instead of -1, and further calls to `getline' may
-be attemped. *Note Retrying Input::, for further information about
-this feature.
+describing the error that occurred.
+
+ If `ERRNO' indicates that the I/O operation may be retried, and
+`PROCINFO["INPUT", "RETRY"]' is set, then `getline' returns -2 instead
+of -1, and further calls to `getline' may be attemped. *Note Retrying
+Input::, for further information about this feature.
In the following examples, COMMAND stands for a string value that
represents a shell command.
@@ -5999,16 +6000,16 @@ This minor node describes a feature that is specific to
`gawk'.
`getline' returns -1, and subsequent attempts to read from that file
result in an end-of-file indication. However, you may optionally
instruct `gawk' to allow I/O to be retried when certain errors are
-encountered by setting setting a special element in the `PROCINFO'
-array (*note Auto-set::):
+encountered by setting a special element in the `PROCINFO' array (*note
+Auto-set::):
PROCINFO["INPUT_NAME", "RETRY"] = 1
When this element exists, `gawk' checks the value of the system
`errno' variable when an I/O error occurs. If `errno' indicates a
subsequent I/O attempt may succeed, `getline' instead returns -2 and
-further calls to `getline' may succeed. This applies to `errno' values
-`EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'.
+further calls to `getline' may succeed. This applies to the `errno'
+values `EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'.
This feature is useful in conjunction with `PROCINFO["INPUT_NAME",
"READ_TIMEOUT"]' or situations where a file descriptor has been
@@ -34981,21 +34982,21 @@ Ref: Splitting By Content-Footnote-1236687
Node: Multiple Line236850
Ref: Multiple Line-Footnote-1242731
Node: Getline242910
-Node: Plain Getline245376
-Node: Getline/Variable248016
-Node: Getline/File249165
-Node: Getline/Variable/File250550
-Ref: Getline/Variable/File-Footnote-1252153
-Node: Getline/Pipe252240
-Node: Getline/Variable/Pipe254918
-Node: Getline/Coprocess256049
-Node: Getline/Variable/Coprocess257313
-Node: Getline Notes258052
-Node: Getline Summary260846
-Ref: table-getline-variants261258
-Node: Read Timeout262087
-Ref: Read Timeout-Footnote-1265990
-Node: Retrying Input266048
+Node: Plain Getline245380
+Node: Getline/Variable248020
+Node: Getline/File249169
+Node: Getline/Variable/File250554
+Ref: Getline/Variable/File-Footnote-1252157
+Node: Getline/Pipe252244
+Node: Getline/Variable/Pipe254922
+Node: Getline/Coprocess256053
+Node: Getline/Variable/Coprocess257317
+Node: Getline Notes258056
+Node: Getline Summary260850
+Ref: table-getline-variants261262
+Node: Read Timeout262091
+Ref: Read Timeout-Footnote-1265994
+Node: Retrying Input266052
Node: Command-line directories267238
Node: Input Summary268145
Node: Input Exercises271530
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 0c21d92..e9d987f 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -8115,9 +8115,11 @@ it encounters the end of the file. If there is some
error in getting
a record, such as a file that cannot be opened, then @code{getline}
returns @minus{}1. In this case, @command{gawk} sets the variable
@code{ERRNO} to a string describing the error that occurred.
+
If @code{ERRNO} indicates that the I/O operation may be
-retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2
-will be returned instead of @minus{}1, and further calls to @code{getline}
+retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set,
+then @code{getline} returns @minus{}2
+instead of @minus{}1, and further calls to @code{getline}
may be attemped. @DBXREF{Retrying Input} for further information about
this feature.
@@ -8797,7 +8799,7 @@ When @command{gawk} encounters an error while reading
input, by
default @code{getline} returns @minus{}1, and subsequent attempts to
read from that file result in an end-of-file indication. However, you
may optionally instruct @command{gawk} to allow I/O to be retried when
-certain errors are encountered by setting setting a special element in
+certain errors are encountered by setting a special element in
the @code{PROCINFO} array (@pxref{Auto-set}):
@example
@@ -8808,7 +8810,7 @@ When this element exists, @command{gawk} checks the value
of the system
@code{errno} variable when an I/O error occurs. If @code{errno} indicates
a subsequent I/O attempt may succeed, @code{getline} instead returns
@minus{}2 and
-further calls to @code{getline} may succeed. This applies to @code{errno}
+further calls to @code{getline} may succeed. This applies to the @code{errno}
values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}.
This feature is useful in conjunction with
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 7aa427a..178444a 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -7715,9 +7715,11 @@ it encounters the end of the file. If there is some
error in getting
a record, such as a file that cannot be opened, then @code{getline}
returns @minus{}1. In this case, @command{gawk} sets the variable
@code{ERRNO} to a string describing the error that occurred.
+
If @code{ERRNO} indicates that the I/O operation may be
-retried, and @code{PROCINFO["input", "RETRY"]} is set, then @minus{}2
-will be returned instead of @minus{}1, and further calls to @code{getline}
+retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set,
+then @code{getline} returns @minus{}2
+instead of @minus{}1, and further calls to @code{getline}
may be attemped. @DBXREF{Retrying Input} for further information about
this feature.
@@ -8397,7 +8399,7 @@ When @command{gawk} encounters an error while reading
input, by
default @code{getline} returns @minus{}1, and subsequent attempts to
read from that file result in an end-of-file indication. However, you
may optionally instruct @command{gawk} to allow I/O to be retried when
-certain errors are encountered by setting setting a special element in
+certain errors are encountered by setting a special element in
the @code{PROCINFO} array (@pxref{Auto-set}):
@example
@@ -8408,7 +8410,7 @@ When this element exists, @command{gawk} checks the value
of the system
@code{errno} variable when an I/O error occurs. If @code{errno} indicates
a subsequent I/O attempt may succeed, @code{getline} instead returns
@minus{}2 and
-further calls to @code{getline} may succeed. This applies to @code{errno}
+further calls to @code{getline} may succeed. This applies to the @code{errno}
values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}.
This feature is useful in conjunction with
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 334c97a..5d1651f 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-27 Arnold D. Robbins <address@hidden>
+
+ * testext.c: Move test for deferred variables here.
+
2015-03-18 Arnold D. Robbins <address@hidden>
* configure: Updated to libtool 2.4.6.
diff --git a/extension/testext.c b/extension/testext.c
index 8a906c6..e2ddbe8 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -374,6 +374,17 @@ out:
return result;
}
+/*
+ * 3/2015: This test is no longer strictly necessary,
+ * since PROCINFO is no longer a deferred variable.
+ * But we leave it in for safety, anyway.
+ */
+/*
+BEGIN {
+ print "test_deferred returns", test_deferred()
+ print ""
+}
+*/
static awk_value_t *
test_deferred(int nargs, awk_value_t *result)
{
@@ -1037,6 +1048,7 @@ static awk_bool_t init_testext(void)
static const char message[] = "hello, world"; /* of course */
static const char message2[] = "i am a scalar";
+ /* This is used by the getfile test */
if (sym_lookup("TESTEXT_QUIET", AWK_NUMBER, & value))
return awk_true;
diff --git a/gawkapi.c b/gawkapi.c
index 01ccdf2..9d8c6f3 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -1065,8 +1065,8 @@ api_get_file(awk_ext_id_t id, const char *name, size_t
namelen, const char *file
save_rule = currule;
save_source = source;
- while (1) {
- if (!pc)
+ for (;;) {
+ if (pc == NULL)
fatal(_("cannot find end of BEGINFILE
rule"));
if (pc->opcode == Op_after_beginfile)
break;
diff --git a/io.c b/io.c
index 4dbe16f..cf9dd94 100644
--- a/io.c
+++ b/io.c
@@ -1070,7 +1070,8 @@ redirect_string(const char *str, size_t explen, bool
not_string,
struct redirect *
redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal)
{
- int not_string = ((redir_exp->flags & STRCUR) == 0);
+ bool not_string = ((redir_exp->flags & STRCUR) == 0);
+
redir_exp = force_string(redir_exp);
return redirect_string(redir_exp->stptr, redir_exp->stlen, not_string,
redirtype, errflg, -1, failure_fatal);
diff --git a/test/ChangeLog b/test/ChangeLog
index 106a88d..8aedf6f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-27 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am: Remove defvar test and reference to files; test
+ code moved into extension/testext.c.
+ * defvar.awk, defvar.ok: Removed.
+ * testext.ok: Updated.
+
2015-03-24 Andrew J. Schorr <address@hidden>
* Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok.
diff --git a/test/Makefile.am b/test/Makefile.am
index fe06de7..788fff5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -178,8 +178,6 @@ EXTRA_DIST = \
dbugeval.ok \
defref.awk \
defref.ok \
- defvar.awk \
- defvar.ok \
delargv.awk \
delargv.ok \
delarpm2.awk \
@@ -1094,7 +1092,7 @@ LOCALE_CHARSET_TESTS = \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
- defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1
inplace2 inplace3 \
+ fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2
inplace3 \
ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray
testext time
# List of the tests which should be run with --lint option:
@@ -1951,11 +1949,6 @@ testext::
@$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@ testext.awk
-defvar:
- @echo $@
- @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/address@hidden
$(srcdir)/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
getfile:
@echo $@
@$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/address@hidden
$(srcdir)/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Makefile.in b/test/Makefile.in
index fa3598a..ad27412 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -435,8 +435,6 @@ EXTRA_DIST = \
dbugeval.ok \
defref.awk \
defref.ok \
- defvar.awk \
- defvar.ok \
delargv.awk \
delargv.ok \
delarpm2.awk \
@@ -1347,7 +1345,7 @@ LOCALE_CHARSET_TESTS = \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
- defvar fnmatch filefuncs fork fork2 fts functab4 getfile inplace1
inplace2 inplace3 \
+ fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2
inplace3 \
ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray
testext time
@@ -2388,11 +2386,6 @@ testext::
@$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@ testext.awk
-defvar:
- @echo $@
- @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/address@hidden
$(srcdir)/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
getfile:
@echo $@
@$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/address@hidden
$(srcdir)/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/defvar.awk b/test/defvar.awk
deleted file mode 100644
index 444b81c..0000000
--- a/test/defvar.awk
+++ /dev/null
@@ -1,3 +0,0 @@
-BEGIN {
- print "test_deferred returns", test_deferred()
-}
diff --git a/test/defvar.ok b/test/defvar.ok
deleted file mode 100644
index 4c85427..0000000
--- a/test/defvar.ok
+++ /dev/null
@@ -1,5 +0,0 @@
-fubar = 9
-rumpus = -5
-uid matches 1
-api_major matches 1
-test_deferred returns 1
diff --git a/test/testext.ok b/test/testext.ok
index 9dae010..897a733 100644
--- a/test/testext.ok
+++ b/test/testext.ok
@@ -23,6 +23,12 @@ var_test() returned 1, test_var = 42
test_errno() returned 1, ERRNO = No child processes
+fubar = 9
+rumpus = -5
+uid matches 1
+api_major matches 1
+test_deferred returns 1
+
length of test_array is 10, should be 10
test_array_size: incoming size is 10
test_array_size() returned 1, length is now 0
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
doc/ChangeLog | 4 ++++
doc/gawk.info | 49 +++++++++++++++++++++++++------------------------
doc/gawk.texi | 10 ++++++----
doc/gawktexi.in | 10 ++++++----
extension/ChangeLog | 4 ++++
extension/testext.c | 12 ++++++++++++
gawkapi.c | 4 ++--
io.c | 3 ++-
test/ChangeLog | 7 +++++++
test/Makefile.am | 9 +--------
test/Makefile.in | 9 +--------
test/defvar.awk | 3 ---
test/defvar.ok | 5 -----
test/testext.ok | 6 ++++++
15 files changed, 81 insertions(+), 59 deletions(-)
delete mode 100644 test/defvar.awk
delete mode 100644 test/defvar.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1232-g9d43b51,
Arnold Robbins <=