summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2023-12-02 21:58:40 +0200
committerArnold D. Robbins <arnold@skeeve.com>2023-12-02 21:58:40 +0200
commitd30ed29ba6d73f043a2865f2fc807c6eab40504e (patch)
tree41d77570472d2d7b0019d9e0ffae21f8e3a202c6
parent361126cabbace3a8a6d7b1422bc5fad5477016f6 (diff)
parent8fd6d7b2f5b8977dfb74dd38d5703a3ccd159ee4 (diff)
downloadgawk-d30ed29ba6d73f043a2865f2fc807c6eab40504e.tar.gz
Merge branch 'gawk-5.3-stable'
-rw-r--r--ChangeLog5
-rw-r--r--debug.c14
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info175
-rw-r--r--doc/gawk.texi14
-rw-r--r--pc/ChangeLog4
-rw-r--r--pc/Makefile.tst11
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.in14
-rw-r--r--test/Maketests5
11 files changed, 149 insertions, 111 deletions
diff --git a/ChangeLog b/ChangeLog
index 12c386f..9a1f42e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * debug.c (print_array): Fix printing of multidimensional arrays.
+ Thanks to Hermann Peifer for the report.
+
2023-11-28 Arnold D. Robbins <arnold@skeeve.com>
Straighten out Node_elem_new some more. Thanks to "M"
diff --git a/debug.c b/debug.c
index a0ce09b..028e209 100644
--- a/debug.c
+++ b/debug.c
@@ -1096,6 +1096,7 @@ print_array(volatile NODE *arr, char *arr_name)
volatile NODE *r;
volatile int ret = 0;
volatile jmp_buf pager_quit_tag_stack;
+ static int level = 0;
if (assoc_empty((NODE *) arr)) {
gprintf(out_fp, _("array `%s' is empty\n"), arr_name);
@@ -1108,14 +1109,20 @@ print_array(volatile NODE *arr, char *arr_name)
list = assoc_list((NODE *) arr, "@ind_str_asc", SORTED_IN);
PUSH_BINDING(pager_quit_tag_stack, pager_quit_tag, pager_quit_tag_valid);
+ // level variable is so that we can print things like a[1][2][3] = 123 correctly.
if (setjmp(pager_quit_tag) == 0) {
+ level++;
for (i = 0; ret == 0 && i < num_elems; i++) {
subs = list[i];
r = *assoc_lookup((NODE *) arr, subs);
- if (r->type == Node_var_array)
+ if (level == 1)
+ gprintf(out_fp, "%s", arr_name);
+ if (r->type == Node_var_array) {
+ if (level >= 1)
+ gprintf(out_fp, "[\"%.*s\"]", (int) subs->stlen, subs->stptr);
ret = print_array(r, r->vname);
- else {
- gprintf(out_fp, "%s[\"%.*s\"] = ", arr_name, (int) subs->stlen, subs->stptr);
+ } else {
+ gprintf(out_fp, "[\"%.*s\"] = ", (int) subs->stlen, subs->stptr);
valinfo((NODE *) r, gprintf, out_fp);
}
}
@@ -1127,6 +1134,7 @@ print_array(volatile NODE *arr, char *arr_name)
for (i = 0; i < num_elems; i++)
unref(list[i]);
efree(list);
+ level--;
return ret;
}
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 60f3401..9e7ffa2 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi (Extension Sample Time): Fix up the text for strptime().
+ Thanks to Hermann Peifer for pointing out the problem.
+
2023-11-30 Arnold D. Robbins <arnold@skeeve.com>
* gawk.texi: Small typo fixes. Thanks to Antonio Colombo.
diff --git a/doc/gawk.info b/doc/gawk.info
index 6f2162a..b5d479b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -30016,12 +30016,7 @@ The ‘time’ extension adds three functions, named ‘gettimeofday()’
‘mktime()’ function, and its result is returned, expressing the
time in seconds since the epoch in the current local timezone,
regardless of any timezone specified in the string arguments.
- (This is the same as ‘gawk’'s built-in ‘systime()’ function.)
- Otherwise it returns −1 upon error. In the latter case,
-
- Note that the underlying ‘strptime()’ C library routine apparently
- ignores any time zone indication in the date string, producing
- values relative to the current time zone.
+ Otherwise it returns −1 upon error.

File: gawk.info, Node: Extension Sample API Tests, Prev: Extension Sample Time, Up: Extension Samples
@@ -40337,90 +40332,90 @@ Node: Extension Sample Rev2way1250165
Node: Extension Sample Read write array1250917
Node: Extension Sample Readfile1254191
Node: Extension Sample Time1255322
-Node: Extension Sample API Tests1257610
-Node: gawkextlib1258118
-Node: Extension summary1261150
-Node: Extension Exercises1264998
-Node: Language History1266268
-Node: V7/SVR3.11267980
-Node: SVR41270330
-Node: POSIX1271862
-Node: BTL1273287
-Node: POSIX/GNU1274054
-Node: Feature History1280709
-Node: Common Extensions1300511
-Node: Ranges and Locales1301986
-Ref: Ranges and Locales-Footnote-11306771
-Ref: Ranges and Locales-Footnote-21306798
-Ref: Ranges and Locales-Footnote-31307033
-Node: Contributors1307256
-Node: History summary1313447
-Node: Installation1314889
-Node: Gawk Distribution1315853
-Node: Getting1316345
-Node: Extracting1317344
-Node: Distribution contents1319050
-Node: Unix Installation1327124
-Node: Quick Installation1327944
-Node: Compiling with MPFR1330484
-Node: Shell Startup Files1331190
-Node: Additional Configuration Options1332347
-Node: Configuration Philosophy1334730
-Node: Compiling from Git1337230
-Node: Building the Documentation1337789
-Node: Non-Unix Installation1339201
-Node: PC Installation1339677
-Node: PC Binary Installation1340546
-Node: PC Compiling1341439
-Node: PC Using1342617
-Node: Cygwin1346333
-Node: MSYS1347585
-Node: OpenVMS Installation1348211
-Node: OpenVMS Compilation1348892
-Ref: OpenVMS Compilation-Footnote-11350375
-Node: OpenVMS Dynamic Extensions1350433
-Node: OpenVMS Installation Details1352069
-Node: OpenVMS Running1354500
-Node: OpenVMS GNV1358637
-Node: Bugs1359392
-Node: Bug definition1360312
-Node: Bug address1363913
-Node: Usenet1367482
-Node: Performance bugs1368695
-Node: Asking for help1371711
-Node: Maintainers1373698
-Node: Other Versions1374725
-Node: Installation summary1384329
-Node: Notes1385711
-Node: Compatibility Mode1386521
-Node: Additions1387343
-Node: Accessing The Source1388288
-Node: Adding Code1389819
-Node: New Ports1396930
-Node: Derived Files1401433
-Ref: Derived Files-Footnote-11407244
-Ref: Derived Files-Footnote-21407279
-Ref: Derived Files-Footnote-31407890
-Node: Future Extensions1408004
-Node: Implementation Limitations1408674
-Node: Extension Design1409916
-Node: Old Extension Problems1411076
-Ref: Old Extension Problems-Footnote-11412648
-Node: Extension New Mechanism Goals1412709
-Ref: Extension New Mechanism Goals-Footnote-11416179
-Node: Extension Other Design Decisions1416380
-Node: Extension Future Growth1418577
-Node: Notes summary1419197
-Node: Basic Concepts1420407
-Node: Basic High Level1421092
-Ref: figure-general-flow1421374
-Ref: figure-process-flow1422076
-Ref: Basic High Level-Footnote-11425446
-Node: Basic Data Typing1425635
-Node: Glossary1429043
-Node: Copying1461922
-Node: GNU Free Documentation License1499480
-Node: Index1524603
+Node: Extension Sample API Tests1257322
+Node: gawkextlib1257830
+Node: Extension summary1260862
+Node: Extension Exercises1264710
+Node: Language History1265980
+Node: V7/SVR3.11267692
+Node: SVR41270042
+Node: POSIX1271574
+Node: BTL1272999
+Node: POSIX/GNU1273766
+Node: Feature History1280421
+Node: Common Extensions1300223
+Node: Ranges and Locales1301698
+Ref: Ranges and Locales-Footnote-11306483
+Ref: Ranges and Locales-Footnote-21306510
+Ref: Ranges and Locales-Footnote-31306745
+Node: Contributors1306968
+Node: History summary1313159
+Node: Installation1314601
+Node: Gawk Distribution1315565
+Node: Getting1316057
+Node: Extracting1317056
+Node: Distribution contents1318762
+Node: Unix Installation1326836
+Node: Quick Installation1327656
+Node: Compiling with MPFR1330196
+Node: Shell Startup Files1330902
+Node: Additional Configuration Options1332059
+Node: Configuration Philosophy1334442
+Node: Compiling from Git1336942
+Node: Building the Documentation1337501
+Node: Non-Unix Installation1338913
+Node: PC Installation1339389
+Node: PC Binary Installation1340258
+Node: PC Compiling1341151
+Node: PC Using1342329
+Node: Cygwin1346045
+Node: MSYS1347297
+Node: OpenVMS Installation1347923
+Node: OpenVMS Compilation1348604
+Ref: OpenVMS Compilation-Footnote-11350087
+Node: OpenVMS Dynamic Extensions1350145
+Node: OpenVMS Installation Details1351781
+Node: OpenVMS Running1354212
+Node: OpenVMS GNV1358349
+Node: Bugs1359104
+Node: Bug definition1360024
+Node: Bug address1363625
+Node: Usenet1367194
+Node: Performance bugs1368407
+Node: Asking for help1371423
+Node: Maintainers1373410
+Node: Other Versions1374437
+Node: Installation summary1384041
+Node: Notes1385423
+Node: Compatibility Mode1386233
+Node: Additions1387055
+Node: Accessing The Source1388000
+Node: Adding Code1389531
+Node: New Ports1396642
+Node: Derived Files1401145
+Ref: Derived Files-Footnote-11406956
+Ref: Derived Files-Footnote-21406991
+Ref: Derived Files-Footnote-31407602
+Node: Future Extensions1407716
+Node: Implementation Limitations1408386
+Node: Extension Design1409628
+Node: Old Extension Problems1410788
+Ref: Old Extension Problems-Footnote-11412360
+Node: Extension New Mechanism Goals1412421
+Ref: Extension New Mechanism Goals-Footnote-11415891
+Node: Extension Other Design Decisions1416092
+Node: Extension Future Growth1418289
+Node: Notes summary1418909
+Node: Basic Concepts1420119
+Node: Basic High Level1420804
+Ref: figure-general-flow1421086
+Ref: figure-process-flow1421788
+Ref: Basic High Level-Footnote-11425158
+Node: Basic Data Typing1425347
+Node: Glossary1428755
+Node: Copying1461634
+Node: GNU Free Documentation License1499192
+Node: Index1524315

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 8730bc4..adea7e4 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -39781,18 +39781,8 @@ calls the C library @code{strptime()} function with the given values.
If the parsing succeeds, the results are passed to the C library
@code{mktime()} function, and its result is returned, expressing
the time in seconds since the epoch in the current local timezone,
-regardless of any timezone specified in the string arguments. (This
-is the same as @command{gawk}'s built-in @code{systime()} function.)
-Otherwise it returns @minus{}1 upon error. In the latter case,
-
-Note that the underlying @code{strptime()} C library routine apparently
-ignores any time zone indication in the date string, producing values
-relative to the current time zone.
-@ignore
-It might be better to have this
-routine return a string similar to what @command{gawk}'s @code{mktime()}
-function expects, but we ran out of energy.
-@end ignore
+regardless of any timezone specified in the string arguments.
+Otherwise it returns @minus{}1 upon error.
@end table
@node Extension Sample API Tests
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 868adb5..1f88340 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2023-12-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Regenerated.
+
2023-11-28 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index caf7276..b318939 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -222,7 +222,7 @@ GAWK_EXT_TESTS = \
symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
typeof4 typeof5 typeof6 unicode1 watchpoint1 \
- re_test typeof7 typeof8
+ re_test typeof7 typeof8 dbugarray1
ARRAYDEBUG_TESTS = arrdbg
EXTRA_TESTS = inftest regtest ignrcas3
@@ -243,7 +243,9 @@ SHLIB_TESTS = \
# List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
+ dbugarray1
+
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -3648,6 +3650,11 @@ typeof8:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+dbugarray1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk --debug < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@ $(ZOS_FAIL)
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index 2061548..706c2a4 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): New test: dbugarray1.
+ * dbugarray1.awk, dbugarray1.in, dbugarray1.ok: New files.
+
2023-11-28 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): New tests: typeof7 and typeof8.
diff --git a/test/Makefile.am b/test/Makefile.am
index 096ac2d..6742022 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -244,6 +244,9 @@ EXTRA_DIST = \
datanonl.awk \
datanonl.in \
datanonl.ok \
+ dbugarray1.awk \
+ dbugarray1.in \
+ dbugarray1.ok \
dbugeval.in \
dbugeval.ok \
dbugeval2.awk \
@@ -1574,7 +1577,7 @@ GAWK_EXT_TESTS = \
symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
typeof4 typeof5 typeof6 unicode1 watchpoint1 \
- re_test typeof7 typeof8
+ re_test typeof7 typeof8 dbugarray1
ARRAYDEBUG_TESTS = arrdbg
@@ -1598,7 +1601,8 @@ SHLIB_TESTS = \
testext time
# List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
+ dbugarray1
# List of the tests which should be run with --lint option:
NEED_LINT = \
diff --git a/test/Makefile.in b/test/Makefile.in
index c646343..5c14be7 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -508,6 +508,9 @@ EXTRA_DIST = \
datanonl.awk \
datanonl.in \
datanonl.ok \
+ dbugarray1.awk \
+ dbugarray1.in \
+ dbugarray1.ok \
dbugeval.in \
dbugeval.ok \
dbugeval2.awk \
@@ -1838,7 +1841,7 @@ GAWK_EXT_TESTS = \
symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
typeof4 typeof5 typeof6 unicode1 watchpoint1 \
- re_test typeof7 typeof8
+ re_test typeof7 typeof8 dbugarray1
ARRAYDEBUG_TESTS = arrdbg
EXTRA_TESTS = inftest regtest ignrcas3
@@ -1859,7 +1862,9 @@ SHLIB_TESTS = \
# List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
+ dbugarray1
+
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -5441,6 +5446,11 @@ typeof8:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+dbugarray1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk --debug < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@ $(ZOS_FAIL)
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index e6f990a..9c2bf4f 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2329,6 +2329,11 @@ typeof8:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+dbugarray1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk --debug < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@ $(ZOS_FAIL)
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@