[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-3841-ga4f9e9d
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-3841-ga4f9e9d |
Date: |
Sun, 3 Nov 2019 15:01:27 -0500 (EST) |
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, master has been updated
via a4f9e9d4adbbf55a4225484ef3d04e8cf5e3046c (commit)
via e6b8d8dcc8bf46028c2e26586afb1cd6ea184a59 (commit)
from 6c6a2a5bb7769a3ff987ccc51531ce9fc22602c4 (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=a4f9e9d4adbbf55a4225484ef3d04e8cf5e3046c
commit a4f9e9d4adbbf55a4225484ef3d04e8cf5e3046c
Author: Arnold D. Robbins <address@hidden>
Date: Sun Nov 3 22:01:04 2019 +0200
Fix a bug with FPAT field parsing.
diff --git a/ChangeLog b/ChangeLog
index 3bb0847..63c90b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-03 Arnold D. Robbins <address@hidden>
+
+ * field.c (get_field): Remove special case code for fpat_parse_field.
+ Fixes a bug reported by Ed Morton <address@hidden.
+
2019-10-19 Arnold D. Robbins <address@hidden>
* compile, depcomp: Update from GNULIB.
diff --git a/field.c b/field.c
index 8814233..8c7fe18 100644
--- a/field.c
+++ b/field.c
@@ -916,17 +916,6 @@ get_field(long requested, Func_ptr *assign)
*/
if (parse_extent == fields_arr[0]->stptr + fields_arr[0]->stlen)
NF = parse_high_water;
- else if (parse_field == fpat_parse_field) {
- /* FPAT parsing is weird, isolate the special cases */
- char *rec_start = fields_arr[0]->stptr;
- char *rec_end = fields_arr[0]->stptr +
fields_arr[0]->stlen;
-
- if ( parse_extent > rec_end
- || (parse_extent > rec_start && parse_extent <
rec_end && requested == UNLIMITED-1))
- NF = parse_high_water;
- else if (parse_extent == rec_start) /* could be no
match for FPAT */
- NF = 0;
- }
if (requested == UNLIMITED - 1) /* UNLIMITED-1 means set NF */
requested = parse_high_water;
}
@@ -1566,7 +1555,7 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* field_found = match(substr(string, parse_start), pattern)
*
* # check for an invalid null field and retry one character away
- * if (nf > 0 && field_found && RSTART==1 && RLENGTH==0) {
+ * if (nf > 0 && field_found && RSTART == 1 && RLENGTH == 0) {
* parse_start++
* field_found = match(substr(string, parse_start), pattern)
* }
diff --git a/test/ChangeLog b/test/ChangeLog
index 0ec118e..cd503c3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-03 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (EXTRA_DISTS): New test, fpat7.
+ * fpat7.awk, fpat7.ok, fpat7.in: New files.
+
2019-10-13 Arnold D. Robbins <address@hidden>
* Makefile.am (EXTRA_DISTS): New tests, typedregex5 and
diff --git a/test/Makefile.am b/test/Makefile.am
index 053ff54..84a71bc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -366,6 +366,9 @@ EXTRA_DIST = \
fpat6.awk \
fpat6.in \
fpat6.ok \
+ fpat7.awk \
+ fpat7.in \
+ fpat7.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -1368,9 +1371,9 @@ GAWK_EXT_TESTS = \
dbugeval dbugeval2 dbugeval3 dbugtypedre1 dbugtypedre2 delsub \
devfd devfd1 devfd2 dfacheck1 dumpvars \
errno exit \
- fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull fsfwfs \
- funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \
- fwtest5 fwtest6 fwtest7 fwtest8 \
+ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpat7 fpatnull \
+ fsfwfs funlen functab1 functab2 functab3 \
+ fwtest fwtest2 fwtest3 fwtest4 fwtest5 fwtest6 fwtest7 fwtest8 \
genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind
\
icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase incdupe \
incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 include include2 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 357f3b1..7bbacf1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -625,6 +625,9 @@ EXTRA_DIST = \
fpat6.awk \
fpat6.in \
fpat6.ok \
+ fpat7.awk \
+ fpat7.in \
+ fpat7.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -1627,9 +1630,9 @@ GAWK_EXT_TESTS = \
dbugeval dbugeval2 dbugeval3 dbugtypedre1 dbugtypedre2 delsub \
devfd devfd1 devfd2 dfacheck1 dumpvars \
errno exit \
- fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpatnull fsfwfs \
- funlen functab1 functab2 functab3 fwtest fwtest2 fwtest3 fwtest4 \
- fwtest5 fwtest6 fwtest7 fwtest8 \
+ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpat6 fpat7 fpatnull \
+ fsfwfs funlen functab1 functab2 functab3 \
+ fwtest fwtest2 fwtest3 fwtest4 fwtest5 fwtest6 fwtest7 fwtest8 \
genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind
\
icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase incdupe \
incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 include include2 \
@@ -4250,6 +4253,11 @@ fpat6:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+fpat7:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 3e443f5..627d6ec 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1416,6 +1416,11 @@ fpat6:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+fpat7:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
diff --git a/test/fpat7.awk b/test/fpat7.awk
new file mode 100644
index 0000000..9b8a677
--- /dev/null
+++ b/test/fpat7.awk
@@ -0,0 +1,2 @@
+BEGIN { FPAT = "[^,]*" }
+{ print $1, $2 }
diff --git a/test/fpat7.in b/test/fpat7.in
new file mode 100644
index 0000000..0cbe3bd
--- /dev/null
+++ b/test/fpat7.in
@@ -0,0 +1 @@
+,b
diff --git a/test/fpat7.ok b/test/fpat7.ok
new file mode 100644
index 0000000..64e2aad
--- /dev/null
+++ b/test/fpat7.ok
@@ -0,0 +1 @@
+ b
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=e6b8d8dcc8bf46028c2e26586afb1cd6ea184a59
commit e6b8d8dcc8bf46028c2e26586afb1cd6ea184a59
Author: Arnold D. Robbins <address@hidden>
Date: Sun Nov 3 19:49:34 2019 +0200
Doc update w.r.t. readdir extension.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5615487..8671f18 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-03 Arnold D. Robbins <address@hidden>
+
+ * gawktexi.in: Document that readdir extension can cause a
+ fatal error, which should be handled with BEGINFILE.
+
2019-10-16 Arnold D. Robbins <address@hidden>
* awkcard.in: BWK awk now supports RS as regexp, so remove the
diff --git a/doc/gawk.info b/doc/gawk.info
index e4bf1b2..7322305 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -27873,6 +27873,11 @@ always 'u'.
the file type is always 'u'. You can use the 'filefuncs' extension
to call 'stat()' in order to get correct type information.
+ By default, if a directory cannot be opened (due to permission
+problems, for example), 'gawk' will exit. As with regular files, this
+situation can be handled using a 'BEGINFILE' rule that checks 'ERRNO'
+and prints an error or otherwise handles the problem.
+
Here is an example:
@load "readdir"
@@ -37602,90 +37607,90 @@ Node: Extension Sample Inplace1123514
Node: Extension Sample Ord1127139
Node: Extension Sample Readdir1127975
Ref: table-readdir-file-types1128864
-Node: Extension Sample Revout1129669
-Node: Extension Sample Rev2way1130258
-Node: Extension Sample Read write array1130998
-Node: Extension Sample Readfile1132940
-Node: Extension Sample Time1134035
-Node: Extension Sample API Tests1135383
-Node: gawkextlib1135875
-Node: Extension summary1138793
-Node: Extension Exercises1142495
-Node: Language History1143737
-Node: V7/SVR3.11145393
-Node: SVR41147545
-Node: POSIX1148979
-Node: BTL1150359
-Node: POSIX/GNU1151088
-Node: Feature History1156866
-Node: Common Extensions1173059
-Node: Ranges and Locales1174342
-Ref: Ranges and Locales-Footnote-11178958
-Ref: Ranges and Locales-Footnote-21178985
-Ref: Ranges and Locales-Footnote-31179220
-Node: Contributors1179441
-Node: History summary1185394
-Node: Installation1186774
-Node: Gawk Distribution1187718
-Node: Getting1188202
-Node: Extracting1189165
-Node: Distribution contents1190803
-Node: Unix Installation1197283
-Node: Quick Installation1197965
-Node: Shell Startup Files1200379
-Node: Additional Configuration Options1201468
-Node: Configuration Philosophy1203783
-Node: Non-Unix Installation1206152
-Node: PC Installation1206612
-Node: PC Binary Installation1207450
-Node: PC Compiling1207885
-Node: PC Using1209002
-Node: Cygwin1212555
-Node: MSYS1213779
-Node: VMS Installation1214280
-Node: VMS Compilation1215071
-Ref: VMS Compilation-Footnote-11216300
-Node: VMS Dynamic Extensions1216358
-Node: VMS Installation Details1218043
-Node: VMS Running1220296
-Node: VMS GNV1224575
-Node: VMS Old Gawk1225310
-Node: Bugs1225781
-Node: Bug address1226444
-Node: Usenet1229426
-Node: Maintainers1230430
-Node: Other Versions1231691
-Node: Installation summary1238779
-Node: Notes1239981
-Node: Compatibility Mode1240775
-Node: Additions1241557
-Node: Accessing The Source1242482
-Node: Adding Code1243919
-Node: New Ports1250138
-Node: Derived Files1254513
-Ref: Derived Files-Footnote-11260173
-Ref: Derived Files-Footnote-21260208
-Ref: Derived Files-Footnote-31260806
-Node: Future Extensions1260920
-Node: Implementation Limitations1261578
-Node: Extension Design1262761
-Node: Old Extension Problems1263905
-Ref: Old Extension Problems-Footnote-11265423
-Node: Extension New Mechanism Goals1265480
-Ref: Extension New Mechanism Goals-Footnote-11268844
-Node: Extension Other Design Decisions1269033
-Node: Extension Future Growth1271146
-Node: Notes summary1271982
-Node: Basic Concepts1273140
-Node: Basic High Level1273821
-Ref: figure-general-flow1274103
-Ref: figure-process-flow1274788
-Ref: Basic High Level-Footnote-11278089
-Node: Basic Data Typing1278274
-Node: Glossary1281602
-Node: Copying1313440
-Node: GNU Free Documentation License1350983
-Node: Index1376103
+Node: Extension Sample Revout1129931
+Node: Extension Sample Rev2way1130520
+Node: Extension Sample Read write array1131260
+Node: Extension Sample Readfile1133202
+Node: Extension Sample Time1134297
+Node: Extension Sample API Tests1135645
+Node: gawkextlib1136137
+Node: Extension summary1139055
+Node: Extension Exercises1142757
+Node: Language History1143999
+Node: V7/SVR3.11145655
+Node: SVR41147807
+Node: POSIX1149241
+Node: BTL1150621
+Node: POSIX/GNU1151350
+Node: Feature History1157128
+Node: Common Extensions1173321
+Node: Ranges and Locales1174604
+Ref: Ranges and Locales-Footnote-11179220
+Ref: Ranges and Locales-Footnote-21179247
+Ref: Ranges and Locales-Footnote-31179482
+Node: Contributors1179703
+Node: History summary1185656
+Node: Installation1187036
+Node: Gawk Distribution1187980
+Node: Getting1188464
+Node: Extracting1189427
+Node: Distribution contents1191065
+Node: Unix Installation1197545
+Node: Quick Installation1198227
+Node: Shell Startup Files1200641
+Node: Additional Configuration Options1201730
+Node: Configuration Philosophy1204045
+Node: Non-Unix Installation1206414
+Node: PC Installation1206874
+Node: PC Binary Installation1207712
+Node: PC Compiling1208147
+Node: PC Using1209264
+Node: Cygwin1212817
+Node: MSYS1214041
+Node: VMS Installation1214542
+Node: VMS Compilation1215333
+Ref: VMS Compilation-Footnote-11216562
+Node: VMS Dynamic Extensions1216620
+Node: VMS Installation Details1218305
+Node: VMS Running1220558
+Node: VMS GNV1224837
+Node: VMS Old Gawk1225572
+Node: Bugs1226043
+Node: Bug address1226706
+Node: Usenet1229688
+Node: Maintainers1230692
+Node: Other Versions1231953
+Node: Installation summary1239041
+Node: Notes1240243
+Node: Compatibility Mode1241037
+Node: Additions1241819
+Node: Accessing The Source1242744
+Node: Adding Code1244181
+Node: New Ports1250400
+Node: Derived Files1254775
+Ref: Derived Files-Footnote-11260435
+Ref: Derived Files-Footnote-21260470
+Ref: Derived Files-Footnote-31261068
+Node: Future Extensions1261182
+Node: Implementation Limitations1261840
+Node: Extension Design1263023
+Node: Old Extension Problems1264167
+Ref: Old Extension Problems-Footnote-11265685
+Node: Extension New Mechanism Goals1265742
+Ref: Extension New Mechanism Goals-Footnote-11269106
+Node: Extension Other Design Decisions1269295
+Node: Extension Future Growth1271408
+Node: Notes summary1272244
+Node: Basic Concepts1273402
+Node: Basic High Level1274083
+Ref: figure-general-flow1274365
+Ref: figure-process-flow1275050
+Ref: Basic High Level-Footnote-11278351
+Node: Basic Data Typing1278536
+Node: Glossary1281864
+Node: Copying1313702
+Node: GNU Free Documentation License1351245
+Node: Index1376365
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 55aa8ce..2ae6d56 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -37967,6 +37967,11 @@ type is always @samp{u}. You can use the
@code{filefuncs} extension to call
@code{stat()} in order to get correct type information.
@end quotation
+By default, if a directory cannot be opened (due to permission problems,
+for example), @command{gawk} will exit. As with regular files, this
+situation can be handled using a @code{BEGINFILE} rule that checks
+@code{ERRNO} and prints an error or otherwise handles the problem.
+
Here is an example:
@example
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 0c41d4d..e6f778a 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -36938,6 +36938,11 @@ type is always @samp{u}. You can use the
@code{filefuncs} extension to call
@code{stat()} in order to get correct type information.
@end quotation
+By default, if a directory cannot be opened (due to permission problems,
+for example), @command{gawk} will exit. As with regular files, this
+situation can be handled using a @code{BEGINFILE} rule that checks
+@code{ERRNO} and prints an error or otherwise handles the problem.
+
Here is an example:
@example
diff --git a/extension/ChangeLog b/extension/ChangeLog
index f85683a..d71ac21 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-03 Arnold D. Robbins <address@hidden>
+
+ * readdir.3am: Document that readdir extension can cause a
+ fatal error, which should be handled with BEGINFILE.
+
2019-10-16 Andrew J. Schorr <address@hidden>
* filefuncs.3am: Enhance the stat() documentation to explain that
diff --git a/extension/readdir.3am b/extension/readdir.3am
index e4f24df..531c65c 100644
--- a/extension/readdir.3am
+++ b/extension/readdir.3am
@@ -1,4 +1,4 @@
-.TH READDIR 3am "Mar 17 2019" "Free Software Foundation" "GNU Awk Extension
Modules"
+.TH READDIR 3am "Oct 30 2019" "Free Software Foundation" "GNU Awk Extension
Modules"
.SH NAME
readdir \- directory input parser for gawk
.SH SYNOPSIS
@@ -42,6 +42,16 @@ to calling
in order to provide the information.
Thus the third field should never be
.BR u .
+.PP
+By default, if a directory cannot be opened (due to permission problems,
+for example),
+.I gawk
+will exit.
+As with regular files, this situation can be handled using a
+.B BEGINFILE
+rule that checks
+.B ERRNO
+and prints an error or otherwise handles the problem.
.\" .SH BUGS
.SH EXAMPLE
.ft CW
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 ++
doc/ChangeLog | 5 ++
doc/gawk.info | 173 ++++++++++++++++++++++++++------------------------
doc/gawk.texi | 5 ++
doc/gawktexi.in | 5 ++
extension/ChangeLog | 5 ++
extension/readdir.3am | 12 +++-
field.c | 13 +---
test/ChangeLog | 5 ++
test/Makefile.am | 9 ++-
test/Makefile.in | 14 +++-
test/Maketests | 5 ++
test/fpat7.awk | 2 +
test/fpat7.in | 1 +
test/fpat7.ok | 1 +
15 files changed, 157 insertions(+), 103 deletions(-)
create mode 100644 test/fpat7.awk
create mode 100644 test/fpat7.in
create mode 100644 test/fpat7.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-3841-ga4f9e9d,
Arnold Robbins <=