[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-929
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-929-gb11d9d8 |
Date: |
Fri, 1 Jul 2016 07:16:25 +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 b11d9d80ffce53cfdaebb076ea67420884fba6ab (commit)
from 72645295eec48c30ed6a9b9f8bf21b9f53995524 (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=b11d9d80ffce53cfdaebb076ea67420884fba6ab
commit b11d9d80ffce53cfdaebb076ea67420884fba6ab
Author: Arnold D. Robbins <address@hidden>
Date: Fri Jul 1 10:16:05 2016 +0300
Allow -d- to print to stdout.
diff --git a/ChangeLog b/ChangeLog
index 5e38130..e7ef8c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,9 @@
Unrelated:
* symbol.c (get_symbols): Add FUNCTAB and SYMTAB to the list
- for the -d option. Thanks to Hermann Peifer for the report.
+ for the -d option.
+ * awkgram.y (dump_vars): Allow "-" to mean print to stdout.
+ Thanks to Hermann Peifer for the reports.
2016-06-26 Arnold D. Robbins <address@hidden>
diff --git a/NEWS b/NEWS
index 8c4e2c3..8474e69 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,8 @@ Changes from 4.1.3 to 4.1.4
10. MinGW support has been updated.
+11. The -d option now allows -d- to print to standard output.
+
Changes from 4.1.2 to 4.1.3
---------------------------
diff --git a/awkgram.c b/awkgram.c
index bc91d40..5455430 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6547,6 +6547,8 @@ dump_vars(const char *fname)
if (fname == NULL)
fp = stderr;
+ else if (strcmp(fname, "-") == 0)
+ fp = stdout;
else if ((fp = fopen(fname, "w")) == NULL) {
warning(_("could not open `%s' for writing (%s)"), fname,
strerror(errno));
warning(_("sending variable list to standard error"));
@@ -6556,7 +6558,7 @@ dump_vars(const char *fname)
vars = variable_list();
print_vars(vars, fprintf, fp);
efree(vars);
- if (fp != stderr && fclose(fp) != 0)
+ if (fp != stdout && fp != stderr && fclose(fp) != 0)
warning(_("%s: close failed (%s)"), fname, strerror(errno));
}
diff --git a/awkgram.y b/awkgram.y
index e9d535e..6aa90c5 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4208,6 +4208,8 @@ dump_vars(const char *fname)
if (fname == NULL)
fp = stderr;
+ else if (strcmp(fname, "-") == 0)
+ fp = stdout;
else if ((fp = fopen(fname, "w")) == NULL) {
warning(_("could not open `%s' for writing (%s)"), fname,
strerror(errno));
warning(_("sending variable list to standard error"));
@@ -4217,7 +4219,7 @@ dump_vars(const char *fname)
vars = variable_list();
print_vars(vars, fprintf, fp);
efree(vars);
- if (fp != stderr && fclose(fp) != 0)
+ if (fp != stdout && fp != stderr && fclose(fp) != 0)
warning(_("%s: close failed (%s)"), fname, strerror(errno));
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +++-
NEWS | 2 ++
awkgram.c | 4 +++-
awkgram.y | 4 +++-
4 files changed, 11 insertions(+), 3 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-929-gb11d9d8,
Arnold Robbins <=