1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
|
12/6/2020
---------
[bash-5.1 released]
12/7
----
Makefile.in
- bashline.o: add dependency on ${DEFDIR}/builtext.h. Report from
Fazal Majid <fazal@majid.org>
12/11
-----
builtins/wait.def
- wait_builtin: don't assign the variable given with -p if there are no
jobs to wait for. Report and fix from OÄuz <oguzismailuysal@gmail.com>
arrayfunc.c
- kvpair_assignment_p: return non-zero if argument L appears to be a
key-value pair associative array compound assignment
- expand_and_quote_kvpair_word: run a single word in a key-value pair
associative array compound assignment through the appropriate
expansions and single-quote the result
arrayfunc.h
- kvpair_assignment_p, expand_and_quote_kvpair_word: extern declarations
subst.c
- expand_oneword: detect whether VALUE appears to be a key-value
pair compound assignment and call the appropriate function to expand
each word in the resulting list. Fixes inconsistency reported by
oguzismailuysal@gmail.com
12/12
-----
subst.c
- command_substitute: don't reset pipeline_pgrp to shell_pgrp if we
are already forked to run a command (SUBSHELL_FORK). Fixes SIGINT
in command substitution in here-document in forked child issue
reported by oguzismailuysal@gmail.com
12/18
-----
execute_cmd.c
- execute_pipeline: execute the lastpipe code even if prev == 0. It
can only be 0 here if stdin was closed when this function was
executed
- execute_pipeline: if prev == 0, set lstdin to a sentinel (-1) that
means to close fd 0 after executing the command, and call close(prev)
before restoring stdin. restore_stdin now understands -1, and closes
fd 0. Fixes issue reported by Tomas Janousek <tomi@nomi.cz>
12/21
-----
doc/bashref.texi
- PROMPT_COMMANDS: clean up a couple of remaining instances of this
name. Report from Eli Schwartz <eschwartz@archlinux.org>
12/26
-----
subst.c
- command_substitute: make sure that the child process always has
pipeline_pgrp == shell_pgrp: if pipeline_pgrp is non-zero when we
get to the child, meaning that we're part of an already-forked
child that is, for instance, running redirections, we need to reset
shell_pgrp to it to preserve the invariant. Fixes bug with terminal
being set to the incorrect pgrp reported by oguzismailuysal@gmail.com
12/29
-----
configure.ac,builtins/shobj-conf,m4/threadlib.m4
- midnightbsd: update auto-configuration to treat MidnightBSD like
FreeBSD. From https://savannah.gnu.org/patch/?10006
12/30
-----
examples/loadables/stat.c
- stattime: use strftime with a default format or the format supplied
with the -F option to format the file time information
- stat_builtin: now takes a -F fmt option for a strftime format string;
change to function calling sequences to pass the format down to
stattime
examples/loadables/Makefile.in
- stat: now built and installed by default
12/31
-----
command.h
- SUBSHELL_IGNTRAP: new flag value
jobs.c
- make_child: set SUBSHELL_IGNTRAP in subshell_environment in the
child process, meaning that we should not execute trap handlers for
trapped signals
execute_cmd.c
- execute_in_subshell, execute_simple_command, execute_disk_command:
make sure to unset SUBSHELL_IGNTRAP after a child process restores
the original signal dispositions
- execute_simple_command: make sure to set SUBSHELL_IGNTRAP after
make_child returns and we're setting subshell_environment directly
subst.c
- command_substitute,process_substitute: unset SUBSHELL_IGNTRAP after
the child process has reset the trapped signal dispositions
trap.c
- trap_handler: if we get a signal for which we have set a trap, but
SUBSHELL_IGNTRAP is set in subshell_environmnent, make sure we
restore the original signal disposition and resend the signal to
ourselves. Fixes issue reported by Nikolay Borisov <nborisov@suse.com>
(or at least makes the race window much smaller)
sig.c
- initialize_terminating_signal: set the original signal handler from
the return value from sigaction; a minor optimization that saves a
system call or two
1/5/2021
--------
builtins/declare.def
- declare_internal: make some option combinations that don't make
sense errors (e.g., -f and -a/-A/-i/-n)
- declare_internal: if we build a new variable name by expanding the
value of a nameref variable, make sure to chop the `+' in a `+='
off before going on
1/7
---
doc/{bash.1,bashref.texi}
- bind: add an example to the synopsis making it clear that you can
use any readline command line as a non-option argument, as it says
in the text. From a report from Dan Jacobson <jidanni@jidanni.org>
1/12
----
locale.c
- local_shiftstates -> locale_shiftsates in the non-multibyte code
branch. Reported by Henry Bent <henry.r.bent@gmail.com>
subst.c
- expand_compound_assignment_word: make sure to call dispose_words on
the WORD_LIST * returned from expand_oneword after turning it back
into a string. Fixes memory leak reported by Alexander Mescheryakov
<alexander.s.m@gmail.com>
1/13
----
variables.c
- bind_variable_internal: when performing an assignment to a subscripted
array variable that was the value of a nameref (used in the original
assignment), don't call make_variable_value on the value, since that
messes up +=. Just call assign_array_element and let that take care
of calling make_variable_value appropriately. Fixes bug reported by
Oguz <oguzismailuysal@gmail.com>
1/14
----
findcmd.c
- search_for_command: if `checkhash' is set, don't add non-executable
files to the command hash table, since we will just remove them
later
lib/sh/winsize.c
- get_new_window_size: set *rp and *cp even if READLINE is not defined
1/15
----
lib/sh/winsize.c
- get_new_window_size: call rl_set_window_size only if we can determine
we're using readline: an interactive shell without no-line-editing,
or if we've already initialized readline, presumably in a non-
interactive shell
support/Makefile.in
- man2html: add LDFLAGS_FOR_BUILD to the recipe. Report from
Jeffrey Walton <noloader@gmail.com>
1/17
----
lib/readline/misc.c
- rl_operate_and_get_next: fix old K&R function declaration. Report
from Tom Tromey <tom@tromey.com>
lib/readline/readline.c
- _rl_internal_char_cleanup: move code that cleans up the active region
and deactivates the mark inside this function so callback mode
applications get the intended functionality. Report and fix from
sparrowhawk996@gmail.com
lib/readline/bind.c
- rl_parse_and_bind: when using the arithmetic comparison operators on
the version, make sure to invert the tests so that we stop parsing
if the test fails. Report and fix from Tom Tromey <tom@tromey.com>
1/19
----
Makefile.in
- pipesize.h: add dependency on ${BUILTINS_LIBRARY} to avoid parallel
makes trying to create it twice. Report and fix from
Richard Purdie <richard.purdie@linuxfoundation.org>
1/21
----
subst.c
- param_expand: if a nameref expands to array[@] or array[*], make sure
to call chk_atstar so the right variables are set to split the
result. Report from Oguz <oguzismailuysal@gmail.com>
1/22
----
builtins/declare.def
- Rewrote to reduce complexity. Still needs some work.
lib/readline/*.h, lib/tilde/tilde.h
- PARAMS: remove, rely on compilers understanding function prototypes
lib/readline/{undo.c,histlib.h}
- _hs_replace_history_data: move extern declaration to histlib.h
lib/readline/readline.c
- _rl_parse_colors: instead of an extern declaration for this, include
"parse-colors.h" for it
lib/readline/{histfile.c,histlib.h}
- _hs_append_history_line: move extern declaration to histlib.h
lib/readline/history.h
- HS_HISTORY_VERSION: define to 0x0801 (current library version) if
it's not already defined. We conditionally define it in case an
application has (unwisely) chosen to use it, since the history
library doesn't do anything with it yet
lib/readine/{rlprivate.h,{search,misc,readline}.c}
- _rl_free_history_entry: add extern declaration to rlprivate.h, remove
extern declaration from c source files. Use HS_HISTORY_VERSION as a
sentinel that it's ok to use HIST_ENTRY in rlprivate.h
lib/readline/{rlprivate.h,{isearch,search,undo}.c}
- _rl_saved_line_for_history: add extern declaration to rlprivate.h,
remove extern declaration from c source files, using HS_HISTORY_VERSION
in the same way
1/24
----
lib/readline/signals.c
- _rl_handle_signal: make sure that all sigprocmask calls are protected
by HAVE_POSIX_SIGNALS. Report and fix from Tom Tromey <tom@tromey.com>
1/26
----
lib/readline/callback.c
- rl_callback_read_char: make sure rl_linefunc is non-NULL before
calling through the pointer. The line function could have been
removed by the application before readline processes any typeahead
input. Bug reported by Matthias Klose <doko@debian.org>, pointer
to root cause from Koichi Murase <myoga.murase@gmail.com>
lib/glob/glob.c
- skipname,wskipname: put in some additional checks for `.' to ensure
that we don't get false positives (or incomplete tests) that can
affect the results of extglob patterns. Reported by
gregrwm <rhn-users@greatlakedata.com>
1/27
----
lib/glob/glob.c
- extglob_skipname,wextglob_skipname: fixed an off-by-one error (SE
was being set to one character before the end of the pattern string,
not the null character at the end of the pattern string like other
callers of glob_patscan) that caused the last character of the last
subpattern to be cut off when calling skipname
- extglob_skipname,wextglob_skipname: some cleanups so the code is
closer to identical for the single-byte and wide character versions
2/1
---
execute_cmd.c
- execute_simple_command: in posix mode, if we have a variable
assignment error while assigning into the temporary environment (e.g.,
assigning to a readonly variable), a non-interactive shell running a
special builtin exits; a non-interactive shell running anything else
jumps back to the top level. A shell compiled with -DSTRICT_POSIX
exits unconditionally.
- execute_simple_command: make sure posix mode sets $? to non-zero
if a variable assignment error occurs preceding a non-special builtin
subst.c
- do_assignment_statements: take the code from expand_word_list_internal
that performs assignment statements, either standalone or preceding
simple command names, and factor it out into this function
- expand_word_list_internal: call do_assignment_statements where
appropriate
2/2
---
lib/glob/glob.c
- dequote_pathname: fix function definition for non-multibyte systems.
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
Makefile.in,doc/Makefile.in
- for certain targets, remove files before creating them to deal with
symlinked build trees.
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
examples/loadables/accept.c
- include limits.h before typemax.h
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
builtins/gen-helpfiles.c
- if USING_BASH_MALLOC is defined, make sure to undefine malloc as well
as free. Fixes bug reported by George R Goffe <grgoffe@yahoo.com>
builtins/Makefile.in
- install-help: now depends on $(HELPFILES_TARGET) so we make sure the
separate helpfiles are created before we try to install them if we
don't go through the `all' makefile target
configure.ac
- HELPDIR: now ${datadir}/bash/helpfiles
2/3
---
parse.y
- parse_string_to_word_list: before expanding a compound assignment
statement body, make sure to save any alias that's currently being
expanded. Restore the alias after the compound assignment is parsed.
Reported back in 11/2020 by Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
2/4
---
lib/readline/histexpand.c
- history_expand_internal: when calling the history_inhibit_expansion
function, make sure to call it using the string as we've expanded it
to that point (RESULT), adding the expansion and next characters
temporarily, since we make expansion decisions based on what we've
accumulated, not what we started with. This makes things like
echo abc!$!$ work, where before the second `!' inhibited expansion
because bash_history_inhibit_expansion mistakenly took it as the
second character in a `$!' word expansion. Fixes bug reported back
in 10/2020 by Paul Fox <paul.d.fox@gmail.com>
array.h
- array_pop: instead of calling array_dispose_element from this macro,
just call array_shift with the AS_DISPOSE flag
2/5
---
bashhist.c
- shell_comment: move condition to return 0 if the delimiter stack is
not empty or the shell is parsing a here document into the function
itself, don't have the callers check so the check is in one place.
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
array.h,variables.c
- ARRAY_ELEMENT_REPLACE: convenience define for modifying an array
element's value
variables.c
- pop_args: a couple of code simplifications
2/7
---
lib/malloc/malloc.c
- pagesz: at least MALLOC_PAGESIZE_MIN (4096) bytes
- union mhead: now 16-byte aligned on all systems, 32-bit and 64-bit
pointers
- binsizes: since the smallest allocation overhead is now 16 bytes,
redo the buckets so binsizes[0] == 32; adjust the thresholds for
split/coalesce/prepopulate/mmap (NBUCKETS = 28; STARTBUCK = 0).
Sizes stay pretty much the same; indices change
- consistently use MALLOC_SIZE_T instead of long/unsigned int/int
- use MAGIC8_NUMBYTES as the length of the mh_magic8 buffer, in case
it changes later for alignment
- internal_remap: new function, calls mremap to reallocate a chunk of
memory allocated using mmap(); called from internal_realloc if the
old size and new size are both bigger than the mmap threshold
- internal_realloc: call internal_remap if the old size and new size
are both above the threshold where we use mmap for allocation
2/10
----
include/timer.h
- new file, declaration for a timer struct to be used by a set of
functions to implement timers using SIGALRM or select/pselect
lib/sh/timers.c
- new file, set of functions to manipulate timer objects and timeouts
using SIGALRM or select/pselect. Inspired by a patch from
Koichi Murase <myoga.murase@gmail.com>. Not used yet
2/11
----
builtins/read.def
- read_builtin: if there is a timeout set, block SIGCHLD around calls
to zread and its siblings, or calls to readline for `read -e', so
SIGCHLD (and the consequent waitpid) doesn't interrupt the read.
Fixes bug reported by Koichi Murase <myoga.murase@gmail.com>, but
there may be a different fix coming
Makefile.in,builtins/Makefile.in
- fix up dependencies, especially on builtins.h and builtext.h
2/12
----
lib/readline/input.c
- rl_read_key: if we set rl_done == 1, set RL_STATE_DONE as well
Reported by Koichi Murase <myoga.murase@gmail.com>
lib/readline/isearch.c
- _rl_search_getchar: only call _rl_read_mbstring if rl_read_key returns
>= 0, avoid some work
lib/readline/vi_mode.c
- _rl_vi_callback_change_char,_rl_vi_change_char: don't overwrite the
last replacement string if _rl_vi_callback_getchar returns -1.
It will likely make no difference, since the next read will return
an error or EOF, but being careful
- rl_vi_overstrike: if _rl_overwrite_char doesn't return 0, break out
of the loop
lib/readline/text.c
- _rl_overwrite_char: return 1 if _rl_read_mbstring returns < 0 so
we don't try to insert garbage
bashline.c
- posix_edit_macros: handle rl_read_key() returning <= 0
2/15
----
parse.y
- read_comsub: make sure to turn on the LEX_RESWDOK flag if we are in
a case statement and read a `)', since we can get a valid `esac'.
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
- read_comsub: if we're in a case statement, recognize `}' as a
reserved word and set the LEX_RESWDOK flag for the next word, since
we can get an esac (or another reserved word) after it
2/16
----
parse.y
- reserved_word_acceptable: add ARITH_CMD and COND_END to the list of
tokens that can precede a reserved word, so you can use reserved
words after ((...)) and [[...]].
Reported by Koichi Murase <myoga.murase@gmail.com>
2/17
----
parse.y
- parse_comsub: use new LEX_CASEWD flag to track when we are reading
the WORD in `case WORD in' and turn on the LEX_RESWDOK flag when
that word ends. This allows $(case x in esac), which no one uses.
- parse_comsub: use LEX_PATLIST flag to track when we are reading a
case pattern list so `|' doesn't turn on the LES_RESWDOK flag
- parse_comsub: case_level: simple counter to count the number of esacs
we need to see before we're no longer in a case statement; analog of
esacs_needed_count from the lexer
2/19
----
parse.y
- CHECK_FOR_RESERVED_WORD: don't return ESAC if we read `esac' after a
left paren in a case pattern list. From an austingroup-bugs discussion
about https://www.austingroupbugs.net/view.php?id=1454
- parse_comsub: if we read a `(' while looking for a case pattern list
and LEX_CKESAC is set, we have a leading left paren in the pattern
list and should turn off LEX_CKESAC so (esac) doesn't prematurely
terminate the case command. From an austingroup-bugs discussion
about https://www.austingroupbugs.net/view.php?id=1454
2/26
----
builtins/history.def
- history_builtin: when checking negative offsets to -d, which are
supposed to count back from the end of the history list, check the
range against 0 instead of history_base, because the calculation is
done against history_length, which is independent of history_base.
Report and fix from Christopher Gurnee <chris@gurneeconsulting.net>
2/28
----
doc/bashref.texi
- replaced a number of uses of @var with a mixture of @env and @dfn
to better match up with the texinfo standards
doc/{bash.1,bashref.texi}
- clarify some aspects of the coproc description, especially the
use of NAME and when it's optional
3/1
---
subst.c
- read_comsub: fix off-by-one error in mbrtowc that causes a read one
character past the end of buf. Report and fix from
Platon Pronko <platon7pronko@gmail.com> in
https://savannah.gnu.org/patch/?10035
3/3
---
builtins/ulimit.def
- ulimit_builtin: Posix compatibility: if the last command specified
by an option does not have an option argument, but there is an
operand remaining after all the options are parsed, treat the
operand as an argument to that last command. From an austin-group
discussion and a Geoff Clare suggestion back in November, 2020.
Austin Group interpretation 1418
examples/shellmath
- a package of shell functions to perform floating-point math entirely
in bash. Contributed by Michael Wood <mawood20@gmail.com>. Available
at https://github.com/clarity20/shellmath
3/4
---
support/shobj-conf
- darwin: take out the -arch-only option in SHOBJ_XLDFLAGS and
SHOBJ_ARCHFLAGS; no longer needed
doc/{bash.1,bashref.texi}
- coprocesses: suggested changes from rms@gnu.org; recommend the
`coproc NAME { commands; }' form as the simplest and most flexible
3/5
---
builtins/exec.def
- exec_builtin: set last_command_exit_value before calling exit_shell
so any exit trap gets the right value for $?. From Matthew Bauer
<mjbauer95@gmail.com> via https://savannah.gnu.org/patch/?10039
3/8
---
include/timer.h
- SHTIMER_ALRMSET: new flag, indicates that there is an active alarm
associated with this timer (falarm() was called)
lib/sh/timers.c
- shtimer_set: set the SHTIMER_ALRMSET flag after calling falarm
- shtimer_unset: don't call falarm(0,0) unless the SHTIMER_ALRMSET flag
is set
3/9
---
include/posixtime.h
- added some BSD convenience defines if they are not present
parse.y,shell.h
- {save,restore}_parser_state: save and restore shell_eof_token and
pushed_string_list; change callers (e.g., xparse_dolparen) so they
don't have to manage them
3/10
----
builtins/common.h
- extern declarations for moving to timers (sh_timer) for read builtin
timeouts
quit.h
- CHECK_ALRM: remove, no longer used
trap.c
- check_signals: call check_read_timeout instead of CHECK_ALRM
bashline.c
- bash_event_hook: use read_timeout instead of checking `sigalrm_seen';
that no longer exists
- bash_event_hook: accommodate readline timing out (not used yet)
lib/sh/zread.c
- zread: call read_builtin_timeout() to check for a timeout before
calling a blocking read()
builtins/read.def
- sigalrm,reset_timeout,check_read_timeout,read_builtin_timeout: new
and modified functions to use sh_timers for timeouts instead of
SIGALRM. Based on work contributed by Koichi Murase
<myoga.murase@gmail.com>
- read_builtin: use sh_timers for read timeouts (-t N) instead of
using SIGALRM
- edit_line: simulate receiving SIGALRM if readline times out (not
used yet)
3/11
----
lib/readline/readline.c
- rl_initialize: call _rl_timeout_init to set things up for any timeout
that was set with rl_set_timeout
- readline_internal_charloop: if we longjmped because of a timeout,
make sure to set rl_done/RL_STATE_DONE and return; we are
abandoning this call to readline(). The readline timeout changes
were based on work contributed by Koichi Murase
<myoga.murase@gmail.com>
lib/readline/readline.h
- extern declarations for new timeout functions and hook
- rl_clear_timeout: new define
lib/readline/callback.c
- rl_callback_read_char: if we longjmped because of a timeout,
make sure to set rl_done/RL_STATE_DONE and return; we are
abandoning this call to readline()
lib/readline/util.c
- _rl_abort_internal: if we time out, don't ring the bell; let the
caller handle it
lib/readline/input.c
- extern declarations for public and readline-library-private functions
and hooks to implement timeouts
- rl_set_timeout,rl_timeout_remaining: new public functions
- _rl_timeout_select: new function, uses select/pselect to implement
read timeouts that take timeouts set with rl_set_timeout into account;
calling hook function if a timeout occurs
- rl_gather_tyi, _rl_input_available: use _rl_timeout_select, taking
any existing timeout into consideration if it expires before the
timeout passed as an argument
- rl_getc: use _rl_timeout_select and handle any timeouts by calling
_rl_timehout_handle
- set_alarm,reset_alarm: new functions to implement timeouts using
SIGALRM for systems that lack a working select/pselect
- _rl_timeout_init: new function, sets things up for reading input
with a specified timeout
- _rl_timeout_handle: a timeout handler; calls any event hook and
sets up to abort the current readline() call
- _rl_timeout_handle_sigalrm: a timeout handler for systems using
SIGALRM to implement timeouts
lib/readline/parens.c
- rl_insert_close: use _rl_timeout_select to take timeouts into account
lib/readline/rlprivate.h
- extern declarations for readline-library-private timeout functions
lib/readline/rltty.c
- rl_deprep_terminal: don't print a newline after the bracketed paste
disable sequence if we timed out
lib/readline/signals.c
- _rl_handle_signal: if sig is SIGALRM, call _rl_timeout_handle_sigalrm()
lib/readline/doc/rltech.texi
- rl_set_timeout,rl_timeout_remaining: document new public functions
- RL_STATE_TIMEOUT: document new possible state value for rl_readline_state
- rl_timeout_event_hook: document new hook function, called when
readline times out
builtins/read.def
- read_builtin: changes to use the readline timeout functions to
implement timeouts with `read -e'; these use rl_set_timeout and
sh_timer structs together
3/12
----
subst.c
- expand_string_dollar_quote: new function, expands $'...' and $"..."
in a string for those code paths that don't expand it themselves
subst.h
- expand_string_dollar_quote: extern declaration
parse.y
- read_secondary_line: if $'...' or $"..." appears in the line, call
expand_string_dollar_quote to expand them. This now returns new
memory, need to change callers
make_cmd.c
- make_here_document: account for read_secondary_line returning newly
allocated memory, free `full_line' appropriately
bashline.c
- shell_expand_line,history_and_alias_expand_line: expand $'...' and
$"..." in the line by calling expand_string_dollar_quote, since
that happens after history expansion and before alias expansion in
normal processing
3/15
----
subst.c
- expand_string_dollar_quote: fix out-of-order initialization
Makefile.in
- {TAGS,tags}: add ETAGS/ETAGSFLAGS/CTAGS/CTAGS flags; make sure to
cd to the source directory before running them to get source files
that don't have absolute paths. Fix from Mike Jonkmans
<bashbug@jonkmans.nl>
parse.y
- xparse_dolparen: don't longjmp if FLAGS includes SX_NOLONGJMP. From
a report by Xu Lu <oliver_lew@outlook.com>
3/16
----
subst.c
- process_substitute: set startup_state and parse_and_execute_level
to see if we can avoid a fork()
bashline.c
- bash_spell_correct_word: bindable command (spell-correct-word) to
perform spelling correction on the current `shellword', using the
same code as the `cdspell' option and directory spelling correction
during completion. Feature suggested by in 10/2020 by
Karl Kleinpaste <karl@kleinpaste.org>
- bash_spell_correct_word: bound to "C-x s" by default in emacs mode
lib/readline/display.c
- rl_redisplay: fix redisplay problem that occurs when switching from
the rl-digit-argument prompt "(arg: N)" back to the regular prompt,
and the regular prompt contains invisible characters
doc/bash.1,lib/readline/doc/rluser.texi
- spell-correct-word: document new function and its default binding
3/17
----
doc/{bash.1,bashref.texi}
- cd: slight changes to specify that it sets PWD and OLDPWD
- {pushd,popd}: make it clear that these builtins use cd to change
the current working directory; change wording to simplify the
description and clarify the exit status
3/18
----
execute_cmd.c
- execute_disk_command: after performing redirections, call
unlink_all_fifos() to remove the FIFOs created as part of
expanding redirections. They should have been opened by then, and
we're going to call shell_execve right away anyway, so we won't be
around to remove the FIFOs. From a report from
Michael Felt <aixtools@gmail.com>
3/22
----
parse.y
- alias_expand_token: slight tweak to check for alias expansion: perform
expansion unconditionally if PST_ALEXPNEXT is set, and disable it
in case statement pattern lists if the previous token indicates a
command name is acceptable.
From a report by Oguz <oguzismailuysal@gmail.com>
config-bot.h
- HAVE_MKDTEMP: fix typo
3/25
----
lib/readline/terminal.c
- look in terminfo for key sequences for page up (kP) and page down
(kN) and bind them to history-search-{backward,forward},
respectively. From a patch from Xose Vazquez Perez
<xose.vazquez@gmail.com>
3/30
----
doc/bashref.texi
- expand the node describing $"..." string translation with additional
details and examples
3/31
----
misc.c
- rl_fetch_history: moved here from vi_mode.c
- rl_fetch_history: negative arguments count back from the end of
the history, instead of taking you to the beginning of the history
list
- rl_fetch_history: in vi mode, an out-of-range argument rings the
bell and doesn't change the line
vi_mode.c
- rl_vi_fetch_history: call rl_fetch_history
readline.h
- rl_fetch_history: new extern declaration
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- rl_fetch_history: add description
builtins/setattr.def
- show_var_attributes: if a variable's value indicates that it should
be ANSI-C quoted, use ansic_quote instead of sh_double_quote to
format the value string. From proposal by Greg Wooledge
<greg@wooledge.org>
4/5
---
arrayfunc.c
- unbind_array_element: if FLAGS includes VA_ONEWORD, don't use
skipsubscript to parse the subscript, just assume the entire SUB is
the subcript and that it contains the closing `]', so we just want
everything in SUB except the last character.
parse.y:
- select_command: use compound_list instead of list, like for_command.
Report by Greywolf <greywolf@starwolf.com>
- list: move this into compound_list (replacing the instance of `list'
in the compound_list production), remove from the grammar
4/6
---
arrayfunc.c
- unbind_array_element: use VA_NOEXPAND instead of literal 1
4/7
---
lib/readline/funmap.c
- default_funmap: add missing `vi-undo' to the list of vi-mode bindable
functions. Reported by Xirui Zhao <quinean@icloud.com>
4/8
---
config-top.h
- DEFAULT_LOADABLE_BUILTINS_PATH: default value for BASH_LOADABLES_PATH
doc/{bash.1,bashref.texi}
- enable: note that it uses $BASH_LOADABLES_PATH, and that the default
is system-dependent
variables.c
- initialize_shell_variables: initialize BASH_LOADABLES_PATH to the
default given in DEFAULT_LOADABLE_BUILTINS_PATH
4/12
----
doc/{bash.1,bashref.texi}
- add link to git master tar file as a place to get the current version
4/14
----
bashline.c
- attempt_shell_completion: use -1 as a sentinel value for
in_command_position indicating that we cannot be in a command position
(e.g., because we're the target of a redirection) and should not
check for a programmable command completion or tell the programmable
completion code to use command completion. Report and fix from
Marc Aurèle La France <tsi@tuyoix.net>
4/16
----
builtins/bind.def
- bind_builtin: reverse sense of strvec_search return value when
deciding whether or not to remove a unix-command binding from the
cmd keymap. Bug report by Dale Sedivec <dale@codefu.org>
lib/readline/doc/rltech.texi
- RL_PROMPT_{START,END}_IGNORE: document current values of \001 and
\002. Report from Mingye Wang <arthur200126@gmail.com>
4/19
----
arrayfunc.c
- assign_assoc_from_kvlist: fix memory leak reported by konsolebox
<konsolebox@gmail.com>
4/20
----
command.h,subst.c
- W_ITILDE: remove, replace with a variable since it's only used inside
a single call to expand_word_internal
4/21
----
{subst.c,make_cmd.c,parse.y}
- W_DQUOTE: no longer used, use W_NOPROCSUB and W_NOTILDE directly
(for arithmetic commands and words in arithmetic for commands)
4/24
----
bashline.c
- executable_completion: since this function gets an unquoted filename
from rl_filename_completion_function, we need to quote special
characters before passing it to bash_directory_completion_hook.
Report from Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
4/26
----
lib/readline/search.c
- _rl_nsearch_abort: move function calls around so _rl_restore_prompt
happens before rl_clear_message, like when aborting an incremental
search. Suggested by sparrowhawk996@gmail.com
subst.h
- ASS_ALLOWALLSUB: new assignment flag value, means to allow @ and * as
valid array subscripts when assigning to existing associative arrays
arrayfunc.c
- assign_array_element: allow assignment of key `@' to an existing
associative array if the caller passes ASS_ALLOWALLSUB
- assign_compound_array_list: allow ( [@]=value ) to an existing
associative array
builtins/declare.def
- declare_internal: allow assignment of key `@' to an existing
associative array by passing ASS_ALLOWALLSUB to assign_array_element
as part of local_aflags. This affects declare, local, and typeset
subst.c
- do_assignment_internal: allow a[@]=value to an existing associative
array by passing ASS_ALLOWALLSUB to assign_array_element
4/27
----
builtins/common.[ch]
- builtin_bind_var_to_int: wrapper for bind_var_to_int to be used by
builtin commands; placeholder for future work
builtins/wait.def
- builtin_bind_var_to_int: use instead of bind_var_to_int
builtins/common.c
- builtin_bind_variable: allow assignment of key `@' to an existing
associative array by passing ASS_ALLOWALLSUB to assign_array_element.
This affects printf and read
builtins/variables.[ch]
- bind_var_to_int: add third `flags' argument to pass to bind_variable
instead of always passing 0
redir.c,builtins/common.c,builtins/printf.def
- bind_var_to_int: change callers, add third flags argument
builtins/common.c
- builtin_bind_var_to_int: pass ASS_ALLOWALLSUB to bind_var_to_int so
builtins like wait can assign to assoc[@] and assoc[*]
4/28
----
bashline.c
- command_word_completion_function: make sure to initialize
old_glob_ignore_case before trying to restore from it
- command_word_completion_function: if we are completing a glob
pattern, make sure to set rl_filename_completion_desired, so we get
quoting and appending -- we are completing a filename, after all.
From a report from Manuel Boni <ziosombrero@gmail.com>
lib/readline/bind.c
- enable-active-region: separate control of the active region and
bracketed paste. Still set to the same default value as bracketed
paste, and enabling bracketed paste enables the active region.
Now you can enable bracketed paste and then turn off the active
region.
doc/bash.1,lib/readline/doc/{readline.3,rltech.texi}
- enable-active-region: document new bindable readline variable and
its effects
4/30
----
command.h
- W_ARRAYREF: new flag, meaning the word is a valid array reference
with subscript, replaces W_DOLLARSTAR, which was unused
subst.c
- expand_subscript_string,expand_array_subscript: new functions to
parse and expand-and-quote array subscripts. For future use
5/3
---
builtins/mapfile.def
- mapfile: if the delimiter is a newline, set unbuffered_read = 1
for any file descriptor that isn't seekable and lseek sets errno
to ESPIPE (pipes, FIFOs, maybe terminal devices). If it's not a
newline, only allow buffered reads if the file descriptor is a
regular file. Report from Koichi Murase <myoga.murase@gmail.com>
builtins/read.def
- read_builtin: only set unbuffered_read = 1 if the input is coming
from a pipe (which we can't seek on) or the input is a terminal and
we want to read a specified number of characters or we're using a
non-standard delimiter
5/4
---
builtins/mapfile.def
- mapfile: call zsyncfd before calling the callback. Suggested by
Koichi Murase <myoga.murase@gmail.com>; we'll see how it goes
5/5
---
subst.h
- expand_subscript_string: extern declaration
{arrayfunc,subst}.c
- expand_subscript_string: replace expand_assignment_string_to_string
with calls to this when expanding array subscripts
subst.c
- cond_expand_word: call expand_word_internal with Q_ARITH if `special'
says we should quote for an arithmetic expression context
- expand_word_internal: call expand_array_subscript when we see `[' in
arithmetic or array subscript contexts, make conditional on the
compatibility level later
- expand_word_internal: make sure W_ARRAYREF makes it through this
function and into the returned word
5/6
---
arrayfunc.c
- array_expand_index: call evalexp with a flag of 0 since we call
expand_arith_string with Q_ARITH and we want evalexp to remove
the quotes
execute_cmd.c
- eval_arith_for_expr,execute_arith_command: now that Q_ARITH has an
effect on array subscripts (it quotes the special expansion
characters), call evalexp with 0 as the flags arg so quote removal
is performed on this quoted argument. Make this conditional on the
shell compatibility level later
- execute_cond_command: make sure to expand the argument to -v by
calling cond_expand_node with Q_ARITH, and correspondingly turn off
assoc_expand_once when calling unary_test with that argument, since
we want it to be expanded again to remove the quotes
- execute_cond_command: expand the arguments to the arithmetic operators
with Q_ARITH and pass TEST_ARITHEXP to binary_test to ensure that
it lets evalexp expand the arguments to remove the quoting
test.c
- arithcomp: if TEST_ARITHEXP is in FLAGS, call evalexp with a flag
if 0 to force evalexp to expand the arguments to remove the quoting
subst.c
- param_expand: since we call expand_arith_string with Q_ARITH, we need
to call evalexp with 0 instead of EXP_EXPANDED for $((...)) expansion
- expand_word_internal: if we recursively call expand_word_internal to
expand the contents of a double-quoted string, make sure we pass
through Q_ARITH if it appears in QUOTED
- verify_substring_values: call expand_arith_string with Q_ARITH and
correspondingly call evalexp with 0 instead of EXP_EXPANDED
execute_cmd.c
- execute_cond_node: if -v is the operator, and the operand is a valid
array reference, pass TEST_ARRAYEXP flag to unary_test
5/7
---
builtins/common.[ch]
- set_expand_once: set array_expand_once to the value passed as the
first argument, returning the original value
builtins.h
- ARRAYREF_BUILTIN: new flag for shell builtins, means that the builtin
can take array references, with subscripts, as arguments
builtins/mkbuiltins.c
- set ARRAYREF_BUILTIN flag on builtins given in the arrayvar_builtins
array
execute_cmd.c
- execute_cond_node: use set_expand_once to set array_expand_once to 0
before calling unary_test with -v (see change from 5/6)
arrayfunc.c
- unbind_array_element: allow the caller to choose whether or not a
subscript of `*' or `@' unsets the entire array by passing
VA_ALLOWALL in FLAGS. Right now, since the unset builtin doesn't
pass VA_ALLOWALL, those subscripts unset individual elements for
associative arrays. We preserve the old behavior of unsetting
indexed arrays for the time being with new indexed-array-specific
code
5/9
---
builtins/shopt.def
- expand_once_flag: "assoc_expand_once" option now sets this flag,
calls set_assoc_expand on change
- set_assoc_expand: sets assoc_expand_once to mirror expand_once_flag;
placeholder for future changes
builtins/common.h
- expand_once_flag: extern declaration
5/10
----
doc/{bash.1,bashref.texi}
- note that case patterns undergo quote removal. Reported by
AlvinSeville7cf <alvinseville7cf@gmail.com>
5/11
----
builtins/bashgetopt.c
- list_optflags: flags associated with the word corresponding to
list_optarg, assuming list_optarg is a separate argument
builtins/bashgetopt.h
- list_optflags: extern declaration
builtins/set.def
- unset_builtin: set VFLAGS each time through the loop, since we take
whether or not the word has W_ARRAYREF set into account
- unset_builtin: don't pass VA_ALLOWALL to unbind_array_element for
now
test.c
- unary_test: in the -v case, use assoc_expand_once in the first call
to valid_array_reference ()
builtins/printf.def
- printf_builtin: only set VA_ONEWORD if the option argument to -v has
W_ARRAYREF set (look at list_optflags)
5/12
----
subst.c
- expand_array_subscript: don't quote @ or * in the expanded subscript
at all, even when they are the only character in the subscript. See
how this works out -- it might uncover places where we need to allow
`*' and `@' as subscripts where they are not allowed now
expr.c
- expr_bind_variable: pass ASS_ALLOWALLSUB to bind_int_variable so we
can allow (( A[@]=value )) when A is an existing associative array
arrayfunc.h
- AV_ATSTARKEYS: new flag value, means to accept a[@] and a[*] but
treat them as keys/expressions and not special values
arrayfunc.c
- array_value_internal: check AV_ATSTARKEYS and don't treat them as
ALL_ELEMENT_SUB values; they fall through to use as keys/indices
test.c
- unary_test: if -v is passed an array reference, add AV_ATSTARKEYS to
the flags passed to array_value so we treat @ and * as keys for an
existing associative array
5/13
----
subst.c
- expand_cond_word: if SPECIAL == 3 (arithmetic expression), dequote the
resulting WORD_LIST * as if special == 0, because we don't want to
quote the list for pattern matching. Report from
Adjudicator Darren <adjudicatordarren@protonmail.com>
5/14
----
subst.c
- expand_array_subscript: add double quote (") to the list of characters
that are backslash-quoted in subscripts after word expansion.
skipsubscript treats them specially, so you have to quote them to
do things like `key='"' ; array[$key]=1 ; [[ -v array[$key] ]]'
5/16
----
builtins/wait.def
- wait_builtin: if we longjmp to wait_intr_buf, call unset_waitlist if
we have called set_waitlist (wflags & JWAIT_WAITING). Fixes bug with
wait -n interrupted by a trapped signal (not SIGINT) reported by
Jonas Alfredsson <jonas.alfredsson@protonmail.com>
jobs.c
- wait_sigint_cleanup: restore the old sigint handler before we longjmp
out by calling restore_sigint_handler()
5/17
----
builtins/read.def
- bind_read_variable: now takes an additional argument, flags to pass
to builtin_bind_variable; change callers
- SET_VFLAGS: set vflags and bindflags
- read_builtin: call SET_VFLAGS to set vflags and bindflags from each
word before calling valid_array_reference and bind_read_variable
builtins/common.c
- builtin_bind_variable: set vflags (for valid_array_reference) and
bindflags (for bind_variable/assign_array_element) separately for
clarity
arrayfunc.c
- assign_array_element: sanity check: make sure that the suubscript
returned by array_variable_name consumes the entire NAME, otherwise
flag it as a subscript error. This keeps things like
`KEY=' ]'; read assoc[$KEY] <<< hello' from assigning to incomplete
subscripts
builtins/printf.def
- printf_builtin: if LIST_OPTFLAGS includes W_ARRAYREF, set VA_NOEXPAND
in VFLAGS
5/17
----
lib/readline/complete.c
- compute_lcd_of_matches: move a couple of strlen calls out of a loop
in calls to mbrtowc; performance improvement only. Report and fix
from sparrowhawk996@gmail.com
lib/readline/bind.c
- rl_trim_arg_from_keyseq: take a key sequence and its length and
return the index into the key sequence following any initial numeric
argument. Return -1 if there is no numeric argument (the caller is
expected to make sure) or if the key sequence consists *only* of
the numeric argument. The caller should use the remainder of the
key sequence to look up the desired key binding.
lib/readline/readline.h
- rl_trim_arg_from_keyseq: extern declaration
bashline.c
- bash_execute_unix_command: if the argument count is > 1 or we have
an explicit argument, call rl_trim_arg_from_keyseq to get past the
numeric argument and deal with the rest of the key sequence. We still
need a way to pass it to the invoked program or function. From
a report from Jesper Nygards <jesper.nygards@gmail.com>
5/18
----
bashline.c
- bash_execute_unix_command: if the user supplied a numeric argument
when invoking bash_execute_unix_command, pass it to the command in
the READLINE_ARGUMENT variable
lib/readline/readline.[ch]
- _rl_del_executing_keyseq: convenience function to `delete' the last
character added to the executing key sequence. Intended to be used
before calling rl_execute_next or similar functions that push input
back to be re-read
doc/{bash.1,bashref.texi}
- READLINE_ARGUMENT: documented new variable available for commands
defined using `bind -x' keybindings
lib/readline/doc/rltech.texi
- rl_trim_arg_from_keyseq: documented new function
5/19
----
builtins/evalstring.c
- should_suppress_fork: suppress the fork if we're in a process
substitution subshell, in addition to being a simple command
without redirections. From a report back in 10/2020 from
Hyunho Cho <mug896@gmail.com>
bashline.c
- command_word_completion_function: if we're trying to complete an
absolute program (one containing a slash), don't run strcmp or
strcasecmp on the return value from rl_filename_completion_function,
since that duplicates work the filename completion function already
does. From a report back in 1/2021 by awa54@cdak.net
5/22
----
parse.y
- CHECK_FOR_RESERVED_WORD: if we are returning an ESAC and unsetting
PST_CASESTMT, decrement esacs_needed_count
parse.y,shell.h
- sh_parser_state_t: save and restore esacs_needed_count and
expecting_in_token in the shell parser state struct and
save_parser_state/restore_parser_state
print_cmd.c
- print_simple_command: don't bother to call command_print_word_list
with an empty list
- print_simple_command: don't print a space before a redirection list
if there weren't any command words to print
5/24
----
lib/sh/input_avail.c
- nchars_avail: make sure SET and OSET are declared on systems with
select(2). Reported by Larkin Nickle <me@larbob.org>
parse.y
- cond_term: if we read a `!' toggle CMD_INVERT_RETURN instead of
setting it unconditionally. Report and patch from
Vincent Menegaux <vincent.menegaux@gmail.com> via
https://savannah.gnu.org/patch/?10070
5/25
----
doc/{bash.1,bashref.texi}
- test: add the ( $2 $3 ) case to the description of the four-argument
behavior. Inspired by a discussion with Christoph Anton Mitterer
<calestyo@scientia.net>
5/27
----
doc/bashref.texi
- replace most of the GNU parallel section with a reference to the
tutorial on gnu.org
lib/glob/glob.h
- GX_NEGATE: new flag; indicates whether the pattern is being negated
as part of an extglob pattern. Not used yet
lib/glob/glob.c
- extglob_skipname,wextglob_skipname: pass GX_NEGATE to the skipname
functions if the pattern is being negated. Not checked yet
5/28
----
doc/{bash.1,bashref.texi}
- dotglob: add text to clarify that `.' and `..' have to be matched by
a pattern beginning with `.' or -- and this is the sketchy part --
that a pattern beginning with `.' has to be one of the patterns in
an extended glob expression
lib/glob/glob.c
- skipname,wskipname: perform the special checks for `.' only if the
pattern is not being negated
6/3
---
parse.y,shell.h
- eol_ungetc_lookahead: save and restore as part of the parser state
included in {save,restore}_parser_state
6/7
---
lib/readline/display.c
- puts_face: make sure to cast each member of STR to unsigned char, so
it's not misinterpreted as EOF, which putc_face does not display.
Report and fix from Volodymyr Prodan <vovcat@gmail.com> in
https://savannah.gnu.org/patch/?10076
examples/shobj-conf
- aix*gcc: change SHOBJ_LD to ${CC}, prefix the SHOBJ_LDFLAGS flags
with -Wl, so gcc will pass them to the linker. Report from
lehel@maxer.hu in https://savannah.gnu.org/support/?110505
6/11
----
doc/{bash.1,bashref.texi}
- cd: additional arguments are not ignored; they raise an error.
Report from Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
lib/glob/strmatch.h
- FNM_DOTDOT: enable special handling for `.' and `..': if FNM_PERIOD
is not set, `.' and `..' at the start of a string or as a pathname
component need to be matched by a `.' in the pattern and cannot be
matched by `?', `*', or a bracket expression
lib/glob/glob.c
- glob_vector: pass FNM_DOTDOT to strmatch() if noglob_dot_filenames
is not set to enable special handling of `.' and `..'. Prompted by a
discussion with Nora Platiel <nplatiel@gmx.us>
- skipname,wskipname: remove special checks for `.' and (disabled)
checks for `..'
lib/glob/sm_loop.c
- GMATCH: implement special handling for FNM_DOTDOT and `.' and `..':
make sure they can't be matched by any special glob characters at
the start of the string or as a pathname component (if FNM_PATHNAME
is set). This also means that !(pattern) won't return `.' or `..'
if dotglob is set
- GMATCH,EXTMATCH: don't pass FNM_DOTDOT down to recursive calls, like
FNM_PERIOD, once we process the first character in the string or
pathname component
lib/glob/smatch.c
- ISDIRSEP,PATHSEP,SDOT_OR_DOTDOT,PDOT_OR_DOTDOT: provide definitions
for single-byte or wide character strings for sm_loop.c to use
6/16
----
doc/{bash.1,bashref.texi},lib/readline/doc/{rluser,rltech}.texi
- slight wording changes to rewrite gender-specific language. From a
report by Vipul Kumar <kumar+bug-bash@onenetbeyond.org>, suggested
language from G. Branden Robinson <g.branden.robinson@gmail.com>,
Lawrence Velázquez <vq@larryv.me>,
and Andrew Church <achurch+bash@achurch.org>
builtins/fc.def
- fc_builtin: make sure an entry in the history list is non-null
before trying to write it to stdout or the temporary file. From a
report from Sibo Dong <sibo.dong@outlook.com>
builtins/common.[ch]
- builtin_arrayref_flags: given a WORD_DESC * (which includes flags)
and a base set of flags, return a set of flags to pass to
valid_array_reference and similar functions
builtins/set.def
- unset_builtin: call builtin_arrayref_flags to set vflags
6/19
----
parse.y
- parse_comsub: rewrite to recursively call the parser (yyparse()) and
return a string constructed from the resulting parse tree. Probably
will only work with bison. Error reporting is more accurate about
line numbers and invalid tokens, and command substitution errors
are caught earlier, before expansion
- DOLPAREN: new token, never created by yylex; only ever set by
parse_comsub and xparse_dolparen to indicate we're recursively
calling the parser for a command substitution
- comsub: new grammar production that's triggered by DOLPAREN and
parses a command substitution, returning a <command>. It's one of
the possible end states for the top-level parser
- grammar: only call rewind_input_string if the shell's input is
coming from a string
- shell_ungets: push a string back onto the shell input; only used by
make_here_document for backwards compatibility -- allowing a here-
document to be terminated by a token at the end of a command
substitution
- yylex: don't need any more special handling when returning
shell_eof_token, but we keep the clause for future work
- read_token_word: don't handle backslashes (leave them in the input
stream) if we are reading a command substitution (PST_NOEXPAND)
- reserved_word_acceptable: allow reserved words after DOLPAREN
- report_syntax_error: better error handling if we hit EOF while
looking for the ending right paren in a command substitution
- parse_string_to_word_list,parse_compound_assignment: make sure to
turn off parse_comsub sentinel temporarily
make_cmd.c
- make_here_document: backwards compatibility: if we end a here
document on the same line as the end of a command substitution,
allow the token to terminate the here document (without requiring
a newline) and push the remainder of the line back for the parser
to consume and terminate the command substitution
builtins/evalstring.c
- parse_string: if we read shell_eof_token and use it to terminate a
command, rewind the input string here before returning, instead of
guessing where to rewind it in the caller
6/22
----
redir.c
- do_redirection_internal: if VARASSIGN_REDIR_AUTOCLOSE is non-zero,
add a redirect to automatically close {var}<fn and other styles of
varassign redirection. It's zero by default
builtins/shopt.def
- varredir_close: new shell option, mirrors the value of
varassign_redir_autoclose. Suggested multiple times by multiple
people
doc/{bash.1,bashref.texi}
- varredir_close: document new shell option (the name is tentative)
6/24
----
parse.y
- yylex: if read_token returns a value < 0, return YYerror to the
parser
- parse_comsub: if the current_token is not shell_eof_token when
yyparse returns, return an error to read_token_word instead of
trying to keep parsing. Fixes interactive-only (?) bug reported by
Koichi Murase <myoga.murase@gmail.com>
parser.h
- PST_NOERROR: don't print error messages in yyerror(), just reset
the parser and return
parse.y
- yyerror: if parser_state & PST_NOERROR, don't print an error message
- xparse_dolparen: if the flags includes SX_COMPLETE, add PST_NOERROR
to parser_state, to inhibit error messages. Fixes bug with adding
lines with incomplete command substitutions to the history list
reported by Koichi Murase <myoga.murase@gmail.com>
subst.c
- skip_matched_pair: make sure to pass the SX_COMPLETE flag to
extract_delimited_string
6/28
----
lib/readline/bind.c
- rl_trim_arg_from_keyseq: handle rl_vi_arg_digit if VI_MODE is
defined. Report and fix from Koichi Murase <myoga.murase@gmail.com>
- rl_trim_arg_from_keyseq: rework to handle case where the digit
argument is given as a discrete sequence of multiple rl_digit_argument
commands (e.g, "M-1 M-2" instead of "M-1 2"). Report and fix from
Koichi Murase <myoga.murase@gmail.com>
subst.c
- pat_subst: avoid calling RESIZE_MALLOCED_BUFFER with STRLEN(s) as an
argument, since it ends up going into a loop. Report and fix from
Koichi Murase <myoga.murase@gmail.com>
lib/sh/casemod.c
- cval: take the string length as an argument, to avoid having to call
strlen every time (in HANDLE_MULTIBYTE mode). The caller already has
this info. Report and fix from Koichi Murase <myoga.murase@gmail.com>
builtins/complete.def
- print_cmd_name: single-quote the command name if it contains any
shell metacharacters
- print_one_completion: call print_arg with a second arg of 1 if the
function name contains shell metacharacters. Report and fix from
Koichi Murase <myoga.murase@gmail.com>
6/30
----
configure.ac
- substitute BASE_CFLAGS_FOR_BUILD and STYLE_CFLAGS into Makefile
targets
- take STYLE_CFLAGS out of the CFLAGS_FOR_BUILD variable that gets
substituted
- remove STYLE_CFLAGS from CFLAGS
- use `:+' expansion to set variables based on whether $GCC is set
or null, since configure can do GCC=
support/Makefile.in
- man2html: remove CCFLAGS_FOR_BUILD from the recipe, leaving only
LDFLAGS_FOR_BUILD. Report from Jay K <jayk123@hotmail.com>
- gen-helpfiles: remove CCFLAGS_FOR_BUILD from the recipe, leaving
only LDFLAGS_FOR_BUILD
- man2html: use $(STYLE_CFLAGS) in BASE_CCFLAGS variable for C file
compilation options
{,builtins}/Makefile.in, lib/{sh,readline,malloc,glob}/Makefile.in
- use STYLE_CFLAGS so specifying CFLAGS=-g to make doesn't clutter the
output with warnings about parens and format strings
7/9
---
lib/readline/search.c
- make_history_line_current: call _rl_free_saved_history_line to clean
up _rl_saved_line_from_history and get all the code that frees it
into one place
lib/readline/misc.c
- _rl_free_saved_history_line: if rl_undo_list points to the data
member of _rl_saved_line_from_history, set it to NULL to avoid having
it point to freed memory, since the next thing we do now is to free
the undo list the data member points to
- _rl_start_using_history: call _rl_free_saved_history_line instead of
calling _rl_free_history_entry directly. Fixes memory leak reported
by Trung Dam <trungdam@yahoo.com>
7/12
----
lib/readline/search.c
- make_history_line_current: free rl_undo_list before replacing the
current line with the line from history, since it is a private
undo list from reading the search string
lib/readline/rlmbutil.h
- Since wchar_t/mbrtowc/wcrtomb are limited to 16 bits on Windows
with MSVC, start abstracting the differences using WCHAR_T/
MBRTOWC/WCRTOMB
7/13
----
lib/readline/{complete,display,input,text,util,vi_mode}.c
- use WCHAR_T/MBRTOWC/WCRTOMB. Part of a set of Windows MSVC fixes
from sparrowhawk996@gmail.com
builtins/{enable,hash,help}.def
- enable_builtin: use sh_chkwrite after output to check for write errors
7/16
----
arrayfunc.c
- quote_compound_array_word: free SUB and VALUE after assigning from
sh_single_quote(). From a coverity report from
Siteshwar Vashisht <svashisht@redhat.com>
bashhist.c
- bash_remove_history_range: free DISCARD_LIST after freeing its
elements
bashline.c
- bash_directory_expansion: add code to free D as a separate branch,
though it's never hit in practice
builtins/trap.def
- showtrap: free T even if show_default == 1 if it's a non-default
trap string
7/17
----
execute_cmd.c
- execute_coproc: free NAME on invalid identifier error
lib/glob/glob.c
- glob_vector: make sure NEXTLINK is allocated using malloc before
passing it to free()
- glob_filename: free RESULT before returning glob_error_return when
there is only a filename
print_cmd.c
- indirection_level_string: make sure we free PS4 after calling
decode_prompt_string if *ps4 == 0
subst.c
- parameter_brace_transform: if vtype == VT_VARIABLE, we need to free
a non-null VAL
variables.c
- assign_in_env: if NAME is not a valid shell identifier, free it
after printing the error message and before returning. These are
the rest of the fixes from Siteshwar Vashisht <svashisht@redhat.com>
7/22
----
shell.c
- main: set dollar_vars[0] to shell_script_filename before calling
run_startup_files() in the non-interactive case. Restore it after
run_startup_files returns so we can get better error messages if
we can't open a script file. Suggested by several people, originally
by Marc Aurèle La France <tsi@tuyoix.net> back in 2/2021 (in a
different form) and most recently by Tapani Tarvainen
<bash@tapanitarvainen.fi>
7/28
----
trap.c
- any_signals_trapped: return that a signal is trapped only if it's
not ignored. This is an additional opportunity for optimization,
reported in https://bugzilla.redhat.com/show_bug.cgi?id=1981926
7/30
----
examples/loadables/sleep.c
- main: if the uconvert conversion fails, but the argument appears to
contain a GNU-like interval specifier like "1m30s", return
EX_DISKFALLBACK so the execute_builtin code tries to run the
external version
builtins/enable.def
- enable_shell_builtin: if the builtin isn't found, return EX_NOTFOUND
to allow the caller (enable_builtin) to react differently if it
wants to
- dyn_load_builtin: if the shared object isn't found, return EX_NOTFOUND,
change enable_builtin to deal with it
- enable_builtin: if there are no supplied options, and we attempt to
enable a non-existent builtin, try modifying `enable name' to the
equivalent of `enable -f name name' and return success if we
successfully load a builtin from a shared object. Proposed several
times, most recently by Robert Elz <kre@munnari.OZ.AU>
doc/{bash.1,bashref.texi}
- enable: document new behavior of `enable NAME' when NAME is not a
current shell builtin
8/3
---
lib/glob/sm_loop.c
- GMATCH: check for interrupts or terminating signals each time through
the loop and return FNM_NOMATCH immediately if received. Let the
higher layers deal with interrupting the match and jumping out.
Inspired by a report from andrej@podzimek.org
8/6
---
subst.c
- {parameter_brace_remove_pattern,parameter_brace_transform,
parameter_brace_substring,parameter_brace_casemod,
parameter_brace_patsub}: make sure the IND argument is of type
arrayind_t to handle the full range of subscripts. Reported by
felix@f-hauri.ch
builtins/printf.def
- printf_builtin: take new format specifier: %Q. This acts like %q
but applies any supplied precision to the original unquoted
argument, then quotes that result and outputs the entire quoted
string, preserving the original field width. Originally suggested
back in 4/2020 by Sam Liddicott <sam@liddicott.com>
subst.c
- char_is_quoted: check whether or not we are on the second or later
line of a command with an unclosed quoted string from a previous
line. If we are, see if it's closed before the character we're
checking, so we don't interpret a closing quote as starting a new
quoted string. Reported several times, most recently by
Phi Debian <phi.debian@gmail.com> in 6/2021.
8/9
---
parse.y,subst.c
- locale_expand: if the variable SINGLEQUOTE_TRANSLATIONS is non-zero,
single-quote the translated result of $"..." (if it's different from
the untranslated string)
builtins/shopt.def
- noexpand_translation: new option to expose the value of
SINGLEQUOTE_TRANSLATIONS
8/10
----
doc/{bash.1,bashref.texi}
- noexpand_translation: add description of new option
|