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
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
|
2/14/2011
---------
[bash-4.2 released]
2/15
----
lib/glob/gmisc.c
- fix wmatchlen and umatchlen to avoid going past the end of the
string on an incomplete bracket expression that ends with a
NUL. Partial fix for bug reported by Clark Wang <dearvoid@gmail.com>
2/16
----
subst.h
- new string extract flag value: SX_WORD. Used when calling
extract_dollar_brace_string to skip over the word in
${param op word} from parameter_brace_expand
subst.c
- change parameter_brace_expand to add SX_WORD to flags passed to
extract_dollar_brace_string
- change parameter_brace_expand to use SX_POSIXEXP for all non-posix
word expansion operators that treat single quotes as special, not
just % and #
- change extract_dollar_brace_string to initialize dolbrace_state to
DOLBRACE_WORD if SX_WORD flag supplied and we shouldn't use
DOLBRACE_QUOTE. Fixes bug reported by Juergen Daubert <jue@jue.li>
doc/{bash.1,bashref.texi}
- document the exact expansions here strings undergo
2/17
----
lib/readline/vi_mode.c
- make sure that `dd', `cc', and `yy' call vidomove_dispatch from
rl_domove_read_callback. Fixes bug reported by Clark Wang
<dearvoid@gmail.com>
lib/readline/callback.c
- make sure _rl_internal_char_cleanup is called after the
vi-motion callbacks (rl_vi_domove_callback) in rl_callback_read_char.
Companion to above fix
doc/{bash.1,bashref.texi}
- make sure that the text describing the rhs of the == and =~
operators to [[ states that only the quoted portion of the pattern
is matched as a string
2/18
----
lib/glob/gmisc.c
- better fix for umatchlen/wmatchlen: keep track of the number of
characters in a bracket expression as the value to increase
matchlen by if the bracket expression is not well-formed. Fixes
bug reported by Clark Wang <dearvoid@gmail.com>
subst.c
- change expand_string_for_rhs so that it sets the W_NOSPLIT2 flag
in the word flags. We will not perform word splitting or quote
removal on the result, so we do not want to add quoted nulls if
we see "" or ''. Fixes bug reported by Mike Frysinger
<vapier@gentoo.org>
2/19
----
variables.c
- new function, int chkexport(name), checks whether variable NAME is
exported and remakes the export environment if necessary. Returns
1 if NAME is exported and 0 if not
- call chkexport(name) to get tzset to look at the right variable in
the environment when modifying TZ in sv_tz. Don't call tzset if
chkexport doesn't indicate that the variable is exported
variables.h
- new extern declaration for chkexport
{parse.y,builtins/printf.def}
- call sv_tz before calling localtime() when formatting time strings
in prompt strings or using printf. Fixes bug reported by
Dennis Williamson <dennistwilliamson@gmail.com>
execute_cmd.c
- modify fix of 2/9 to add casts when those variables are passed to
functions; some compilers throw errors instead of warnings. Report
and fix from Joachim Schmitz <jojo@schmitz-digital.de>
support/shobj-conf
- add a stanza for nsk on the Tandem from Joachim Schmitz
<jojo@schmitz-digital.de>
{shell,lib/readline/shell}.c
- Tandem systems should use getpwnam (getlogin()); for some reason
they don't do well with using getuid(). Fix from Joachim Schmitz
<jojo@schmitz-digital.de>
3/1
---
variables.c
- make sure that the return value from find_variable is non-null
before trying to use it in chkexport. Fixes bug reported by
Evangelos Foutras <foutrelis@gmail.com>
3/3
---
parse.y
- when adding $$ to the current token buffer in read_token_word(),
don't xmalloc a buffer for two characters and then strcpy it, just
copy the characters directly into the token buffer. Fix from
Michael Whitten <mfwitten@gmail.com>
execute_cmd.c
- fix expand_word_unsplit to add the W_NOSPLIT2 flag to the word to
be expanded, so "" doesn't add CTLNUL. Similar to fix of 2/18 to
expand_string_for_rhs. Fixes bug reported by Nathanael D. Noblet
<nathanael@gnat.ca> and Matthias Klose <doko@debian.org>
parse.y
- fix extended_glob case of read_token_word to allocate an extra
space in the buffer for the next character read after the extended
glob specification if it's a CTLESC or CTLNUL. Report and fix from
Michael Witten <mfwitten@gmail.com>
- fix shell expansions case of read_token_word to allocate an extra
space in the buffer for the next character read after the shell
expansion if it's a CTLESC or CTLNUL. Report and fix from
Michael Witten <mfwitten@gmail.com>
- TENTATIVE: fix read_token_word to reduce the amount of buffer space
required to hold the translated and double-quoted value of $"..."
strings. Report and fix from Michael Witten <mfwitten@gmail.com>
- change code around got_character and got_escaped_character labels to
make sure that we call RESIZE_MALLOCED_BUFFER before adding the
CTLESC before a CTLESC or CTLNUL, and before adding the character if
we're not adding a CTLESC. Report and fix from
Michael Witten <mfwitten@gmail.com>
subst.c
- new param flags value, PF_ASSIGNRHS, mirrors W_ASSIGNRHS, noting that
parameter expansion is on rhs of assignment statement. That inhibits
word splitting
- change param_expand to call string_list_dollar_at with quoted == 1
if PF_ASSIGNRHS is set, so it will quote IFS characters in the
positional parameter before separating them with the first char of
$IFS. This keeps the rhs from being split inappropriately. Fixes
bug reported by Andres Perera <andres.p@zoho.com>
3/4
---
lib/readline/bind.c
- add a missing free of `names' in rl_function_dumper. Bug report
and fix from Michael Snyder <msnyder@vmware.com>
3/5
---
lib/readline/rltty.c
- change rl_deprep_terminal so it uses fileno (stdin) for the tty fd
if rl_instream is not set, like rl_prep_terminal
3/6
---
lib/readline/display.c
- fix rl_message to use a dynamically-allocated buffer instead of a
fixed-size buffer of 128 chars for the `local message prompt'. Bug
report and fix from Micah Cowan <micah@cowan.name>
3/7
---
jobs.c
- add sentinel to wait_sigint_handler so it only sets wait_sigint_received
if waiting_for_child is non-zero; otherwise, it restores the old
SIGINT handler and sends itself the SIGINT
- set waiting_for_child around the calls to waitchld that use it to
synchronously wait for a process
- change logic that decides whether or not the child process blocked
or handled SIGINT based on whether or not waitpid returns -1/EINTR
and the shell receives a SIGINT and the child does not exit. If
the child later exits due to SIGINT, cancel the assumoption that it
was handled
- instead of testing whether or not the child exited due to SIGINT
when deciding whether the shell should act on a SIGINT it received
while waiting, test whether or not we think the child caught
SIGINT. If it did, we let it go (unless the shell has it trapped);
if it did not catch it, the shell acts on the SIGINT. Fix from
Linus Torvalds <torvalds@linux-foundation.org>, bug report originally
from Oleg Nesterov <oleg@redhat.com>
3/8
---
shell.c
- initialize no_line_editing to 1 if READLINE is not defined -- we
can't have line editing without readline
3/12
----
lib/readline/signals.c
- add SIGHUP to the set of signals readline handles
lib/readline/doc/rltech.texi
- document that SIGHUP is now part of the set of signals readline
handles
lib/readline/input.c
- if _rl_caught_signal indicates that read() was interrupted by a
SIGHUP or SIGTERM, return READERR or EOF as appropriate
- call rl_event_hook, if it's set, if call to read in rl_getc
returns -1/EINTR. If rl_event_hook doesn't do anything, this
continues the loop as before. This handles the other fatal
signals
execute_cmd.c
- add a couple of QUIT; calls to execute_disk_command and
execute_simple_command to improve responsiveness to interrupts
and fatal signals
input.c
- rearrange getc_with_restart so that the return values from read()
are handled right
parse.y
- don't need to set terminate_immediately in yy_stream_get, since
getc_with_restart checks for terminating signals itself
- since readline returns READERR on SIGHUP or SIGTERM, don't need
to set terminate_immediately. Still doesn't handle other
signals well -- will have to check that some more
bashline.c
- new function, bash_event_hook, for rl_event_hook. Just checks for
terminating signals and acts on them using CHECK_TERMSIG.
- set rl_event_hook to bash_event_hook
builtins/read.def
- take out setting terminate_immediately; add calls to CHECK_TERMSIG
after read calls
doc/{bash.1,bashref.texi}
- move the text describing the effect of negative subscripts used to
reference indexed array elements to the paragraphs describing
${parameter[subscript]}, since that's where they are implemented.
Pointed out by Christopher F. A. Johnson <cfajohnson@gmail.com>
arrayfunc.[ch],subst.c
- array_expand_index now takes a new first argument: a SHELL_VAR *
of the array variable being subscripted. Can be used later to fully
implement negative subscripts
3/14
----
lib/glob/glob.c
- fix mbskipname to not turn the directory entry name into a wide char
string if the conversion of the pattern to a wide char string fails
- fix mbskipname to call skipname if either the pattern or the filename
can't be converted into a wide-char string
lib/glob/xmbsrtowcs.c
- fix xdupmbstowcs2 to handle return value of 0 from mbsnrtowcs and
short-circuit with failure in that case. Fixes bug reported by
Roman Rakus <rrakus@redhat.com>
3/15
----
bashline.c
- new variable, bash_filename_quote_characters to store the value
assigned to rl_filename_quote_characters so it can be restored
if changed.
- change bashline_reset and attempt_shell_completion to restore
rl_filename_quote_characters if not set to default
3/22
----
lib/glob/glob.c
- wdequote_pathname falls back to udequote_pathname if xdupmbstowcs
fails to convert the pathname to a wide-character string
lib/glob/xmbsrtowcs.c
- xdupmbstowcs2: change to fix problem with leading '\\' (results in
nms == 0, which causes it to short-circuit with failure right
away). Fixes bug pointed out by Werner Fink <werner@suse.de>
- xdupmbstowcs2: compensate for mbsnrtowcs returning 0 by taking the
next single-byte character and going on
- xdupmbstowcs2: change memory allocation to increase by WSBUF_INC
bytes; try to avoid calls to realloc (even if they don't actually
result in more memory being allocated)
3/24
----
doc/{bash.1,bashref.texi}
- slightly modify BASH_SUBSHELL description based on complaint from
Sam Liddicott <sam@liddicott.com>
3/25
----
trap.c
- change free_trap_strings to not call free_trap_string for signals
that are being ignored, like reset_or_restore_signal_handlers.
Fixes bug reported by Satoshi Takahashi <blue3waters@gmail.com>
3/26
----
lib/readline/rltypedefs.h
- remove old Function/VFunction/CPFunction/CPPFunction typedefs as
suggested by Tom Tromey <tromey@redhat.com>
lib/readline/rlstdc.h
- move defines for USE_VARARGS/PREFER_STDARG/PREFER_VARARGS from
config.h.in to here because declaration of rl_message in
readline.h uses the defines. This makes it hard for another packages
to use after the header files are installed, since config.h is not
one of the installed files. Suggested by Tom Tromey
<tromey@redhat.com>
3/27
----
print_cmd.c
- change indirection_string from a static buffer to a dynamic one
managed by indirection_level_string(), so we don't end up truncating
PS4. Suggested by Dennis Williamson <dennistwilliamson@gmail.com>
lib/readline/shell.c
- change sh_set_lines_and_columns to use static buffers instead of
allocating the buffers to pass to setenv/putenv
lib/readline/terminal.c
- change _rl_get_screen_size to not call sh_set_lines_and_columns if
ignore_env == 0
- _rl_sigwinch_resize_terminal: new function to just retrieve terminal
size, ignoring environment
lib/readline/rlprivate.h
- new external declaration for _rl_sigwinch_resize_terminal() (currently
unused)
lib/readline/signals.c
- rl_sigwinch_handler: set _rl_caught_signal to SIGWINCH
- rl_sigwinch_handler: don't immediately call rl_resize_terminal; just
leave _rl_caught_signal set for RL_CHECK_SIGNALS to handle
- _rl_signal_handler: call rl_resize_terminal if sig == SIGWINCH.
Should fix hang when sending multiple repeated SIGWINCH reported by
Henning Bekel <h.bekel@googlemail.com>
3/29
----
lib/sh/snprintf.c
- include math.h for any defines for isinf/isnan
- use code from gnulib documentation to implement isinf/isnan if they
are not defined
configure.in
- don't check for isinf or isnan; c99 says they're macros anyway
config.h.in
- remove defines for ISINF_IN_LIBC and ISNAN_IN_LIBC, no longer used
by snprintf.c
4/2
---
braces.c
- brace_gobbler: fix to understand double-quoted command substitution,
since the shell understands unquoted comsubs. Fixes bug reported
by Michael Whitten <mfwitten@gmail.com>
lib/readline/display.c
- include <pc.h> on MDOS
- get and set screen size using DJGPP-specific calls on MSDOS
- move cursor up clear screen using DJGPP-specific calls
- don't call tputs on DJGPP; there is no good terminfo support
lib/readline/terminal.c
- include <pc.h> on MDOS
- get and set screen size using DJGPP-specific calls on MSDOS
- use DJGPP-specific initialization on MSDOS, zeroing all the
_rl_term_* variables
- don't call tputs on DJGPP; there is no good terminfo support
DJGPP support from Eli Zaretskii <eliz@gnu.org>
4/6
---
config-top.h
- change DEFAULT_PATH_VALUE to something more useful and modern
4/8
---
tests/printf2.sub
- make sure LC_ALL and LC_CTYPE are set so LANG assignment takes effect.
Reported by Cedric Arbogast <arbogast.cedric@gmail.com>
4/11
----
include/chartypes.h
- fix a couple of dicey defines (though ones that don't cause any
compiler warnings) in IN_CTYPE_DOMAIN
doc/{bashref.texi,bash.1}
- add note referring to duplicating file descriptors in sections
describing redirecting stdout and stderr and appending to stdout
and stderr. Suggested by Matthew Dinger <mdinger.bugzilla@gmail.com>
pcomplete.c
- it_init_helptopics: new function to support completing on help topics,
not just builtins
- it_helptopics: new programmable completion list of help topics
- build list of helptopic completions in gen_action_completions on
demand
pcomplete.h
- new extern declaration for it_helptopics
builtins/complete.def
- the `helptopic' action now maps to CA_HELPTOPIC intead of CA_BUILTIN,
since there are more help topics than just builtins. Suggested by
Clark Wang <dearvoid@gmail.com>
4/12
----
print_cmd.c
- fix print_arith_for_command to add a call to PRINT_DEFERRED_HEREDOCS
before ending the body of the command, so heredocs get attached to
the right command instead of to the loop. From gentoo bug 363371
http://bugs.gentoo.org/show_bug.cgi?id=363371
execute_cmd.c
- change coproc_pidchk to unset the appropriate shell variables when
the (currently single) known coproc pid terminates
- cleanup and new functions to fully support multiple coprocesses when
and if I decide to go there
4/13
----
print_cmd.c
- fix print_group_command to add a call to PRINT_DEFERRED_HEREDOCS
after call to make_command_string_internal before printing closing
`}'
- fix make_command_string_internal to add a call to
PRINT_DEFERRED_HEREDOCS after recursive call to
make_command_string_internal in case cm_subshell before printing
closing `)'
4/14
----
print_cmd.c
- change overlapping strcpy in named_function_string to memmove
sig.h
- UNBLOCK_SIGNAL: convenience define, same as UNBLOCK_CHILD, just
restores an old signal mask
trap.c
- set_signal: instead of setting the signal handler to SIG_IGN while
installing the new trap handler, block the signal and unblock it
after the new handler is installed. Fixes bug reported by Roman
Rakus <rrakus@redhat.com>
4/15
----
doc/{bash.1,bashref.texi}
- make it clear that enabling monitor mode means that all jobs run in
separate process groups
4/18
----
builtins/fc.def
- update fix of 4/15/2010 to not take saved_command_line_count into
account when stepping down the history list to make sure that
last_hist indexes something that is valid. Fixes bug reported by
<piuma@piumalab.org>
4/19
----
builtins/fc.def
- fc_gethnum: make sure the calculation to decide the last history
entry is exactly the same as fc_builtin. Fixes bug uncovered by
fix of 4/18 to stop seg fault
4/22
----
lib/readline/terminal.c
- change _rl_enable_meta_key to set a flag indicating that it sent the
enable-meta sequence
- _rl_disable_meta_key: new function to turn off meta mode after we
turned it on with _rl_enable_meta_key
lib/readline/rlprivate.h
- extern declaration for _rl_disable_meta_key
configure.in
- if not cross-compiling, set CFLAGS_FOR_BUILD from any CFLAGS inherited
from the environment. Fixes HP/UX build problem reported by
"Daniel Richard G." <skunk@iSKUNK.ORG>
4/26
----
config-top.h
- define MULTIPLE_COPROCS to 0 so the code is still disabled but easy
to enable via configure option or editing this file
4/29
----
lib/sh/eaccess.c
- freebsd provides faccessat, with the same misfeature as their eaccess
and access implementations (X_OK returns true for uid==0 regardless
of the actual file permissions), so reorganize code to check the
file permissions as with eaccess. Report and fix from Johan Hattne
<johan.hattne@utsouthwestern.edu>
5/2
---
doc/{bash.1,bashref.texi}
- add forward reference to `Pattern Matching' from `Pathname
Expansion', suggested by Greg Wooledge <wooledg@eeg.ccf.org>
5/5
---
pcomplib.c
- the bash_completion project now distributes over 200 completions
for various programs, with no end in sight, so increase the value
of COMPLETE_HASH_BUCKETS from 32 to 128
pathexp.c
- quote_string_for_globbing: make sure CTLESC quoting CTLESC is
translated into \<CTLESC> even if the flags include QGLOB_REGEXP.
We don't want to process the second CTLESC as a quote character.
Fixes bug reported by Shawn Bohrer <sbohrer@rgmadvisors.com>
5/6
---
builtins/printf.def
- change PRETURN to not call fflush if ferror(stdout) is true
- if a call to one of the stdio functions or printstr leaves
ferror(stdout) true, and PRETURN is going to be called, let PRETURN
print the error message rather than doubling up the messages. Fixes
problem reported by Roman Rakus <rrakus@redhat.com>
5/9
---
doc/{bash.1,bashref.texi}
- add note to the effect that lists inside compound command can be
terminated by newlines as well as semicolons. Suggested by
Roman Byshko <rbyshko@gmail.com>
5/10
----
subst.c
- remove_quoted_nulls: fix problem that caused it to skip over the
character after a CTLNUL, which had the effect of skipping every
other of a series of CTLNULs. Fixes bug reported by
Marten Wikstrom <marten.wikstrom@keystream.se>
5/11
----
subst.c
- extract_process_subst: add SX_COMMAND flag to call to
extract_delimited_string, since we're expanding the same sort of
command as command substitution. Fixes bug reported in Ubuntu
bug 779848
5/12
----
configure.in
- set the prefer_shared and prefer_static variables appropriately
depending on the value of $opt_static_link
aclocal.m4
- AC_LIB_LINKFLAGS_BODY: change to not prefer shared versions of the
libraries it's searching for if the prefer_shared variable is "no".
Fixes problem reported by Cedric Arbogast <arbogast.cedric@gmail.com>
5/13
----
lib/readline/readline.c
- _rl_internal_teardown: add call to _rl_disable_meta_key to make the
meta key active only for the duration of the call to readline()
- _rl_internal_setup: move call to _rl_enable_meta_key here from
readline_initialize_everything so the meta key is active only for
the duration of the call to readline(). Suggestion from Miroslav
Lichvar <mlichvar@redhat.com>
builtins/help.def
- help_builtin: change strncmp to strcmp so that `help read' no longer
matches `readonly'. Suggested by Clark Wang <dearvoid@gmail.com>
config.h.in
- add define for GLIBC21, checked using jm_GLIBC21 as part of the tests
for libintl
lib/malloc/malloc.c
- internal_free: don't use the cached value of memtop when deciding
whether or not to adjust the break and give memory back to the kernel
when using the GNU C library, since glibc uses sbrk for its own
internal purposes. From Debian bug 614815, reported by Samuel
Thibault <samuel.thibault@gnu.org>
aclocal.m4
- BASH_STRUCT_WEXITSTATUS_OFFSET: change AC_RUN_IFELSE to AC_TRY_RUN
to avoid warning about not using AC_LANG_SOURCE
5/14
----
bashline.[ch]
- two new functions, bashline_set_event_hook and bashline_reset_event_hook,
to set rl_event_hook to bash_event_hook and back to NULL, respectively
- don't set rl_event_hook unconditionally
sig.c
- termsig_sighandler: if the shell is currently interactive and
readline is active, call bashline_set_event_hook to cause
termsig_handler to be called via bash_event_hook when the shell
returns from the signal handler
5/15
----
lib/readline/display.c
- _rl_col_width: Mac OS X has a bug in wcwidth: it does not return 0
for UTF-8 combining characters. Added workaround dependent on
MACOSX. Fixes problem pointed out by Thomas De Contes
<d.l.tDecontes@free.fr>
5/16
----
lib/readline/rlmbutil.h
- WCWIDTH: wrapper for wcwidth that returns 0 for Unicode combining
characters on systems where wcwidth is broken (e.g., Mac OS X).
lib/readline/{complete,display,mbutil}.c
- use WCWIDTH instead of wcwidth
5/17
----
lib/readline/display.c
- update_line: after computing ofd and nfd, see whether the next
character in ofd is a zero-width combining character. If it is,
back ofd and nfd up one, so the base characters no longer compare
as equivalent. Fixes problem reported by Keith Winstein
<keithw@mit.edu>
lib/readline/nls.c
- _rl_utf8locale: new flag variable, set to non-zero if the current
locale is UTF-8
- utf8locale(): new function, returns 1 if the passed lspec (or the
current locale) indicates that the locale is UTF-8. Called from
_rl_init_eightbit
lib/readline/rlprivate.h
- extern declaration for _rl_utf8locale
locale.c
- locale_utf8locale: new flag variable, set to non-zero if the current
locale is UTF-8 (currently unused)
- locale_isutf8(): new function, returns 1 if the passed lspec (or the
current locale) indicates that the locale is UTF-8. Should be called
whenever the locale or LC_CTYPE value is modified
aclocal.m4
- BASH_WCWIDTH_BROKEN: new test for whether or not wcwidth returns
zero-width characters like unicode combining characters as having
display length 1; define WCWIDTH_BROKEN in this case
config.h.in
- WCWIDTH_BROKEN: new define
lib/readline/rlmbutil.h
- change WCWIDTH macro to use _rl_utf8locale and the full range of
Unicode combining characters (U+0300-U+036F)
5/19
----
lib/readline/rlprivate.h
- _rl_search_context: new member, prevc, will hold character read
prior to lastc
lib/readline/isearch.c
- _rl_isearch_dispatch: if the character causes us to index into
another keymap, save that character in cxt->prevc
- _rl_isearch_dispatch: if we index into another keymap, but don't
find a function that's special to i-search, and the character that
caused us to index into that keymap would have terminated the
search, push back cxt->prevc and cxt->lastc to make it appear as
if `prevc' terminated the search, and execute lastc as a command.
We have to push prevc back so we index into the same keymap before
we read lastc. Fixes bug report from Davor Cubranic
<cubranic@stat.ubc.ca>
5/20
----
expr.c
- expr_bind_variable: pay attention to the return value from
bind_variable and check whether or not we should error out due to
a readonly or noassign variable. Fixes bug reported by Eric
Blake <eblake@redhat.com>
5/26
----
lib/readline/search.c
- include histlib.h for ANCHORED_SEARCH defines
- rl_history_search_flags: new variable, holds ANCHORED_SEARCH flag for
the duration of a history search
- rl_history_search_reinit: takes a new flags variable, defines whether
or not the search is anchored; assigned to rl_history_search_flags
- rl_history_serarch_reinit: if ANCHORED_SEARCH flag passed, add ^ to
beginning of search string; otherwise search string is unmodified
- rl_history_search_internal: set rl_point appropriately based on
whether or not rl_history_search_flags includes ANCHORED_SEARCH
- rl_history_substr_search_forward: new function, for non-anchored
substring search forward through history for string of characters
preceding rl_point
- rl_history_substr_search_backward: new function, for non-anchored
substring search backward through history for string of characters
preceding rl_point. Original code from Niraj Kulkarni
<kulkarniniraj14@gmail.com>
lib/readline/readline.h
- extern declarations for rl_history_substr_search_{for,back}ward
lib/readline/funmap.c
- history-substring-search-forward: new bindable command, invokes
rl_history_substr_search_forward
- history-substring-search-backward: new bindable command, invokes
rl_history_substr_search_backward
lib/readline/doc/{rluser.texi,readline.3}
- document history-substring-search-forward and
history-substring-search-backward
5/27
----
{nojobs,jobs}.c
- add support for DONT_REPORT_SIGTERM so that the shell doesn't print
a message when a job exits due to SIGTERM since that's the default
signal sent by the kill builtin. Suggested by Marc Herbert
<mark.herbert@gmail.com>
config-top.h
- DONT_REPORT_SIGTERM: new user-modifiable setting. Commented out
by default
5/28
----
lib/readline/bind.c
- _rl_skip_to_delim: skip to a closing double quote or other delimiter,
allowing backslash to quote any character, including the delimiter
- rl_parse_and_bind: call _rl_skip_to_delim instead of using inline
code
- rl_parse_and_bind: allow quoted strings as the values of string
variables. Variable values without double quotes have trailing
whitespace removed (which still allows embedded whitespace, for
better or worse). Fixes problem with string variables not matching
in `set' command if values happen to have trailing spaces or tabs
(debian bash bug #602762), but introduces slight incompatibility.
5/29
----
doc/{bash.1,bashref.texi}
- clarify unset description to specify that without options, a
variable, then a shell function if there is no variable by that
name, is unset. Fixes discrepancy reported by Mu Qiao
<qiaomuf@gentoo.org>
6/4
----
doc/{bash.1,bashref.texi}
- clarify description of LINES and COLUMNS (and checkwinsize shopt
option) to make it clear that only interactive shells set a
handler for SIGWINCH and update LINES and COLUMNS. Original
report submitted by Jonathan Nieder <jrnieder@gmail.com>
arrayfunc.c
- expand_compound_array_assignment: defer expansion of words between
parens when performing compound assignmnt to an associative array
variable
- assign_compound_array_list: perform the same expansions when doing
a compound array assignment to an associative array variable as
when doing a straight array index assignment. The idea is that
foo=( [ind1]=bar [ind2]=quux)
is the same as
foo[ind1]=bar ; foo[ind2]=quux
This fixes problems with double-expansion and quote removal being
performed on the array indices
6/13
----
doc/{bash.1,bashref.texi}
- Add a little text to make it clear that the locale determines how
range expressions in glob patterns are handled.
6/21
----
builtins/read.def
- display a message and return error status if -a is used with an
existing associative array. Fixes bug reported by Curtis Doty
<curtis@greenkey.net>
6/24
----
{jobs,nojobs}.c
- non-interactive shells now react to the setting of checkwinsize
and set LINES and COLUMNS after a foreground job exits. From a
suggestion by Leslie Rhorer <lrhorer@satx.rr.com>
doc/{bash.1,bashref.texi}
- checkwinsize: remove language saying that only interactive shells
check the window size after each command
lib/readline/histfile.c
- history_backupfile: new file, creates a backup history file name
given a filename (appending `-')
- history_do_write: when overwriting the history file, back it up
before writing. Restore backup file on a write error. Suggested
by chkno@chkno.net
bashline.c
- find_cmd_name: two new arguments, return the start and end of the
actual text string used to find the command name, without taking
whitespace into account
- attempt_shell_completion: small changes to make sure that completion
attempted at the beginning of a non-empty line does not find a
programmable completion, even if the command name starts at point
- attempt_shell_completion: small change to make sure that completion
does not find a progcomp when in whitespace before the command
name
- attempt_shell_completion: small change to make sure that completion
does not find a progcomp when point is at the first character of a
command name, even when there is leading whitespace (similar to
above). Fixes problems noted by Ville Skytta <ville.skytta@iki.fi>
subst.c
- brace_expand_word_list: since the individual strings in the strvec
returned by brace_expand are already allocated, don't copy them to
newly-allocated memory when building the WORD_LIST, just use them
intact
locale.c
- locale_mb_cur_max: cache value of MB_CUR_MAX when we set or change
the locale to avoid a function call every time we need to read it
shell.h
- new struct to save shell_input_line and associated variables:
shell_input_line_state_t
- add members of sh_parser_state_t to save and restore token and the
size of the token buffer
parse.y
- {save,restore}_input_line_state: new functions to save and restore
shell_input_line and associated variables
- {save,restore}_parser_state: add code to save and restore the token
and token buffer size
- xparse_dolparen: call save_ and restore_input_line_state to avoid
problems with overwriting shell_input_line when we recursively
call the parser to parse a command substitution. Fixes bug
reported by Rui Santos <rsantos@grupopie.com>
include/shmbutil.h
- use locale_mb_cur_max instead of MB_CUR_MAX in ADVANCE_CHAR and
similar macros
lib/glob/smatch.c
- rangecmp,rangecmp_wc: change to take an additional argument, which
forces the use of strcoll/wscoll when non-zero. If it's 0, a new
variable `glob_asciirange' controls whether or not we use strcoll/
wscoll. If glob_asciirange is non-zero, we use straight
C-locale-like ordering. Suggested by Aharon Robbins
<arnold@skeeve.com>
6/30
----
execute_cmd.c
- execute_pipeline: make sure the lastpipe code is protected by
#ifdef JOB_CONTROL. Fixes problem reported by Thomas Cort
<tcort@minix3.org>
7/2
---
lib/readline/complete.c
- EXPERIMENTAL: remove setting of _rl_interrupt_immediately around
completion functions that touch the file system. Idea from Jan
Kratochvil <jan.ktratochvil@redhat.com> and the GDB development
team
lib/readline/signals.c
- rl_signal_handler: if we're in callback mode, don't interrupt
immediately on a SIGWINCH
7/3
---
bashline.c
- set_directory_hook: and its siblings are a new set of functions to
set, save, and restore the appropriate directory completion hook
- change callers to use {set,save,restore}_directory_hook instead of
manipulating rl_directory_rewrite_hook directly
- dircomplete_expand: new variable, defaults to 0, if non-zero causes
directory names to be word-expanded during word and filename
completion
- change {set,save,restore}_directory_hook to look at dircomplete_expand
and change rl_directory_completion_hook or rl_directory_rewrite_hook
appropriately
bashline.h
- extern declaration for set_directory_hook so shopt code can use it
7/6
---
builtins/shopt.def
- globasciiranges: new settable shopt option, makes glob ranges act
as if in the C locale (so b no longer comes between A and B).
Suggested by Aharon Robbins <arnold@skeeve.com>
7/7
---
doc/{bash.1,bashref.texi}
- document new `globasciiranges' shopt option
7/8
---
builtins/shopt.def
- direxpand: new settable option, makes filename completion expand
variables in directory names like bash-4.1 did.
- shopt_set_complete_direxpand: new function, does the work for the
above by calling set_directory_hook
doc/{bash.1,bashref.texi}
- document new `direxpand' shopt option
7/15
----
lib/readline/isearch.c
- _rl_isearch_dispatch: when adding character to search string, use
cxt->lastc (which we use in the switch statement) instead of c,
since lastc can be modified earlier in the function
7/18
----
lib/readline/rlprivate.h
- _rl_search_context: add another member to save previous value of
(multibyte) lastc: pmb is to mb as prevc is to lastc
lib/readline/isearch.c:
- _rl_isearch_dispatch: if a key sequence indexes into a new keymap,
but doesn't find any bound function (k[ind].function == 0) or is
bound to self-insert (k[ind].function == rl_insert), back up and
insert the previous character (the one that caused the index into a
new keymap) and arrange things so the current character is the next
one read, so both of them end up in the search string. Fixes bug
reported by Clark Wang <dearvoid@gmail.com>
- _rl_isearch_dispatch: a couple of efficiency improvements when adding
characters to the isearch string
7/24
----
lib/readline/isearch.c
- _rl_isearch_dispatch: save and restore cxt->mb and cxt->pmb
appropriately when in a multibyte locale
doc/{bash.1,bashref.texi}
- correct description of {x}>file (and other redirection operators
that allocate a file descriptor) to note the the fd range is
greater than or equal to 10. Fixes problem reported by
Christian Ullrich
lib/readline/signals.c
- rl_signal_handler: don't interrupt immediately if in callback mode
lib/readline/callback.c
- rl_callback_read_char: install signal handlers only when readline
has control in callback mode, so readline's signal handlers aren't
called when the application is active (e.g., between the calls to
rl_callback_handler_install and rl_callback_read_char). If the
readline signal handlers only set a flag, which the application
doesn't know about, the signals will effectively be ignored until
the next time the application calls into the readline callback
interface. Fixes problem of calling unsafe functions from signal
handlers when in callback mode reported by Jan Kratochvil
<jan.kratochvil@redhat.com>
execute_cmd.c
- fix_assignment_words: when in Posix mode, the `command' builtin
doesn't change whether or not the command name it protects is an
assignment builtin. One or more instances of `command'
preceding `export', for instance, doesn't make `export' treat its
assignment statement arguments differently. Posix interpretation
#351
doc/{bash.1,bashref.texi}
- document new Posix-mode behavior of `command' when preceding builtins
that take assignment statements as arguments
builtins/printf.def
- printstr: if fieldwidth or precision are < 0 or > INT_MAX when
supplied explicitly (since we take care of the `-' separately),
clamp at INT_MAX like when using getint(). Fixes issue reported
by Ralph Coredroy <ralph@inputplus.co.uk>
7/25
----
lib/readline/chardefs.h
- isxdigit: don't define if compiling with c++; declared as a c++
template function. Fixes bug reported by Miroslav Lichvar
<mlichvar@redhat.com>
builtins/printf.def
- getint: if garglist == 0, return whatever getintmax returns (0).
Fixes bug reported by Ralph Coredroy <ralph@inputplus.co.uk>
7/28
----
doc/{bash.1,bashref.texi}
- minor changes to the descriptions of the cd and pushd builtins
lib/sh/zread.c
- zsyncfd: change variable holding return value from lseek to
off_t. Bug report and fix from Gregory Margo <gmargo@pacbell.net>
8/1
---
expr.c
- don't check for division by 0 when in a context where no evaluation
is taking place. Fixes bug reported by dnade.ext@orange-ftgroup.com
8/6
---
execute_cmd.c
- execute_command_internal: the parent branch of the subshell code
(where the child calls execute_in_subshell) should not close all
open FIFOs with unlink_fifo_list if it's part of a shell function
that's still executing. Fixes bug reported by Maarten Billemont
<lhunath@lyndir.com>
8/9
---
builtins/common.c
- get_exitstat: return EX_BADUSAGE (2) on a non-numeric argument
builtins/return.def
- return_builtin: just call get_exitstat to get the return status,
let it handle proper parsing and handling of arguments. Fixes
issue most recently raised by Linda Walsh <bash@tlinx.org>.
Reverses change from 9/11/2008 (see above)
8/16
----
doc/{bash.1,bashref.texi}
- clean up `set -e' language to make it clearer that any failure of
a compound command will cause the shell to exit, not just subshells
and brace commands
8/17
----
configure.in
- make the various XXX_FOR_BUILD variables `precious' to autoconf to
avoid stale data
- change how CC_FOR_BUILD is initialized when cross-compiling and not,
but do not change behavior
- initialize CFLAGS_FOR_BUILD to -g when cross-compiling
- initialize LIBS_FOR_BUILD to $(LIBS) when not cross-compiling, empty
when cross-compiling
- create AUTO_CFLAGS variable to hold basic CFLAGS defaults; used when
CFLAGS not inherited from environment (like effect of old
auto_cflags variable)
- substitute LIBS_FOR_BUILD into output Makefiles
[changes inspired by bug report from Nathan Phillip Brink
<ohnobinki@ohnopublishing.net> -- gentoo bug 378941]
builtins/Makefile.in
- substitute LIBS_FOR_BUILD from configure, not strictly initialized
to $(LIBS)
8/27
----
doc/{bash.1,bashref.texi}
- minor changes to the here string description to clarify the
expansions performed on the word
support/shobj-conf
- handle compilation on Lion (Mac OS X 10.7/darwin11) with changes
to darwin stanzas. Fixes readline bug reported by Vincent
Sheffer <vince.sheffer@apisphere.com>
lib/sh/strtrans.c
- ansic_wshouldquote: check a string with multi-byte characters for
characters that needs to be backslash-octal escaped for $'...'
- ansic_shouldquote: if is_basic fails for one character, let
ansic_wshouldquote examine the rest of the string and return what
it returns. From a patch sent by Roman Rakus <rrakus@redhat.com>
8/30
----
lib/sh/strtrans.c
- ansic_quote: changes to quote (or not) multibyte characters. New
code converts them to wide characters and uses iswprint to check
valid wide chars. From a patch sent by Roman Rakus
<rrakus@redhat.com>
9/7
---
lib/sh/shquote.c
- sh_backslash_quote: change to be table-driven so we can use a
different table if we want to
- sh_backslash_quote: takes a second char table[256] argument;
externs.h
- sh_backslash_quote: add second argument to function prototype
bashline.c,braces.c,parse.y,builtins/printf.def
- change callers of sh_backslash_quote to add second argument
bashline.c
- filename_bstab: table of characters to pass to sh_backslash_quote;
characters with value 1 will be backslash-quoted
- set_filename_bstab: turn on characters in filename backslash-quote
table according to passed string argument
- call set_filename_bstab every time rl_filename_quote_characters is
assigned a value
- bash_quote_filename: call sh_backslash_quote with filename_bstab
as second argument. This allows other characters in filenames to
be quoted without quoting, for instance, a dollar sign in a shell
variable reference
9/8
---
bashline.c
- complete_fullquote: new variable, controls table passed to
sh_backslash_quote. If non-zero (the default), the standard set
of shell metacharacters -- as in bash versions up to and including
bash-4.2 -- gets backslash-quoted by the completion code. If zero,
sh_backslash_quote gets the table with the characters in the
variable reference removed, which means they are removed from the
set of characters to be quoted in filenames
9/10
----
bashline.c
- bash_filename_stat_hook: new function, designed to expand variable
references in filenames before readline passes them to stat(2)
to determine whether or not they are a directory
9/15
----
builtins/declare.def
- if assign_array_element fails due to a bad (or empty) subscript, mark
it as an assignment error and don't attempt any further processing
of that declaration. Fixes segfault bug reported by Diego Augusto
Molina <diegoaugustomolina@gmail.com>
9/19
----
expr.c
- exppower: replace the simple exponentiation algorithm with an
implementation of exponentiation by squaring. Inspired by report
from Nicolas ARGYROU <nargy@yahoo.com>
bashline.c
- bash_quote_filename: check for rtext being non-null before
dereferencing it
- set_saved_history: operate_and_get_next assumes that the previous
line was added to the history, even when the history is stifled and
at the max number of entries. If it wasn't, make sure the history
number is incremented properly. Partial fix for bug reported by
gregrwm <backuppc-users@whitleymott.net>
doc/{bash.1,bashref.texi},lib/readline/doc/{hsuser,rluser}.texi
- minor editorial changes inspired by suggestions from
Roger Zauner <rogerx.oss@gmail.com>
9/20
----
lib/intl/localealias.c
- read_alias_file: close resource leak (fp) when returning on error
9/22
----
execute_command.c
- execute_intern_function: implement Posix interpretation 383 by making
it an error to define a function with the same name as a special
builtin when in Posix mode.
http://austingroupbugs.net/view.php?id=383#c692
9/25
----
doc/{bash.1,bashref.texi}
- formatting and some content changes from Benno Schulenberg
<bensberg@justemail.net>
- document new posix-mode behavior from interp 383 change of 9/22
9/30
----
execute_cmd.c
- shell_execve: add strerror to error message about executable file
that shell can't execute as a shell script. From suggestion by
daysleeper <daysleeper@centrum.cz>
10/1
----
bashhist.c
- maybe_add_history: act as if literal_history is set when parser_state
includes PST_HEREDOC, so we save the bodies of here-documents just
as they were entered. Fixes bug reported by Jonathan Wakely
<bugs@kayari.org>
- bash_add_history: make sure that the second and subsequent lines of
a here document don't have extra newlines or other delimiting
chars added, since they have the trailing newline preserved, when
`lithist' is set and history_delimiting_chars isn't called
execute_cmd.c
- execute_command_internal: avoid fd exhaustion caused by using
process substitution in loops inside shell functions by using
copy_fifo_list and close_new_fifos (). Fixes debian bash bug
642504
lib/readline/complete.c
- new variable, rl_filename_stat_hook, used by append_to_match. If
filename completion is desired, and rl_filename_stat_hook points
to a function, call that function to expand the filename in an
application-specific way before calling stat.
bashline.c
- bash_default_completion: if variable completion returns a single
match, use bash_filename_stat_hook and file_isdir to determine
whether or not the variable name expands to a directory. If it
does, set the filename_append_character to `/'. This is not
perfect, so we will see how it works out. Adds functionality
requested by Peter Toft <pto@linuxbog.dk> and Patrick Pfeifer
<patrick@pfeifer.de>
- rl_filename_stat_hook: assigned bash_filename_stat_hook, so things
like $HOME/Downloads (after completion) have a slash appended.
In general, this causes the stat hook to be called whenever
filename completion is appended. Adds functionality requested by
Patrick Pfeifer <patrick@pfeifer.de>
lib/readline/readline.h
- new extern declaration for rl_filename_stat_hook
lib/readline/doc/rltech.texi
- rl_directory_rewrite_hook: now documented
- rl_filename_stat_hook: document
pcomplete.c
- gen_action_completions: in the CA_DIRECTORY case, turn off
rl_filename_completion_desired if it was off before we called
rl_filename_completion_function and we didn't get any matches.
Having it on causes readline to quote the matches as if they
were filenames. Adds functionality requested by many,
including Clark Wang <dearvoid@gmail.com>
assoc.[ch]
- assoc_replace: new function, takes the same arguments as
assoc_insert, but returns the old data instead of freeing it
- assoc_insert: if the object returned by hash_insert doesn't have
the same value for its key as the key passed as an argument, we
are overwriting an existing value. In this case, we can free the
key. Fixes bug reported by David Parks <davidparks21@yahoo.com>
10/5
----
print_cmd.c
- indirection_level_string: small change to only re-enable `x'
option after calling decode_prompt_string if it was on before. In
normal mode, it will be, but John Reiser <jreiser@bitwagon.com>
has a novel use for that code in conjunction with a pre-loaded
shared library that traces system call usage in shell scripts
10/10
-----
Makefile.in
- Fix from Mike Frysinger <vapier@gentoo.org> to avoid trying to
build y.tab.c and y.tab.h with two separate runs of yacc if
parse.y changes. Problem with parallel makes
- Fix from Mike Frysinger <vapier@gentoo.org> to avoid subdirectory
builds each trying to make version.h (and all its dependencies)
lib/sh/Makefile.in
- remove some dependencies on version.h where it doesn't make sense
variables.c
- initialize_shell_variables: while reading the environment, a shell
running in posix mode now checks for SHELLOPTS being readonly (it
gets set early on in main()) before trying to assign to it. It
saves an error message and the variable gets parsed as it should.
Fixes bug reported by Len Giambrone <Len.Giambrone@intersystems.com>
10/14
-----
doc/{bash.1,bashref.texi}
- add to the "duplicating file descriptors" description that >&word
doesn't redirect stdout and stderr if word expands to `-'
- add to the "appending standard output and standard error"
description a note that >&word, where word is a number or `-',
causes other redirection operators to apply for sh and Posix
compatibility reasons. Suggested by Greg Wooledge
<wooledg@eeg.ccf.org>
10/15
-----
pcomplete.c
- change pcomp_filename_completion_function to only run the filename
dequoting function in the cases (as best as it can figure) where
readline won't do it via rl_filename_completion_function. Based
on reports from <lolilolicon@gmail.com>
10/19
-----
bashline.c
- attempt_shell_completion: add call to set_directory_hook() to make
sure the rewrite functions are correct. It's cheap and doesn't
hurt
- command_word_completion_function: if completing a command name that
starts with `.' or `..', temporarily suppress the effects of the
`direxpand' option and restore the correct value after calling
rl_filename_completion_function. If it's enabled, the directory
name will be rewritten and no longer match `./' or `../'. Fixes
problem reported by Michael Kalisz <michael@kalisz.homelinux.net>
10/22
-----
builtins/history.def
- push_history: make sure remember_on_history is enabled before we
try to delete the last history entry -- the `history -s' command
might not have been saved. Fixes bug reported by
lester@vmw-les.eng.vmware.com
lib/readline/complete.c
- rl_callback_read_char: add calls to a macro CALLBACK_READ_RETURN
instead of straight return; add same call at end of function.
Placeholder for future work in deinstalling signal handlers when
readline is not active
10/25
-----
expr.c
- exp2: catch arithmetic overflow when val1 == INTMAX_MIN and val2 == -1
for DIV and MOD and avoid SIGFPE. Bug report and pointer to fix
from Jaak Ristioja <jaak.ristioja@cyber.ee>
- expassign: same changes for arithmetic overflow for DIV and MOD
10/28
-----
subst.c
- parameter_brace_expand: allow pattern substitution when there is an
expansion of the form ${var/} as a no-op: replacing nothing with
nothing
- parameter_brace_patsub: don't need to check for PATSUB being NULL;
it never is
flags.c
- if STRICT_POSIX is defined, initialize history_expansion to 0, since
history expansion (and its treatment of ! within double quotes) is
not a conforming posix environment. From austin-group issue 500
lib/readline/histexpand.c
- history_expand: when processing a string within double quotes
(DQUOTE == 1), make the closing double quote inhibit history
expansion, as if the word were outside double quotes. In effect,
we assume that the double quote is followed by a character in
history_no_expand_chars. tcsh and csh seem to do this. This
answers a persistent complaint about history expansion
10/29
-----
make_cmd.c
- make_arith_for_command: use skip_to_delim to find the next `;'
when breaking the string between the double parens into three
separate components instead of a simple character loop. Fixes
bug reported by Dan Douglas <ormaaj@gmail.com>
11/2
----
Makefile.in
- make libbuiltins.a depend on builtext.h to serialize its creation
and avoid conflict between multiple invocations of mkbuiltins.
Fix from Mike Frysinger <vapier@gentoo.org>
11/5
----
findcmd.c
- user_command_matches: if stat(".", ...) returns -1, set st_dev
and st_ino fields in dotinfo to 0 to avoid same_file matches
- find_user_command_in_path: check stat(2) return the same way
lib/glob/glob.c
- glob_vector: don't call strlen(pat) without checking pat == 0
- glob_dir_to_array: make sure to free `result' and all allocated
members before returning error due to malloc failure
- glob_vector: make sure to free `nextname' and `npat' on errors
(mostly when setting lose = 1)
- glob_vector: if flags & GX_MATCHDIRS but not GX_ALLDIRS, make
sure we free `subdir'
- glob_filename: when expanding ** (GX_ALLDIRS), make sure we
free temp_results (return value from glob_vector)
lib/glob/xmbsrtowcs.c
- xdupmbstowcs: fix call to realloc to use sizeof (char *) instead
of sizeof (char **) when assigning idxtmp
execute_cmd.c
- print_index_and_element: return 0 right away if L == 0
- is_dirname: fix memory leak by freeing `temp'
- time_command: don't try to deref NULL `command' when assigning
to `posix_time'
- shell_execve: null-terminate `sample' after READ_SAMPLE_BUF so it's
terminated for functions that expect that
builtins/read.def
- read_builtin: don't call bind_read_variable with a potentially-null
string
pcomplete.c
- gen_command_matches: don't call dispose_word_desc with a NULL arg
- gen_compspec_completions: fix memory leak by freeing `ret' before
calling gen_action_completions (tcs, ...). happens when
performing directory completion as default and no completions
have been generated
- gen_progcomp_completions: make sure to set foundp to 0 whenever
returning NULL
- it_init_aliases: fix memory leak by freeing alias_list before
returning
bashline.c
- command_word_completion_function: don't call restore_tilde with a
NULL directory_part argument
- bash_directory_expansion: bugfix: don't throw away results of
rl_directory_rewrite_hook if it's set and returns non-zero
- bind_keyseq_to_unix_command: free `kseq' before returning error
arrayfunc.c
- assign_array_element_internal: make sure `akey' is freed if non-null
before returning error
- assign_compound_array_list: free `akey' before returning error
- array_value_internal: free `akey' before returning error
- unbind_array_element: free `akey' before returning error
subst.c
- array_length_reference: free `akey' before returning error in case
of expand_assignment_string_to_string error
- array_length_reference: free `akey' after call to assoc_reference
- skip_to_delim: if skipping process and command substitution, free
return value from extract_process_subst
- parameter_brace_substring: free `val' (vtype == VT_VARIABLE) before
returning if verify_substring_values fails
- parameter_brace_expand: remove two duplicate lines that allocate
ret in parameter_brace_substring case
- parameter_brace_expand: convert `free (name); name = xmalloc (...)'
to use `xrealloc (name, ...)'
- parameter_brace_expand: free `name' before returning when handling
${!PREFIX*} expansion
- split_at_delims: fix memory leak by freeing `d2' before returning
redir.c
- redirection_error: free `filename' if the redirection operator is
REDIR_VARASSIGN by assigning allocname
eval.c
- send_pwd_to_eterm: fix memory leak by freeing value returned by
get_working_directory()
builtins/cd.def
- change_to_directory: fix memory leak by freeing return value from
resetpwd()
- cd_builtin: fix memory leak by freeing value returned by dirspell()
- cd_builtin: fix memory leak by freeing `directory' if appropriate
before overwriting with return value from resetpwd()
builtins/type.def
- describe_command: free `full_path' before overwriting it with return
value from sh_makepath
builtins/complete.def
- compgen_builtin: fix memory leak by calling strlist_dispose (sl)
before overwriting sl with return value from completions_to_stringlist
builtins/hash.def
- list_hashed_filename_targets: fix memory leak by freeing `target'
make_cmd.c
- make_arith_for_command: free `init', `test', and `step' before
returning error on parse error
jobs.c
- initialize_job_control: don't call move_to_high_fd if shell_tty == -1
general.c
- check_dev_tty: don't call close with an fd < 0
- legal_number: deal with NULL `string' argument, return invalid
lib/sh/fmtulong.c
- fmtulong: if the `base' argument is invalid, make sure we index
buf by `len-1' at maximum
print_cmd.c
- print_deferred_heredocs: don't try to dereference a NULL `cstring'
- cprintf: make sure to call va_end (args)
variables.c
- push_dollar_vars: fix call to xrealloc to use sizeof (WORD_LIST *)
instead of sizeof (WORD_LIST **)
lib/sh/zmapfd.c
- zmapfd: if read returns error, free result and return -1 immediately
instead of trying to reallocate it
11/6
----
execute_cmd.c
- cpl_reap: rewrote to avoid using pointer after freeing it; now builds
new coproc list on the fly while traversing the old one and sets the
right values for coproc_list when done
11/12
-----
builtins/set.def
- if neither -f nor -v supplied, don't allow a readonly function to
be implicitly unset. Fixes bug reported by Jens Schmidt
<jens.schmidt35@arcor.de>
lib/readline/callback.c
- change CALLBACK_READ_RETURN to clear signal handlers before returning
from rl_callback_read_char so readline's signal handlers aren't
installed when readline doesn't have control. Idea from Jan
Kratochvil <jan.ktratochvil@redhat.com> and the GDB development
team
pcomplete.h
- COPT_NOQUOTE: new complete/compgen option value
builtins/complete.def
- noquote: new complete/compgen option; will be used to disable
filename completion quoting
pcomplete.c
- pcomp_set_readline_variables: pay attention to COPT_NOQUOTE; turns
of rl_filename_quoting_desired if set; turns it on if unset (value
is inverted, since default is on)
doc/bash.1,lib/readline/doc/rluser.texi
- document new -o noquote option to complete/compgen/compopt
pathexp.c
- quote_string_for_globbing: if QGLOB_REGEXP, make sure characters
between brackets in an ERE bracket expression are not inappropriately
quoted with backslashes. This is a pretty substantial change,
should be stressed when opening bash up for alpha and beta tests.
Fixes bug pointed out by Stephane Chazleas
<stephane_chazelas@yahoo.fr>
doc/{bash.1,bashref.texi}
- document that regexp matches can be inconsistent when quoting
characters in bracket expressions, since usual quoting characters
lose their meaning within brackets
- note that regular expression matching when the pattern is stored
in a shell variable which is quoted for expansion causes string
matching
redir.h
- RX_SAVEFD: new flag value; notes that a redirection denotes an
fd used to save another even if it's not >= SHELL_FD_BASE
redir.c
- do_redirection_internal: when deciding whether or not to reset the
close-on-exec flag on a restored file descriptor, trust the value
of redirect->flags & RX_SAVCLEXEC even if the fd is < SHELL_FD_BASE
if the RX_SAVEFD flag is set
- add_undo_redirect: set the RX_SAVEFD flag if the file descriptor
limit is such that the shell can't duplicate to a file descriptor
>= 10. Fixes a limitation that tripped a coreutils test reported
by Paul Eggert <eggert@cs.ucla.edu>
11/19
-----
doc/{bash.1,bashref.texi},lib/readline/doc/hsuser.texi
- make it clear that bash runs HISTFILESIZE=$HISTSIZE after reading
the startup files
- make it clear that bash runs HISTSIZE=500 after reading the
startup files
- make it clear that setting HISTSIZE=0 causes commands to not be
saved in the history list
- make it clear that setting HISTFILESIZE=0 causes the history file
to be truncated to zero size
variables.c
- sv_histsize: change so setting HISTSIZE to a value less than 0
causes the history to be `unstifled'
- sv_histsize: change so setting HISTFILESIZE to a value less than 0
results in no file truncation
- make it clear that numeric values less than 0 for HISTFILESIZE or
HISTSIZE inhibit the usual functions
11/23
-----
parse.y
- save_input_line_state: add missing `return ls' at the end, since the
function is supposed to return its argument. Pointed out by
Andreas Schwab <schwab@linux-m68k.org>
builtins/read.def
- skip over NUL bytes in input, as most modern shells seem to. Bug
report by Matthew Story <matt@tablethotels.com>
lib/readline/vi_mode.c
- rl_vi_replace: set _rl_vi_last_key_before_insert to invoking key
11/25
-----
builtins/read.def
- read_builtin: if xrealloc returns same pointer as first argument,
don't bother with the remove_unwind_protect/add_unwind_protect pair
- read_builtin: set a flag (`reading') around calls to zread/zreadc
and readline()
- sigalrm: change to set flag (`sigalrm_seen') and only longjmp if
currently in read(2) (reading != 0)
- CHECK_ALRM: new macro, checks sigalrm_seen and longjmps if non-zero,
behavior of old SIGALRM catching function
- read_builtin: call CHECK_ALRM in appropriate places while reading
line of input. Fixes bug reported by Pierre Gaston
<pierre.gaston@gmail.com>
lib/readline/vi_mode.c
- rl_vi_replace: initialize characters before printing characters in
vi_replace_keymap to their default values in vi_insertion_keymap,
since we're supposed to be in insert mode replacing characters
- rl_vi_replace: call rl_vi_start_inserting to set last command to
`R' for undo
- rl_vi_replace: set _rl_vi_last_key_before_insert to `R' for future
use by _rl_vi_done_inserting
- vi_save_insert_buffer: new function, broke out code that copies text
into vi_insert_buffer from _rl_vi_save_insert
- _rl_vi_save_replace: new function, saves text modified by
rl_vi_replace (using current point and vi_replace_count to figure
it out) to vi_replace_buffer
- _rl_vi_save_insert: call vi_save_insert_buffer
- _rl_vi_done_inserting: if _rl_vi_last_key_before_insert == 'R', call
_rl_vi_save_replace to save text modified in replace mode (uses
vi_save_insert_buffer)
- _rl_vi_replace_insert: new function, replaces the number of chars
in vi_insert_buffer after rl_point with contents ov vi_insert_buffer
- rl_vi_redo: call _rl_vi_replace_insert if last command == 'R' and
there's something in vi_insert_buffer. Fixes bug with `.' not
redoing the most recent `R' command, reported by Geoff Clare
<g.clare@opengroup.org> in readline area on savannah
11/26
-----
lib/readline/rlprivate.h
- RL_SIG_RECEIVED(): evaluate to non-zero if there is a pending signal
to be handled
- RL_SIGINT_RECEIVED(): evaluate to non-zero if there is a pending
SIGINT to be handled
lib/readline/complete.c
- remove all mention of _rl_interrupt_immediately
- rl_completion_matches: check RL_SIG_RECEIVED after each call to
the entry function, call RL_CHECK_SIGNALS if true to handle the
signal
- rl_completion_matches: if RL_SIG_RECEIVED evaluates to true, free
and zero out the match_list this function allocated
- rl_completion_matches: if the completion entry function is
rl_filename_completion_function, free the contents of match_list,
because that function does not keep state and will not free the
entries; avoids possible memory leak pointed out by
Garrett Cooper <yanegomi@gmail.com>
- gen_completion_matches: if RL_SIG_RECEIVED evalutes to true after
calling rl_attempted_completion_function, free the returned match
list and handle the signal with RL_CHECK_SIGNALS; avoids
possible memory leak pointed out by Garrett Cooper
<yanegomi@gmail.com>
- gen_completion_matches: if RL_SIG_RECEIVED evaluates to true after
calling rl_completion_matches, free the returned match list and
handle the signal with RL_CHECK_SIGNALS
lib/readline/util.c
- rl_settracefp: new utility function to set the tracing FILE *
lib/readline/signals.c
- _rl_sigcleanup: pointer to a function that will be called with the
signal and a void * argument from _rl_handle_signal
- _rl_sigcleanarg: void * that the rest of the code can set to have
passed to the signal cleanup function
- _rl_handle_signal: if _rl_sigcleanup set, call as
(*_rl_sigcleanup) (sig, _rl_sigcleanarg)
lib/readline/rlprivate.h
- extern declarations for _rl_sigcleanup and _rl_sigcleanarg
lib/readline/complete.c
- _rl_complete_sigcleanup: signal cleanup function for completion code;
calls _rl_free_match_list on _rl_sigcleanarg if signal == SIGINT
- rl_complete_internal: before calling display_matches if what_to_do
== `?', set _rl_sigcleanup to _rl_complete_sigcleanup so the match
list gets freed on SIGINT; avoids possible memory leak pointed out
by Garrett Cooper <yanegomi@gmail.com>
- rl_complete_internal: in default switch case, call _rl_free_match_list
before returning to avoid memory leak
doc/bashref.texi
- start at a set of examples for the =~ regular expression matching
operator, touching on keeping the pattern in a shell variable and
quoting portions of the pattern to remove their special meaning
12/1
----
lib/glob/gmisc.c
- extglob_pattern: new function, returns 1 if pattern passed as an
argument looks like an extended globbing pattern
lib/glob/glob.c
- skipname: return 0 immediately if extglob_pattern returns non-zero,
let the extended globbing code do the right thing with skipping
names beginning with a `.'
- mbskipname: return 0 immediately if extglob_pattern returns non-zero,
let the extended globbing code do the right thing with skipping
names beginning with a `.'. Fixes bug reported by Yongzhi Pan
<panyongzhi@gmail.com>
12/2
----
lib/glob/smatch.c
- patscan, patscan_wc: no longer static so other parts of the glob
library can use them, renamed to glob_patscan, glob_patscan_wc
lib/glob/glob.c
- extern declarations for glob_patscan, glob_patscan_wc
- wchkname: new function, does skipname on wchar_t pattern and dname,
old body of mbskipname after converting to wide chars
- extglob_skipname: new function, checks all subpatterns in an extglob
pattern to determine whether or not a filename should be skipped.
Calls skipname for each subpattern. Dname is only skipped if all
subpatterns indicate it should be. Better fix for bug reported by
Yongzhi Pan <panyongzhi@gmail.com>
- wextglob_skipname: wide-char version of extglob_skipname, calls
wchkname instead of calling back into mbskipname for each
subpattern to avoid problems with char/wchar_t mismatch
- skipname: call extglob_skipname if extglob_pattern returns non-zero
- mbskipname: call wextglob_skipname if extglob_pattern returns non-zero
- mbskipname: short-circuit immediately if no multibyte chars in
pattern or filename
execute_cmd.c
- execute_cond_node: added parens to patmatch assignment statement to
make intent clearer
12/3
----
configure.in,config.h.in
- check for imaxdiv, define HAVE_IMAXDIV if present
expr.c
- expassign, exp2: use imaxdiv if available. Doesn't help with checks
for overflow from 10/25
12/6
----
lib/readline/complete.c
- compute_lcd_of_matches: if we're ignoring case in the matches, only
use what the user typed as the lcd if it matches the first match
(after sorting) up to the length of what was typed (if what the
user typed is longer than the shortest of the possible matches, use
the shortest common length of the matches instead). If it doesn't
match, use the first of the list of matches, as if case were not
being ignored. Fixes bug reported by Clark Wang
<dearvoid@gmail.com>
12/7
----
builtins/cd.def
- cd_builtin: add code to return error in case cd has more than one
non-option argument, conditional on CD_COMPLAINS define (which is
not defined anywhere)
doc/{bash.1,bashref.texi}
- note that additional arguments to cd following the directory name
are ignored. Suggested by Vaclav Hanzl <hanzl@noel.feld.cvut.cz>
12/10
-----
lib/readline/input.c
- rl_read_key: don't need to increment key sequence length here; doing
it leads to an off-by-one error
lib/readline/macro.c
- rl_end_kbd_macro: after off-by-one error with rl_key_sequence_length
fixed, can decrement current_macro_index by rl_key_sequence_length
(length of key sequence that closes keyboard macro)
lib/readline/readline.c
- _rl_dispatch_subseq: fix extra increment of rl_key_sequence_length
when ESC maps to a new keymap and we're converting meta characters
to ESC+key
- _rl_dispatch_subseq: better increment of rl_key_sequence_length
before we dispatch to a function in the ISFUNC case (where the
second increment above should have happened)
- rl_executing_keyseq: the full key sequence that ended up executing
a readline command. Available to the calling application, maintained
by _rl_dispatch_subseq, indexed by rl_key_sequence_length
- rl_executing_key: the key that was bound to the currently-executing
readline command. Same as the `key' argument to the function
lib/readline/readline.h
- rl_executing_keyseq: extern declaration
- rl_executing_key: extern declaration
- rl_key_sequence_length: declaration moved here from rlprivate.h,
now part of public interface
lib/readline/rlprivate.h
- new extern declaration for _rl_executing_keyseq_size, buffer size
for rl_executing_keyseq
lib/readline/doc/rltech.texi
- documented new variables: rl_executing_key, rl_executing_keyseq,
rl_key_sequence_length
12/13
-----
bashline.c
- bash_execute_unix_command: replace ad-hoc code that searches
cmd_xmap for correct command with call to rl_function_of_keyseq
using rl_executing_keyseq; now supports key sequences longer
than two characters. Fixes bug reported by Michael Kazior
<kazikcz@gmail.com>
12/15
-----
make_cmd.c
- make_function_def: don't null out source_file before calling
make_command so it can be used later on when the function definition
is executed
execute_cmd.c
- execute_intern_function: second argument is now FUNCTION_DEF *
instead of COMMAND *
- execute_command_internal: call execute_intern_function with the
new second argument (the entire FUNCTION_DEF instead of just the
command member)
- execute_intern_function: if DEBUGGER is defined, call
bind_function_def before calling bind_function, just like
make_function_def does (might be able to take out the call in
make_function_def depending on what the debugger does with it).
Fixes bug reported by <dethrophes@motd005>
expr.c
- more minor changes to cases of INTMAX_MIN % -1 and INTMAX_MIN / 1;
fix typos and logic errors
12/16
-----
bashline.c
- find_cmd_start: change flags to remove SD_NOSKIPCMD so it skips over
command substitutions and doesn't treat them as command separators
- attempt_shell_completion: instead of taking first return from
find_cmd_name as command name to use for programmable completion,
use loop to skip over assignment statements. Fixes problem reported
by Raphael Droz <raphael.droz+floss@gmail.com>
- attempt_shell_completion: if we don't find a command name but the
command line is non-empty, assume the other words are all assignment
statements and flag that point is in a command position so we can
do command name completion
- attempt_shell_completion: if the word being completed is the first
word following a series of assignment statements, and the
command line is non-empty, flag that point is in a command position
so we can do command name completion
lib/readline/history.c
- history_get_time: atol -> strtol
12/18
-----
parse.y
- parser_in_command_position: external interface to the
command_token_position macro for use by other parts of the shell,
like the completion mechanism
externs.h
- extern declaration for parser_in_command_position
12/19
-----
builtins/read.def
- read_builtin: make sure all calls to bind_read_variable are passed
a non-null string. Fixes bug reported by Dan Douglas
<ormaaj@gmail.com>
bashline.c
- attempt_shell_completion: mark that we're in a command position if
we're at the start of the line and the parser is ready to accept
a reserved word or command name. Feature most recently suggested
by Peng Yu <pengyu.ut@gmail.com>
12/21
-----
lib/readline/bind.c
- _rl_escchar: return the character that would be backslash-escaped
to denote the control character passed as an argument ('\n' -> 'n')
- _rl_isescape: return 1 if character passed is one that has a
backslash escape
- _rl_untranslate_macro_value: new second argument: use_escapes, if
non-zero translate to backslash escapes where possible instead of
using straight \C-x for control character `x'. Change callers
- _rl_untranslate_macro_value: now global
lib/readline/rlprivate.h
- _rl_untranslate_macro_value: extern declaration
lib/readline/{macro.c,readline.h}
- rl_print_last_kbd_macro: new bindable function, inspired by patch
from Mitchel Humpherys
lib/readline/funmap.c
- print-last-kbd-macro: new bindable command, bound to
rl_print_last_kbd_macro
lib/readline/doc/{rluser.texi,readline.3},doc/bash.1
- print-last-kbd-macro: document.
lib/readline/text.c
- _rl_insert_next: if we're defining a macro, make sure the key gets
added to the macro text (should really audit calls to rl_read_key()
and make sure the right thing is happening for all of them)
bashline.[ch]
- print_unix_command_map: new function, prints all bound commands in
cmd_xmap using rl_macro_dumper in a reusable format
builtins/bind.def
- new -X option: print all keysequences bound to Unix commands using
print_unix_command_map. Feature suggested by Dennis Williamson
(2/2011)
doc/{bash.1,bashref.texi}
- document new `bind -X' option
12/24
-----
doc/{bash.1,bashref.texi}
- add a couple of sentences to the description of the case modification
operators making it clearer that each character of parameter is
tested against the pattern, and that the pattern should only attempt
to match a single character. Suggested by Bill Gradwohl
<bill@ycc.com>
12/28
-----
shell.c
- init_noninteractive: instead of calling set_job_control(0) to
unconditionally turn off job control, turn on job control if
forced_interactive or jobs_m_flag is set
- shell_initialize: call initialize_job_control with jobs_m_flag as
argument so `bash -m script' enables job control while running the
script
jobs.c
- initialize_job_control: if the `force' argument is non-zero, turn on
job control even if the shell is not currently interactive
(interactive == 0)
12/29
-----
flags.h
- new extern declaration for jobs_m_flag
builtins/{cd,set}.def,doc/{bash.1,bashref.texi}
- added text clarifying the descriptions of cd -L and -P, suggested by
Padraig Brady <p@draigbrady.com>
- slight change to the description of `set -P' about resolving symbolic
links
lib/readline/doc/rluser.texi
- Added an example to the programmable completion section: _comp_cd,
a completion function for cd, with additional verbiage. Text
includes a reference to the bash_completion project
1/1/2012
--------
jobs.c
- set_job_status_and_cleanup: note that a job is stopped due to
SIGTSTP (any_tstped) if job_control is set; there's no need to
test interactive
1/5
---
quit.h
- LASTSIG(): new macro, expands to signal number of last terminating
signal received (terminating_signal or SIGINT)
trap.c
- first_pending_trap: returns lowest signal number with a trap pending
- trapped_signal_received: set to the last trapped signal the shell
received in trap_handler(); reset to 0 in run_pending_traps
builtins/read.def
- read_builtin: changes to posix-mode (posixly_correct != 0) to make
`read' interruptible by a trapped signal. After the trap runs,
read returns 128+sig and does not assign the partially-read line
to the named variable(s). From an austin-group discussion started
by David Korn
1/11
----
doc/{bash.1,bashref.texi}
- slight changes to the descriptions of the compat32 and compat40 shell
options to clarify their meaning
1/12
----
lib/readline/{colors.[ch],parse-colors.[ch]}
- new files, part of color infrastructure support
Makefile.in,lib/readline/Makefile.in
- arrange to have colors.o and parse-colors.o added to readline
library
{configure,config.h}.in
- check for stdbool.h, define HAVE_STDBOOL_H if found
1/14
----
lib/readline/bind.c
- colored_stats: new bindable variable, enables using colors to
indicate file type when listing completions
lib/readline/complete.c
- _rl_colored_stats: new variable, controlled by colored-stats bindable
variable
- colored_stat_start, colored_stat_end: new functions to set and reset
the terminal color appropriately depending on the type of the
filename to be printed
- print_filename: changes to print colors if `colored-stats' variable
set. Changes contributed by Raphael Droz
<raphael.droz+floss@gmail.com>
lib/readline/readline.c
- rl_initialize_everything: add call to _rl_parse_colors to parse
color values out of $LS_COLORS. May have to add to rl_initialize
to make more dynamic if LS_COLORS changes (which doesn't happen
very often, if at all)
lib/readline/rlprivate.h
- _rl_colored_stats: new extern declaration
lib/readline/doc/{readline.3,rluser.texi},doc/bash.1
- colored-stats: document new bindable readline variable
lib/readline/colors.c
- _rl_print_color_indicator: call rl_filename_stat_hook before calling
lstat/stat so we can get color indicators for stuff like
$HOME/Applications
lib/readline/complete.c
- stat_char: call rl_filename_stat_hook before calling lstat/stat
findcmd.[ch],execute_cmd.c
- search_for_command: now takes a second `flags' argument; changed
header function prototype and callers
- search_for_command: if (flags & 1), put the command found in $PATH
into the command hash table (previous default behavior)
execute_cmd.c
- is_dirname: call search_for_command with flags argument of 0 so it
doesn't try to put something in the command hash table
bashline.c
- bash_command_name_stat_hook: a hook function for readline's
filename_stat_hook that does $PATH searching the same way that
execute_cmd.c:execute_disk_command() does it, and rewrites the
passed filename if found. Does not put names into command hash
table. This allows command name completion to take advantage
of `visible-stats' and `colored-stats' settings.
- executable_completion: new function, calls the directory completion
hook to expand the filename before calling executable_file or
executable_or_directory; change command_word_completion_function to
call executable_completion. This allows $HOME/bin/[TAB] to do
command completion and display alternatives
1/17
----
pcomplete.c
- gen_command_matches: now takes a new second argument: the command
name as deciphered by the programmable completion code and used
to look up the compspec; changed callers (gen_compspec_completions)
- gen_shell_function_matches: now takes a new second argument: the
command that originally caused the completion function to be
invoked; changed callers (gen_compspec_completions))
- build_arg_list: now takes a new second argument: the command name
corresponding to the current compspec; changed callers
(gen_command_matches, gen_shell_function_matches)
- build_arg_list: now uses `cmd' argument to create $1 passed to
invoked command or shell function
- gen_compspec_completions: if we skipped a null command at the
beginning of the line (e.g., for completing `>'), add a new word for
it at the beginning of the word list and increment nw and cw
appropriately. This is all a partial fix for the shortcoming
pointed out by Sung Pae <sungpae@gmail.com>
1/18
----
{configure,config.h}.in
- new check: check for AUDIT_USER_TTY defined in <linux/audit.h>,
define HAVE_DECL_AUDIT_USER_TTY if both are found
lib/readline/rlconf.h
- ENABLE_TTY_AUDIT_SUPPORT: new define, allows use of the Linux kernel
tty auditing system if it's available and enabled
lib/readline/util.c
- _rl_audit_tty: new function, send a string to the kernel tty audit
system
lib/readline/rlprivate.h
- _rl_audit_tty: new extern declaration
lib/readline/readline.c
- readline: call _rl_audit_tty with line to be returned before returning
it if the Linux tty audit system is available and it's been enabled
in rlconf.h Original patch from Miroslav Trmac; recent request
from Miroslav Lichvar <mlichvar@redhat.com>
1/21
----
lib/readline/readline.c:
- _rl_dispatch_subseq: add an inter-character timeout for multi-char
key sequences. Suggested by <rogerx.oss@gmail.com>. Still needs
work to make a user-settable variable
parse.y
- shell_getc: make code that uses the pop_alias dependent on ALIAS
define
variables.h
- sv_tz: extern define should only depend on HAVE_TZSET
expr.c
- expr_streval: if ARRAY_VARS is not defined, set lvalue->ind to -1;
move assignment to `ind' inside define
- expr_bind_array_element: declaration and uses need to be #ifdef
ARRAY_VARS
arrayfunc.h
- AV_ALLOWALL, AV_QUOTED, AV_USEIND: define to 0 if ARRAY_VARS not
defined; used in subst.c unconditionally
sig.h
- make the signal blocking functions not dependent on JOB_CONTROL
sig.c
- sigprocmask: make the replacement definition not dependent on
JOB_CONTROL
trap.c
- use BLOCK_SIGNAL/UNBLOCK_SIGNAL instead of code dependent on
HAVE_POSIX_SIGNALS and BSD signals
1/24
----
print_cmd.c
- print_redirection_list: change the conditions under which
r_duplicating_output_word is mapped to r_err_and_out to more or
less match those used in redir.c. Fixes bug pointed out by
Dan Douglas <ormaaj@gmail.com>
1/29
----
lib/readline/signals.c
- _rl_block_sigwinch,_rl_release_sigwinch: don't compile in bodies
unless SIGWINCH is defined. Fixes bug reported by Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr>
doc/{bash.1,bashref.texi}
- small modifications to the introduction to the REDIRECTION section
to describe how redirections can modify file handles
- small modification to the section describing base#n to make it
clearer that n can be denoted using non-numerics. From a posting
by Linda Walsh <bash@tlinx.org>
2/2
---
builtins/printf.def
- printf_builtin: make sure vbuf is intialized and non-null when -v
is supplied, since other parts of the code assume that it's not
null (e.g., bind_printf_variable()). Fixes bug reported by Jim
Avera <james_avera@yahoo.com>
2/4
---
lib/readline/undo.c
- _rl_free_undo_list: new function, old body of rl_free_undo_list,
frees undo entries in UNDO_LIST * passed as argument
- rl_free_undo_list: call _rl_free_undo_list
lib/readline/rlprivate.h
- _rl_free_undo_list: new extern declaration
- _rl_keyseq_timeout: new extern declaration (see below)
lib/readline/misc.c
- rl_clear_history: new function. Clears the history list and frees
all associated data similar to history.c:clear_history(), but
takes rl_undo_list into account and frees and UNDO_LISTs saved as
`data' members of a history list entry
lib/readline/doc/rltech.texi
- rl_clear_history: documented
lib/readline/readline.c
- _rl_keyseq_timeout: new variable to hold intra-key timeout value
from 1/21 fix; specified in milliseconds. Default value is 500
- _rl_dispatch_subseq: change to use _rl_keyseq_timeout as intra-key
timeout if it's greater than 0; no timeout if <= 0
- _rl_dispatch_subseq: don't check for queued keyboard input if we have
pushed or pending input, or if we're reading input from a macro
lib/readline/bind.c
- keyseq-timeout: new bindable variable, shadows _rl_keyseq_timeout
- string_varlist: add keyseq-timeout
- sv_seqtimeout: new function to modify value of _rl_keyseq_timeout;
clamps negative values at 0 for now
- _rl_get_string_variable_value: return value for keyseq-timeout
doc/bash.1,lib/readline/doc/{rluser.texi,readline.3}
- keyseq-timeout: documented
lib/readline/isearch.c
- _rl_isearch_dispatch: modification to fix from 7/18 to not use
cxt->keymap and cxt->okeymap, since by the time this code is
executed, they are equal. Use `f' to check for rl_insert or
unbound func
- _rl_isearch_dispatch: if we're switching keymaps, not in
callback mode, and don't have pending or pushed input, use
_rl_input_queued to resolve a potentially ambiguous key sequence.
Suggested by Roger Zauner <rogerx.oss@gmail.com>
- _rl_isearch_dispatch: if we have changed keymaps and resolved to
an editing function (not self-insert), make sure we stuff the
right characters back onto the input after changing the keymap
back so the right editing function is executed after the search
is terminated. Rest of fix for bug reported by Roger Zauner
<rogerx.oss@gmail.com>
2/5
---
builtins/gen-helpfiles.c
- new file: reads struct builtin and writes the long docs to files
in the `helpdirs' subdirectory. The filename is given in the
previously-unused `handle' member of the struct builtin. Links
with `tmpbuiltins.o', which is created by Makefile to have the
right long documentation. When not cross-compiling, gets the
right #defines based on configuration options from config.h instead
of trying to parse conditional parts of def files. Fixes
shortcoming pointed out by Andreas Schwab <schwab@linux-m68k.org>
builtins/Makefile.in
- tmpbuiltins.c: new generated file, created to enable creation of
separate helpfiles based on correct #defines instead of trying to
parse conditional parts of def files
- gen-helpfiles: new program to generate helpfiles, links with
tmpbuiltins.o
- HELPFILES_TARGET: new target, substituted by configure to `helpdoc'
if separate helpfiles requested
- targets: new target, libbuiltins.a and $(HELPFILES_TARGET)
- CREATED_OBJECTS: new variable, holds created object files for
make clean; changed make clean to remove created objects
- helpdoc: changed to call gen-helpfiles instead of mkbuiltins
Makefile.in
- when building libbuiltins.a, recursively call make with `targets'
argument to make sure separate helpfiles get built
configure.in
- substitute `helpdoc' as value of HELPFILES_TARGET if
--enable-separate-helpfiles supplied as configure argument
builtins/mkbuiltins.c
- `-nofunctions': new argument, causes mkbuiltins to not write value
for function implementing a particular builtin to struct builtin
and to write document file name to `handle' member of struct builtin
- no longer writes separate helpfiles; that is left to gen-helpfiles
2/8
---
subst.c
- make sure last_command_exit_value is set to a non-zero value before
any calls to report_error, since `-e' set will short-circuit
report_error. Fixes bug reported by Ewan Mellor
<Ewan.Mellor@eu.citrix.com>
variables.c
- make_local_array_variable: added second argument; if non-zero,
function will return an existing local associative array variable
instead of insisting on an indexed array
variable.h,subst.c
- make_local_array_variable: changed prototype and caller
builtins/declare.def
- declare_internal: add second arg to call to make_local_array_variable;
making_array_special, which indicates we're processing an
assignment like declare a[b]=c. Fixes seg fault resulting from
a being an already-declared local associative array variable in a
function. Ubuntu bash bug 928900.
2/14
----
execute_cmd.c
- execute_command_internal: if redirections into or out of a loop fail,
don't try to free ofifo_list unless saved_fifo is non-zero. It's
only valid if saved_fifo is set
2/15
----
{arrayfunc,braces,variables}.c
- last_command_exit_value: make sure it's set before any calls to
report_error, since -e will cause that to exit the shell
builtins/common.c
- get_job_by_name: call internal_error instead of report_error so this
doesn't exit the shell
2/18
----
builtins/evalstring.c
- parse_and_execute: make sure the file descriptor to be redirected to
is 1 before calling cat_file. One fix for bug reported by Dan Douglas
<ormaaj@gmail.com>
parse.y
- read_token_word: don't return NUMBER if a string of all digits
resolves to a number that overflows the bounds of an intmax_t.
Other fix for bug reported by Dan Douglas <ormaaj@gmail.com>
2/19
----
lib/sh/strtrans.c
- ansicstr: use 0x7f as the boundary for characters that translate
directly from ASCII to unicode (\u and \U escapes) instead of
UCHAR_MAX, since everything >= 0x80 requires more than one byte.
Bug and fix from John Kearney <dethrophes@web.de>
builtins/printf.def
- tescape: ditto for printf \u and \U escape sequences
2/20
----
lib/sh/unicode.c
- u32toutf8: fix to handle encodings up to six bytes long correctly
(though technically UTF-8 only has characters up to 4 bytes long).
Report and fix from John Kearney <dethrophes@web.de>
- u32toutf8: first argument is now an unsigned 32-bit quantity,
changed callers (u32cconv) to pass c instead of wc
- u32reset: new function, resets local static state to uninitialized
(locale information, currently)
locale.c
- call u32reset whenever LC_CTYPE/LC_ALL/LANG is changed to reset the
cached locale information used by u32cconv. From a report from
John Kearney <dethrophes@web.de>
2/21
----
doc/{bash,builtins}.1
- minor changes from Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
lib/sh/unicode.c
- u32cconv: only assume you can directly call wctomb on the passed
value if __STDC_ISO_10646__ is defined and the value is <=
0x7fffffff
- stub_charset: return locale as default instead of "ASCII", let
rest of code decide what to do with it
lib/readline/parens.c
- _rl_enable_paren_matching: make paren matching work in vi insert
mode. Bug report from <derflob@derflob.de>
2/22
----
lib/sh/shquote.c
- sh_backslash_quote: quote tilde in places where it would be
expanded. From a report from John Kearney <dethrophes@web.de>
2/23
----
execute_cmd.c
- execute_pipeline: wrap the discard_unwind_frame call in #ifdef
JOB_CONTROL, since the frame is only created if JOB_CONTROL is
defined. Bug and fix from Doug Kehn <rdkehn@yahoo.com>
2/25
----
error.c
- report_error: make sure last_command_exit_value is non-zero before
we call exit_shell, since the exit trap may reference it. Call
exit_shell with last_command_exit_value to allow exit statuses
other than 1
unicode.c
- stub_charset: use local static buffer to hold charset, don't change
value returned by get_locale_var. Based on idea and code from
John Kearney <dethrophes@web.de>
- u32toutf16: function to convert unsigned 32-bit value (unicode) to
UTF-16. From John Kearney <dethrophes@web.de>
- u32cconv: call u32toutf16 if __STDC_ISO_10646__ defined and wchar_t
is two bytes, send result to wcstombs, return if not encoding error.
From John Kearney <dethrophes@web.de>
- u32cconv: return UTF-8 conversion if iconv conversion to local
charset is unsupported
3/2
---
lib/readline/complete.c
- print_filename: if there is no directory hook, but there is a stat
hook, and we want to append a slash to directories, call the stat
hook before calling path_isdir on the expanded directory name.
Report and pointer to fix from Steve Rago <sar@nec-labs.com>
3/3
---
builtins/evalstring.c
- parse_and_execute: fix to change of 2/18: make sure the file
descriptor being redirected to is 0 before calling cat_file when
we see something like $(< file). Real fix for bug reported by
Dan Douglas <ormaaj@gmail.com>
subst.c
- parameter_brace_patsub: run the replacement string through quote
removal even if the expansion is within double quotes, because
the parser and string extract functions treat the quotes and
backslashes as special. If they're treated as special, quote
removal should remove them (this is the Posix position and
compatible with ksh93). THIS IS NOT BACKWARDS COMPATIBLE.
3/4
---
lib/readline/complete.c
- rl_menu_complete: fix to make show-all-if-ambiguous and
menu-complete-display-prefix work together if both are set. Fix
from Sami Pietila <sami.pietila@gmail.com>
3/5
---
bashline.c
- dircomplete_expand_relpath: new variable, if non-zero, means that
`shopt -s direxpand' should expand relative pathnames. Zero by
default, not user-settable yet
- bash_directory_completion_hook: if we have a relative pathname that
isn't changed by canonicalization or spell checking after being
appended to $PWD, then don't change what the user typed. Controlled
by dircomplete_expand_relpath
3/7
---
m4/timespec.m4
- new macros, cribbed from gnulib and coreutils: find out whether we
have `struct timespec' and what file includes it
m4/stat-time.m4
- new macros, cribbed from gnulib and coreutils: find out whether the
mtime/atime/ctime/etctime fields of struct stat are of type
struct timespec, and what the name is
include/stat-time.h
- new file, cribbed from gnulib, with additions from coreutils: include
the right file to get the struct timespec define, or provide our own
replacement. Provides a bunch of inline functions to turn the
appropriate members of struct stat into `struct timespec' values,
zeroing out the tv_nsec field if necessary
test.c
- include "stat-time.h" for the nanosecond timestamp resolution stuff
- stat_mtime: new function, returns struct stat and the mod time
normalized into a `struct timespec' for the filename passed as the
first argument
- filecomp: call stat_mtime instead of sh_stat for each filename
argument to get the mtime as a struct timespec
- filecomp: call timespec_cmp instead of using a straight arithmetic
comparison for the -nt and -ot operators, using timespec returned by
stat_mtime. Added functionality requested by by Werner Fink
<werner@suse.de> for systems that can support it
3/10
----
include/posixdir.h
- REAL_DIR_ENTRY: remove dependency on _POSIX_SOURCE, only use feature
test macros to decide whether dirent.d_ino is present and usable;
define D_INO_AVAILABLE. Report and fix from Fabrizion Gennari
<fabrizio.ge@tiscali.it>
- D_FILENO_AVAILABLE: define if we can use dirent.d_fileno
lib/sh/getcwd.c
- use D_FILENO_AVAILABLE to decide whether or not to compile in
_path_checkino and whether or not to call it. Report and initial
fix from Fabrizion Gennari <fabrizio.ge@tiscali.it>
lib/readline/signals.c
- make sure all occurrences of SIGWINCH are protected by #ifdef
sig.c
- make sure all occurrences of SIGCHLD are protected by #ifdef
nojobs.c
- make sure SA_RESTART is defined to 0 if the OS doesn't define it
version.c
- show_shell_version: don't use string literals in printf, use %s.
Has added benefit of removing newline from string to be translated
trap.c
- queue_sigchld_trap: new function, increments the number of pending
SIGCHLD signals by the argument, which is by convention the number
of children reaped in a call to waitchld()
trap.h
- queue_sigchld_trap: new extern declaration
jobs.c
- waitchld: if called from the SIGCHLD signal handler (sigchld > 0),
then call queue_sigchld_trap to avoid running the trap in a signal
handler context. Report and original fix from Siddhesh Poyarekar
<siddhesh@redhat.com>
lib/sh/unicode.c
- u32tocesc: take an unsigned 32-bit quantity and encode it using
ISO C99 string notation (\u/\U)
- u32cconv: call u32tocesc as a fallback instead of u32cchar
- u32cconv: call u32tocesc if iconv cannot convert the character.
Maybe do the same thing if iconv_open fails
- u32reset: call iconv_close on localconv if u32init == 1
3/11
----
config-top.h
- CHECKWINSIZE_DEFAULT: new define, set to initial value of
check_window_size (shopt checkwinsize): 0 for off, 1 for on.
Default is 0
{jobs,nojobs}.c
- check_window_size: default initial value to CHECKWINSIZE_DEFAULT
3/13
----
doc/bashref.texi
- change text referring to the copying restrictions to that
recommended by the FSF (no Front-Cover Texts and no Back-Cover
Texts)
lib/readline/doc/{history,rlman,rluserman}.texi
- change text referring to the copying restrictions to that
recommended by the FSF (no Front-Cover Texts and no Back-Cover
Texts)
3/15
----
array.c
- LASTREF_START: new macro to set the starting position for an array
traversal to `lastref' if that's valid, and to the start of the array
if not. Used in array_reference, array_insert, array_remove
- array_remove: try to be a little smarter with lastref instead of
unconditionally invalidating it
3/16
----
array.c
- array_insert: fix memory leak by deleting element to be added in the
case of an error
3/18
----
lib/sh/mbschr.c
- mbschr: don't call mbrlen unless is_basic is false; devolves to a
straight character-by-character run through the string
3/19
----
stringlib.c
- substring: use memcpy instead of strncpy, since we know the length
and are going to add our own NUL terminator
3/20
----
subst.c
- parameter_brace_expand_rhs: if expand_string_for_rhs returns a quoted
null string (a list with one element for which
QUOTED_NULL(list->word->word) returns true), return the quoted null
and set the flags in the returned word to indicate it. Fixes bug
reported by Mark Edgar <medgar123@gmail.com>
lib/sh/tmpfile.c
- use random(3) instead of get_random_number to avoid perturbing the
random sequence you get using $RANDOM. Bug report and fix from
Jurij Mihelic <jurij.mihelic@fri.uni-lj.si>
3/21
----
config-top.h
- OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT: define to 1 to optimize
sequential indexed array assignment patterns. Defined to 1 by
default
array.c
- array_insert: if OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT is defined,
start the search at lastref (see change from 3/15)
3/27
----
print_cmd.c
- debug_print_word_list: new debugging function, prints a word list
preceded by an optional string and using a caller-specified
separator
4/1
---
command.h
- W_ASSNGLOBAL: new flag, set to indicate declare -g
execute_cmd.c
- fix_assignment_words: note that we have a -g argument to an assignment
builtin and set the W_ASSNGLOBAL flag in the variable word
subst.c
- dump_word_flags: print out W_ASSNGLOBAL if present
- do_assignment_internal: only set ASS_MKLOCAL if W_ASSIGNARG is set
and W_ASSNGLOBAL is not. Don't want to create a local variable even
if variable_context is non-zero if ASSNGLOBAL is set. Fixes bug
reported by Bill Gradwohl <bill@ycc.com>
4/7
---
lib/readline/readline.c
- _rl_dispatch_subseq: make the `keyseq-timeout' variable apply to
ESC processing when in vi mode. After hitting ESC, readline will
wait up to _rl_keyseq_timeout*1000 microseconds (if set) for
additional input before dispatching on the ESC and switching to
command/movement mode. Completes timeout work suggested by
<rogerx.oss@gmail.com>; this prompted by report from Barry Downes
<barry.downes@gmail.com>
lib/sh/shmbchar.c
- sh_mbsnlen: new function, returns the number of (possibly multibyte)
characters in a passed string with a passed length, examining at most
maxlen (third argument) bytes
externs.h
- sh_mbsnlen: extern declaration for new function
shell.c
- exit_shell: call maybe_save_shell_history if remember_on_history is
set, not just in interactive shells. That means the history is
saved if history is enabled, regardless of whether or not the shell
is interactive
doc/{bash.1,bashref.texi}
- TMOUT: fix description to make it explicit that TMOUT is the timeout
period for a complete line of input, not just any input. Fixes
problem reported in Ubuntu bug 957303:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/957303
- HISTFILE: document change to write history list to history file in
any shell with history enabled, not just interactive shells. This
seems to be more logical behavior. Suggested by Greg Wooledge
<wooledg@eeg.ccf.org>
4/12
----
lib/readline/colors.h
- only include stdbool.h if HAVE_STDBOOL_H is defined
- if HAVE_STDBOOL_H is not defined, provide enough definition for the
library to use `bool', `true', and `false'
lib/readline/parse-colors.[ch]
- don't try to include <stdbool.h> at all; rely on colors.h to do it
lib/sh/snprintf.c
- vsnprintf_internal: only treat '0' as a flag to indicate zero padding
if `.' hasn't been encountered ((flags&PF_DOT) == 0); otherwise treat
it as the first digit of a precision specifier. Fixes bug reported
by Petr Sumbera <petr.sumbera@sun.com>
4/15
----
lib/sh/snprintf.c
- vsnprintf_internal: if the '0' and '-' flags both occur, the '0'
flag is ignored -- Posix. Start of a series of fixes based on
tests and patches from Petr Sumbera <petr.sumbera@sun.com>
- PUT_PLUS: make sure PF_PLUS flag is specified before putting the `+'
- vsnprintf_internal: when '+' is read as a flag, don't set right-
justify flag if the LADJUST (`-') flag has already been supplied
- floating: make sure to output space padding before the `+', zero
padding after
- exponent: make sure to output space padding before the `+', zero
padding after
- exponent: only subtract one from the width for the decimal point
if we're really going to print one
- floating: use presence of PF_PLUS flag to decide whether to account
for the `+' in the padded field width. Ditto for exponent()
4/16
----
lib/sh/snprintf.c
- vsnprint_internal: only reduce precision by 1 when processing the `g'
format if it's > 0. A precision of 0 should stay 0; otherwise it
gets set to -1 (NOT_FOUND) and converted to the default
- number, lnumber: if an explicit precision is supplied, turn off the
zero-padding flag and set the pad character back to space
- number, lnumber: only account for a `+' when performing the field
width calculation if the coversion is base 10; we don't add a `+'
for other bases
4/18
----
tests/printf3.sub
- try using "perl -e 'print time'" to get the current time in seconds
since the epoch if "date +%s" is not available (solaris 8-10)
4/19
----
tests/run-printf
- use cat -v instead of relying on diff -a being available to convert
control characters to ascii and avoid the dreaded "Binary files
/tmp/xx and printf.right differ"
4/20
----
lib/sh/strftime.c
- incoporated new version from Aharon Robbins <arnold@skeeve.com>
4/22
----
doc/{bash.1,bashref.texi}
- slight change to the description of /dev/tcp and /dev/udp
subst.c
- match_wpattern: logic fix to the calculation of `simple' (was |=,
needs to be &=). Bug report from Mike Frysinger <vapier@gentoo.org>,
fix from Andreas Schwab <schwab@linux-m68k.org>
bashline.c
- bash_filename_stat_hook: add code from bash_directory_completion_hook
that performs pathname canonicalization in the same way that cd and
other builtins will do
4/25
----
execute_cmd.c
- execute_pipeline: change the call to move_to_high_fd to make it use
getdtablesize() and to not stomp on existing open file descriptors,
like the fd the shell is using to read a script. Bug report from
Greg Wooledge <wooledg@eeg.ccf.org>
5/6
---
subst.c
- expand_word_internal: case '$': after calling param_expand and
setting had_quoted_null, set TEMP to null. The code that builds the
returned string at the end of the function will take care of making
and returning a quoted null string if there's nothing else in
ISTRING. If there is, the quoted null should just go away. Part of
fix for bug reported by Ruediger Kuhlmann <RKuhlmann@orga-systems.com>
- expand_word_internal: when processing ISTRING to build return value,
only set W_HASQUOTEDNULL in the returned word flags if the word is
a quoted null string AND had_quoted_null is set. Rest of fix
5/9
---
variables.c
- bind_variable_internal: if we get an array variable here (implicit
assignment to index 0), call make_array_variable_value, which
dummies up a fake SHELL_VAR * from array[0]. This matters when
we're appending and have to use the current value
- bind_variable_internal: after computing the new value, treat assoc
variables with higher precedence than simple array variables; it
might be that a variable has both attributes set
arrayfunc.c
- bind_array_var_internal: break code out that handles creating the
new value to be assigned to an array variable index into a new
function, make_array_variable_value. This handles creating a
dummy SHELL_VAR * for implicit array[0] assignment. Fixes bug
reported by Dan Douglas <ormaaj@gmail.com>
arrayfunc.h
- make_array_variable_value: new extern declaration
5/19
----
variables.c
- bind_int_variable: if an assignment statement like x=y comes in
from the expression evaluator, and x is an array, handle it like
x[0]=y. Fixes bug reported by Dan Douglas <ormaaj@gmail.com>
5/24
----
braces.c
- mkseq: handle possible overflow and break the sequence generating
loop if it occurs. Fixes OpenSUSE bug 763591:
https://bugzilla.novell.com/show_bug.cgi?id=763591
5/25
----
Makefile.in
- LDFLAGS_FOR_BUILD: add to compilation recipes for build tools
buildversion, mksignames, mksyntax
- LDFLAGS_FOR_BUILD: add to compilation recipes for test tools
recho, zecho, printenv, xcase
builtins/Makefile.in
- LDFLAGS_FOR_BUILD: add to compilation recipes for build tools
gen-helpfiles, psize.aux
variables.c
- bind_int_variable: if LHS is a simple variable name without an array
reference, but resolves to an array variable, call
bind_array_variable with index 0 to make x=1 equivalent to x[0]=1.
Fixes bug reported by Dan Douglas <ormaaj@gmail.com>
5/27
----
subst.c
- expand_word_internal: make sure has_dollar_at doesn't get reset before
recursive calls to param_expand or expand_word_internal, since it has
to save state of what came before. Use temp variable and make sure
has_dollar_at is incremented if recursive call processes "$@".
Fixes bug reported by gregrwm <backuppc-users@whitleymott.net> and
supplemented by Dan Douglas <ormaaj@gmail.com>
doc/{bash.1,bashref.texi}
- changes to the description of substring expansion inspired by
suggestions from Bill Gradwohl <bill@ycc.com>
doc/bashref.texi
- added substring expansion examples inspired by suggestions from
Bill Gradwohl <bill@ycc.com>
variables.c
- find_shell_variable: search for a variable in the list of shell
contexts, ignore the temporary environment
- find_variable_tempenv: search for a variable in the list of shell
contexts, force search of the temporary environment
- find_variable_notempenv: search for a variable in the list of shell
contexts, don't force search of the temporary environment
variables.h
- find_shell_variable: extern declaration
- find_variable_tempenv: extern declaration
- find_variable_notempenv: extern declaration
arrayfunc.c
- bind_array_variable: call find_shell_variable instead of calling
var_lookup directly
findcmd.c
- search_for_command: call find_variable_tempenv instead of
find_variable_internal directly
- _find_user_command_internal: call find_variable_tempenv instead of
find_variable_internal directly
builtins/setattr.def
- set_var_attribute: call find_variable_notempenv instead of
find_variable_internal directly
- show_name_attributes: call find_variable_tempenv instead of
find_variable_internal directly
6/1
---
sig.c
- termsig_handler: don't try to save the shell history on a terminating
signal any more, since it just causes too many problems on Linux
systems using glibc and glibc malloc
lib/readline/vi_mode.c
- rl_vi_change_to: change to correctly redo `cc', since `c' is not a vi
motion character. From Red Hat bug 813289
- rl_vi_delete_to: change to correctly redo `dd', since `d' is not a vi
motion character
- rl_vi_yank_to: change to correctly redo `yy', since `y' is not a vi
motion character
6/4
---
lib/sh/mktime.c
- current versions of VMS do not need to include <stddef.h>. Fix from
John E. Malmberg <wb8tyw@qsl.net>
6/5
---
lib/sh/eaccess.c
- sh_stat: instead of using a static buffer to do the DEV_FD_PREFIX
translation, use a dynamically-allocated buffer that we keep
resizing. Fixes potential security hole reported by David Leverton
<levertond@googlemail.com>
6/5
---
braces.c
- expand_seqterm: check errno == ERANGE after calling strtoimax for
rhs and incr. Part of a set of fixes from Scott McMillan
<scotty.mcmillan@gmail.com>
- expand_seqterm: incr now of type `intmax_t', which changes
arguments to mkseq
- mkseq: a better fix for detecting overflow and underflow since it's
undefined in C and compilers `optimize' out overflow checks. Uses
ADDOVERFLOW and SUBOVERFLOW macros
- mkseq: use sh_imaxabs (new macro) instead of abs() for intmax_t
variables
- mkseq: don't allow incr to be converted to -INTMAX_MIN
- mkseq: make sure that strvec_create isn't called with a size argument
greater than INT_MAX, since it only takes an int
6/6
---
braces.c
- mkseq: try and be smarter about not overallocating elements in
the return array if the increment is not 1 or -1
6/7
---
parse.y
- history_delimiting_chars: if the parser says we're in the middle of
a compound assignment (PST_COMPASSIGN), just return a space to avoid
adding a stray semicolon to the history entry. Fixes bug reported
by "Davide Brini" <dave_br@gmx.com>
6/8
---
bashline.c
- bash_directory_completion_hook: don't attempt spelling correction
on the directory name unless the direxpand option is set and we are
going to replace the directory name with the corrected one in the
readline line. Suggested by Linda Walsh <bash@tlinx.org>
lib/sh/shquote.c
- sh_backslash_quote: now takes a third argument: flags. If non-zero,
tildes are not backslash-escaped. Have to handle both printf %q,
where they should be escaped, and filename completion, where they
should not when used as usernames
externs.h
- sh_backslash_quote: declaration now takes a third argument
builtins/printf.def
- printf_builtin: call sh_backslash_quote with 1 as third argument
so tildes get escaped
{bashline,bracecomp}.c
- call sh_backslash_quote with 0 as third argument so tildes are not
escaped in completed words
doc/bash.1
- add `coproc' to the list of reserved words. From a report by
Jens Schweikhardt <schweikh@schweikhardt.net>
6/10
----
execute_cmd.c
- line_number_for_err_trap: now global, so parse_and_execute can save
and restore it with unwind-protect
builtins/evalstring.c
- parse_prologue: save and restore line_number_for_err_trap along
with line_number
- restore_lastcom: new function, unwind-protect to restore
the_printed_command_except_trap
- parse_prologue: use restore_lastcom to save and restore the value
of the_printed_command_except_trap around calls to parse_and_execute
(eval/source/.)
6/15
----
lib/readline/complete.c
- complete_fncmp: change filename comparison code to understand
multibyte characters, even when doing case-sensitive or case-mapping
comparisons. Fixes problem reported by Nikolay Shirokovskiy
<nshyrokovskiy@gmail.com>
6/20
----
builtins/mapfile.def
- mapfile: move the line count increment and check for having read
the specified number of lines to the end of the loop to avoid
reading an additional line with zgetline. Fixes bug reported by
Dan Douglas <ormaaj@gmail.com>
6/21
----
execute_cmd.c
- execute_pipeline: make sure `lastpipe_flag' is initialized to 0 on
all systems, since it's tested later in the function. Fixes bug
reported by John E. Malmberg <wb8tyw@qsl.net>
6/22
----
mailcheck.c
- file_mod_date_changed: return 0 right away if mailstat() does not
return success. Fixes bug with using uninitialized values reported
by szymon.kalasz@uj.edu.pl
builtins/set.def
- the `monitor' option is not available when the shell is compiled
without job control, since the underlying `m' flag is not available
nojobs.c
- job_control: now declared as int variable, initialized to 0, never
modified
jobs.h
- job_control: extern declaration no longer dependent on JOB_CONTROL
execute_cmd.c
- execute_pipeline: made necessary changes so `lastpipe' shell option
is now available in all shells, even those compiled without
JOB_CONTROL defined
6/23
----
lib/glob/glob.c
- glob_filename: check for interrupts before returning if glob_vector
returns NULL or an error. Bug reported by Serge van den Boom
<svdb@stack.nl>, fix from Andreas Schwab <schwab@linux-m68k.org>
- call run_pending_traps after each call to QUIT or test of
interrupt_state, like we do in mainline shell code
- glob_vector: don't call QUIT; in `if (lose)' code block; just free
memory, return NULL, and let callers deal with interrupt_state or
other signals and traps
6/25
----
lib/readline/input.c
- rl_read_key: restructure the loop that calls the event hook a little,
so that the hook is called only after rl_gather_tyi returns no input,
and any pending input is returned first. This results in better
efficiency for processing pending input without calling the hook
on every input character as bash-4.1 did. From a report from
Max Horn <max@quendi.de>
6/26
----
trap.c
- signal_is_pending: return TRUE if SIG argument has been received and
a trap is waiting to execute
trap.h
- signal_is_pending: extern declaration
lib/glob/glob.c
- glob_vector: check for pending SIGINT trap each time through the loop,
just like we check for interrupt_state or terminating_signal, and
set `lose = 1' so we clean up after ourselves and interrupt the
operation before running the trap. This may require a change later,
maybe call run_pending_traps and do that if run_pending_traps returns?
variables.c
- sv_histtimefmt: set history_comment_character to default (`#') if
it's 0 when we're turning on history timestamps. The history code
uses the history comment character to prefix timestamps, and
leaving it at 0 effectively removes them from the history. From a
report to help-bash by Dennis Williamson <dennistwilliamson@gmail.com>
6/27
----
lib/readline/signals.c
- rl_maybe_restore_sighandler: new function, sets handler for SIG to
HANDLER->sa_handler only if it's not SIG_IGN. Needs to be called
on same signals set using rl_maybe_set_sighandler, which does not
override an existing SIG_IGN handler (SIGALRM is ok since it does
the check inline; doesn't mess with SIGWINCH)
6/30
----
variables.h
- additional defines for the new `nameref' variable attribute
(att_nameref): nameref_p, nameref_cell, var_setref
variables.c
- find_variable_nameref: resolve SHELL_VAR V through chain of namerefs
- find_variable_last_nameref: resolve variable NAME until last in a
chain of possibly more than one nameref starting at shell_variables
- find_global_variable_last_nameref: resolve variable NAME until last
in a chain of possibly more than one nameref starting at
global_variables
- find_nameref_at_context: resolve SHELL_VAR V through chain of namerefs
in a specific variable context (usually a local variable hash table)
- find_variable_nameref_context: resolve SHELL_VAR V through chain of
namerefs following a chain of varible contexts
- find_variable_last_nameref_context: resolve SHELL_VAR V as in
find_variable_last_context, but return the final nameref instead of
what the final nameref resolves to
- find_variable_tempenv, find_variable_notempenv, find_global_variable,
find_shell_variable, find_variable: modified to follow namerefs
- find_global_variable_noref: look up a global variable without following
any namerefs
- find_variable_noref: look up a shell variable without following any
namerefs
- bind_variable_internal: modify to follow a chain of namerefs in the
global variables table; change to handle assignments to a nameref by
following nameref chain
- bind_variable: modify to follow chain of namerefs when binding to a
local variable
- unbind_variable: changes to unset nameref variables (unsets both
nameref and variable it resolves to)
subst.c
- parameter_brace_expand_word: change to handle expanding nameref whose
value is x[n]
- parameter_brace_expand_indir: change to expand in ksh93-compatible
way if variable to be indirected is nameref and a simple (non-array)
expansion
- param_expand: change to expand $foo where foo is a nameref whose value
is x[n]
execute_cmd.c
- execute_for_command: changes to implement ksh93 semantics when index
variable is a nameref
builtins/setattr.def
- show_var_attributes: change to add `n' to flags list if att_nameref
is set
builtins/set.def
- unset_builtin: changes to error messages to follow nameref variables
builtins/declare.def
- document new -n option
- declare_internal: new `-n' and `+n' options
- declare_internal: handle declare -n var[=value] and
declare +n var[=value] for existing and non-existant variables.
Enforce restriction that nameref variables cannot be arrays.
Implement semi-peculiar ksh93 semantics for typeset +n ref=value
7/5
---
variables.c
- unbind_variable: unset whatever a nameref resolves to, leaving the
nameref variable itself alone
- unbind_nameref: new function, unsets a nameref variable, not the
variable it references
variables.h
- unbind_nameref: extern declaration
builtins/set.def
- unset_builtin: modify to add -n option, which calls unbind_nameref
leaving unbind_variable for the usual case. This required slight
changes and additions to the test suite
doc/{bash.1,bashref.texi}
- document namerefs and typeset/declare/local/unset -n
7/13
----
lib/sh/casemod.c
- include shmbchar.h for is_basic and supporting pieces
- sh_casemod: use _to_wupper and _to_wlower to convert wide character
case instead of TOUPPER and TOLOWER. Fixes bug reported by
Dennis Williamson <dennistwilliamson@gmail.com>, fix from
Andreas Schwab <schwab@linux-m68k.org>
- cval: short-circuit and return ascii value if is_basic tests true
- sh_casemod: short-circuit and use non-multibyte case modification
and toggling code if is_basic tests true
lib/readline/signals.c
- _rl_{block,release}_sigint: remove the code that actually blocks and
releases the signals, since we defer signal handling until calls to
RL_CHECK_SIGNALS()
lib/readline/{callback,readline,util}.c
- if HAVE_POSIX_SIGSETJMP is defined, use sigsetjmp/siglongjmp without
saving and restoring the signal mask instead of setjmp/longjmp
lib/readline/rltty.c
- prepare_terminal_settings: don't mess with IXOFF setting if
USE_XON_XOFF defined
doc/{bash.1,bashref.texi}
- add some text to the description of set -e clarifying its effect
on shell functions and shell function execution. Suggested by
Rainer Blome <rainer.blome@gmx.de>
bashline.c
- edit_and_execute_command: increment current_command_line_count before
adding partial line to command history (for command-oriented-history
because of rl_newline at beginning of function), then reset it to 0
before adding the dummy history entry to make sure the dummy entry
doesn't get added to previous incomplete command. Partial fix for
problem reported by Peng Yu <pengyu.ut@gmail.com>
7/24
----
configure.in
- interix: define RECYCLES_PIDS. Based on a report from Michael
Haubenwallner <michael.haubenwallner@salomon.at>
7/26
----
jobs.c
- make_child: call bgp_delete on the newly-created pid unconditionally.
Some systems reuse pids before cycling through an entire set of
CHILD_MAX/_SC_CHILD_MAX unique pids. This is no longer dependent
on RECYCLES_PIDS. Based on a report from Michael Haubenwallner
<michael.haubenwallner@salomon.at>
support/shobj-conf
- Mac OS X: drop MACOSX_DEPLOYMENT_TARGET=10.3 from the LDFLAGS. We
can finally kill Panther
7/28
----
subst.c
- command_substitute: make sure last_made_pid gets reset if make_child
fails
execute_cmd.c
- execute_command_internal: case cm_simple: decide whether or not to
wait_for a child if already_making_children is non-zero, indicates
that there is an unwaited-for child. More of fix for bug report
from Michael Haubenwallner <michael.haubenwallner@salomon.at>
jobs.c
- make_child: call delete_old_job (new_pid) unconditionally, don't
bother to check whether or not pid wrap occurred. Rest of fix for
bug report from Michael Haubenwallner
<michael.haubenwallner@salomon.at>
7/29
----
shell.c
- subshell_exit: new function, exits the shell (via call to sh_exit())
after calling any defined exit trap
externs.h
- subshell_exit: new extern declaration
execute_cmd.c
- execute_command_internal: make sure to call subshell_exit for
{} group commands executed asynchronously (&). Part of fix for
EXIT trap bug reported by Maarten Billemont <lhunath@lyndir.com>
sig.c
- reset_terminating_signals: make sure to set termsigs_initialized back
to 0, so a subsequent call to initialize_terminating_signals works
right. Rest of fix for bug reported by Maarten Billemont
<lhunath@lyndir.com>
{execute_cmd,general,jobs,mailcheck,mksyntax,test}.c
builtins/{cd,fc,pushd,ulimit}.def
lib/malloc/getpagesize.h
lib/sh/{clktck,fpurge,inet_aton,mailstat,oslib,pathcanon,pathphys,spell,strerror}.c
- make inclusion of <sys/param.h> dependent on HAVE_SYS_PARAM_H
consistently
8/6
---
lib/readline/histexpand.c
- history_expand_internal: now takes an additional argument saying
whether the history expansion occurs within a quoted string, set to
the open quote character
- history_expand_internal: use new argument instead of checking prev
char and initializing quoted_search_delimiter, pass qc directly to
get_history_event, where it allows a matching quote to terminate a
string defining an event
- history_expand: change single-quote handling code so that if
history_quotes_inhibit_expansion is 0, single quotes are treated
like double quotes
- history_expand: change call to history_expand_internal to pass new
argument of `"' if double-quoted string, `'' if single-quoted string;
this lets history_expand decide what is a quoted string and what
is not
8/7
---
configure.in
- AC_CANONICAL_BUILD: invoke for later use
lib/readline/macro.c
- _rl_prev_macro_key: new function, inverse of _rl_next_macro_key:
backs up the index into the current macro by 1
lib/readline/rlprivate.h
- _rl_prev_macro_key: extern declaration
lib/readline/readline.c
- _rl_dispatch_subseq, _rl_subseq_result: don't call _rl_unget_char
if we're currently reading from a macro; call _rl_prev_macro_key
instead. Fixes bug reported by Clark Wang <clark.wang@oracle.com>
8/13
----
builtins/evalstring.c
- evalstring(): new function, wrapper around parse_and_execute.
make sure we handle cases where parse_and_execute can call `return'
and short-circuit without cleaning up properly. We call
parse_and_execute_cleanup() then jump to the previous-saved return
location
builtins/common.h
- extern declaration for evalstring()
builtins/eval.def
- eval_builtin: make sure we handle `eval " ... return"' in contexts
where `return' is valid by calling evalstring(). Fixes bug with
`eval return' in sourced files reported by Clark Wang
<dearvoid@gmail.com>
trap.c
- run_pending_traps: call evalstring instead of parse_and_execute.
XXX - still needs to handle saving and restoring token state in the
presence of `return'; could use unwind_protects for that
builtins/mapfile.def
- run_callback: call evalstring instead of parse_and_execute
8/15
----
bashline.c
- bash_filename_stat_hook: make sure we don't free local_dirname
before using it to canonicalize any expanded filename. Make sure
it always points to *dirname and only free it if we're replacing
it.
lib/readline/complete.c
- append_to_match: make sure we call rl_filename_stat_hook with
newly-allocated memory to avoid problems with freeing it twice
8/17
----
variables.c,config-top.h
- if ARRAY_EXPORT is defined to 1 when variables.c is compiled, the
code that allows indexed arrays to be exported is enabled and
included
8/19
----
shell.c
- call start_debugger from main() only if dollar_vars[1] != 0 (close
enough to a non-interactive shell, since we can be interactive with
-i while running a shell script). Fixes oddity reported by
Techlive Zheng <techlivezheng@gmail.com>
8/20
----
arrayfunc.c
- quote_array_assignment_chars: don't bother quoting if the word has
not been marked as an assignment (W_ASSIGNMENT)
- quote_array_assignment_chars: turn on W_NOGLOB in the word flags
so assignment statements don't undergo globbing. Partial fix for
problems reported by Dan Douglas <ormaaj@gmail.com>
8/21
----
command.h
- W_NOBRACE: new word flag that means to inhibit brace expansion
subst.c
- brace_expand_word_list: suppress brace expansion for words with
W_NOBRACE flag
8/22
----
builtins/read.def
- read_builtin: don't call dequote_string on what we've read, even if
we saw an escape character, unless (input_string && *input_string).
We may have escaped an IFS whitespace character. Fixes seg fault
reported by <armandsl@gmail.com>
execute_cmd.c
- execute_command_internal: set the_printed_command_except trap when
about to execute a ( ... ) user subshell. For now, set it only if
ERR is trapped; can relax that later. Fixes bug reported by
Mike Frysinger <vapier@gentoo.org>
8/23
----
jobs.c
- remove references to first_pid and pid_wrap, since we're not using
them for anything anymore
8/24
----
subst.c
- changes for W_NOBRACE everywhere appropriate: so it can be displayed
for debugging, and passed out of expand_word_internal
doc/{bash.1,bashref.texi}
- small changes to make it clearer that the = and == operators are
equivalent, and will cause pattern matching when used with [[.
From a question from Michal Soltys <soltys@ziu.info>
doc/bashref.texi
- some small formatting changes from Karl Berry <karl@freefriends.org>
8/27
----
lib/readline/doc/{history,rlman,rluserman}.texi
- some small formatting changes from Karl Berry <karl@freefriends.org>
arrayfunc.c
- assign_array_element_internal, assign_compound_array_list,
unbind_array_element, array_value_internal: changes to make
assignment statements to negative indices (a[-1]=2) and unsetting
array elements using negative indices (unset 'a[-1]') work.
From suggestions by Dennis Williamson <dennistwilliamson@gmail.com>
and Chris F. A. Johnson <chris@cfajohnson.com>
subst.c
- array_length_reference: changes to make length references to array
elements using negative indices (${#a[-1]}) work
8/28
----
doc/{bash.1,bashref.texi}
- document new treatment of negative indices to indexed arrays when
assigning, referencing, calculating length, and unsetting
8/29
----
shell.c
- show_shell_usage: add -l to list of shell invocation options (short
for --login). From Red Hat bug 852469
configure.ac
- renamed from configure.in, as latest autoconf versions want. Patches
Stefano Lattarini <stefano.lattarini@gmail.com>
MANIFEST,Makefile.in,doc/bashref.texi,support/mkconffiles
- configure.in -> configure.ac
9/1
---
parse.y
- read_token_word: allow words like {array[ind]} to be valid redirection
words for constructs like {x}<file
redir.c
- redir_varassign: bind_var_to_int already handles array assignments,
so don't need to do anything more for things like {a[i]}<file
- redir_varvalue: changes to allow references to {a[i]} when
performing redirections using valid_array_reference and
get_array_value. Adds functionality requested most recently by
<unknown@vmw-les.eng.vmware.com>
lib/readline/display.c
- update_line: if the first difference between the old and new lines
is completely before any invisible characters in the prompt, we
should not adjust _rl_last_c_pos, since it's before any invisible
characters. Fixed in two places
- prompt_modechar: return a character indicating the editing mode:
emacs (@), vi command (:), or vi insert (+)
- _rl_reset_prompt: new function, just calls rl_expand_prompt. Will be
inlined, placeholder for more changes
- expand_prompt: if show-mode-in-prompt is enabled, add a character to
the front of the prompt indicating the editing mode, adjusting the
various variables as appropriate to keep track of the number of
visible characters and number of screen positions
lib/readline/bind.c
- show-mode-in-prompt: new bindable boolean variable, shadowed by
_rl_show_mode_in_prompt variable
- hack_special_boolean_var: call _rl_reset_prompt when toggling or
setting show-mode-in-prompt
lib/readline/readline.c
- readline_internal_setup: make sure the correct vi mode keymap is set
before expanding the prompt string for the first time
lib/readline/misc.c
- rl_emacs_editing_mode: make sure to call _rl_reset_prompt if we're
showing the editing mode in the prompt
lib/readline/rlprivate.h
- _rl_reset_prompt, _rl_show_mode_in_prompt: extern declarations
lib/readline/vi_mode.c
- rl_vi_insertion_mode: call _rl_reset_prompt
- rl_vi_movement_mode: call _rl_reset_prompt. Finishes changes for
showing mode in prompt string, originally requested by Miroslav
Koskar <mkoskar@gmail.com> and most recently by Jordan Michael
Ziegler <jziegler@bnl.gov>
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- document new show-mode-in-prompt variable, off by default
9/3
---
jobs.c
- set_childmax: new function, external mechanism for other parts of
the shell to set js.c_childmax, the number of saved exited child
statuses to remember
jobs.h
- set_childmax: extern declaration
variables.c
- CHILD_MAX: new special variable, with sv_childmax function to
run when it changes. Setting CHILD_MAX to a value greater than
zero but less than some maximum (currently 8192) sets the number of
exited child statuses to remember. set_childmax (jobs.c) ensures
that the number does not drop below the posix-mandated minimum
(CHILD_MAX)
doc/{bash.1,bashref.texi}
- CHILD_MAX: document new meaning and action when variable is set
9/5
---
redir.c
- redir_varassign: call stupidly_hack_special_variables after
assigning fd number to specified variable, so we can use constructs
like {BASH_XTRACEFD}>foo. Suggested by Pierre Gaston
<pierre.gaston@gmail.com>
9/8
---
expr.c
- readtok: invalidate previous contents of `curlval' before freeing
and reallocating tokstr (which, chances are, will get the same
pointer as before and render curlval inconsistent). Fixes other
bug reported by Dan Douglas <ormaaj@gmail.com>
9/9
---
lib/readline/complete.c
- rl_username_completion_function: protect call to setpwent() with
#ifdef (HAVE_GETPWENT)/#endif. Fixes bug reported by
Gerd Hofmann <gerd.hofmann.nbg@googlemail.com>
lib/readline/display.c
- rl_message: second and subsequent calls to rl_message can result in
local_prompt being overwritten with new values (e.g., from the
successive calls displaying the incremental search string). Need
to free before overwriting if it's not the same as the value saved
in saved_local_prompt. Fixes memory leak reported by
Wouter Vermaelen <vermaelen.wouter@gmail.com>
lib/readline/{terminal.c,rlprivate.h}
- move CUSTOM_REDISPLAY_FUNC and CUSTOM_INPUT_FUNC defines from
terminal.c to rlprivate.h so other files can use them
expr.c
- expr_streval: if noeval is non-zero, just return 0 right away,
short-circuiting evaluation completely. readtok will leave curtok
set correctly without re-entering the evaluator at all. Rest of
fix for bug reported by Dan Douglas <ormaaj@gmail.com>
9/11
----
parse.y
- parse_comsub: make sure the `reserved word ok in this context' flag
is preserved after we read `do' followed by whitespace. Fixes bug
reported by Benoit Vaugon <benoit.vaugon@gmail.com>
9/13
----
configure.ac,config.h.in
- enable-direxpand-default: new configure option, turns the `direxpand'
shell option on by default
bashline.c
- dircomplete_expand, dircomplete_expand_relpath: initialize to 1 if
DIRCOMPLETE_EXPAND_DEFAULT is defined and non-zero
doc/bashref.texi
- enable-direxpand-default: document new configure option
9/14
----
shell.c
- --protected: make option valid only when wordexp is compiled into
the shell. Fix from Roman Rakus <rrakus@redhat.com>
configure.ac
- HP NonStop (*-nsk*): compile --without-bash-malloc. Change from
Joachim Schmitz <jojo@schmitz-digital.de>
9/16
----
subst.c,execute_cmd.c,lib/glob/sm_loop.c,lib/sh/shquote.c
- minor code cleanups from Joachim Schmitz <jojo@schmitz-digital.de>
lib/readline/colors.h
- workaround for HP NonStop compiler issue with <stdbool.h> from
Joachim Schmitz <jojo@schmitz-digital.de>
9/17
----
builtins/printf.def
- printf_builtin: handle localtime returning NULL, as can happen when
encountering overflow. Bug report and initial fix from
Eduardo A. Bustamante López <dualbus@gmail.com>
doc/{bash.1,bashref.texi}
- emphasize that brace expansion using character ranges ({a..c}) acts
as if the C locale were in use. Prompted by message from
Marcel Giannelia <info@skeena.net>
9/20
----
lib/sh/wcsnwidth.c
- wcsnwidth: new function, variant of wcwidth, returns the number of
wide characters from a string that will be displayed to not exceed
a specified max column position
9/21
----
builtins/help.def
- show_builtin_command_help: break code that displays the short-doc
for each builtin in two columns into a new function: dispcolumn
- wdispcolumn: multibyte-char version of dispcolumn; uses wide
chars and printf "%ls" format. Fixes problem reported by
Nguyá»n Thái Ngá»c Duy <pclouds@gmail.com>
9/22
----
execute_cmd.c
- execute_disk_command: before running the command-not-found hook,
call kill_current_pipeline() to make sure we don't add processes
to an existing pipeline or wait for processes erroneously
9/23
----
lib/readline/input.c
- rl_input_available_hook: new hook function, called from
_rl_input_available (or _rl_input_queued) to return whether or not
input is available wherever the input source is
lib/readline/doc/rltech.texi
- rl_input_available_hook: document
9/27
----
lib/glob/sm_loop.c:
- GMATCH: after one or more `*', an instance of ?(x) can match zero or
1 times (unlike ?, which has to match one character). The old code
failed if it didn't match at least once. Fixes `a*?(x)' bug.
- GMATCH: if we hit the end of the search string, but not the end of
the pattern, and the rest of the pattern is something that can
match the NUL at the end of the search string, we should successfully
match. Fixes `a*!(x)' bug reported by <hans1worst@gmail.com>
10/2
----
command.h
- add c_lock member to coproc structure for future use to tell who is
manipulating it
execute_cmd.c
- execute_coproc: block SIGCHLD while parent is forking coproc
process and adding pid to sh_coproc struct to avoid race condition
where child is reaped before the pid is assigned and the coproc is
never marked as having died. Fixes race condition identified by
Davide Baldini <baldiniebaldini@gmail.com>
- add assignments to c_lock member of struct coproc in various
functions that manipulate it; was used to identify race condition
- coproc_pidchk: don't call coproc_dispose to avoid using malloc and
other functions in a signal handler context
- coproc_dispose: call BLOCK_SIGNAL/UNBLOCK_SIGNAL for SIGCHLD while
manipulating the sh_coproc struct
10/6
----
lib/readline/complete.c
- rl_display_match_list: if printing completions horizontally, don't
bother with spacing calculations if limit == 1, which means we are
printing one completion per line no matter what. Fixes bug
reported by David Kaasen <kaasen@nvg.ntnu.no>
10/7
----
builtins/declare.def
- declare_internal: add error checking for nameref attribute and
variable assignments: self-references, attempts to make an array
variable a nameref
subst.c
- parameter_brace_expand: handle parameter_brace_expand_word returning
&expand_param_fatal or &expand_param_error and return the appropriate
error value
- parameter_brace_expand_word: if a nameref variable's value is not a
valid identifier, return an error
- param_expand: if a nameref variable's value is not a valid identifier,
return an error
test.c
- unary_operator: add new -R variable, returns true if variable is set
and has the nameref attribute. From ksh93
builtins/test.def
- add -R to description of conditional commands for help test
doc/{bash.1,bashref.texi}
- document new -R unary conditional operator
10/13
-----
trap.c
- check_signals_and_traps: new function, convenience function for the
rest of the shell to check for pending terminating and interrupt
signals, and to check for and process any pending traps
- any_signals_trapped: new function, returns non-zero if any signals
are trapped and -1 if not
trap.h
- extern declaration for check_signals_and_traps
bashline.c
- bashline_reset: make sure we reset the event hook
- bash_event_hook: call check_signals_and_traps instead of just
checking for terminating signals so we can run pending traps and
react to interrupts, and reset the event hook when we're done
10/14
-----
trap.c
- trap_handler: if executing in a readline signal handler context,
call bashline_set_event_hook to install bash_event_hook to process
the signal (if bash cares about it)
sig.c
- sigint_sighandler: call bashline_set_event_hook to set the event
hook if we're executing in a readline signal handler context
lib/readline/input.c
- rl_getc: call RL_CHECK_SIGNALS if read returns -1/EINTR and the caught
signal is SIGINT or SIGQUIT rather than waiting until the next time
around the loop
- rl_getc: call rl_event_hook after calling RL_CHECK_SIGNALS to allow
an application signal handler to set the event hook in its own
signal handler (e.g., like bash trap_handler or sigint_sighandler)
parse.y
- yy_readline_get: don't set interrupt_immediately before we call
readline(). Inspired by report from lanshun zhou
<zls.sogou@gmail.com>
input.c
- getc_with_restart: add call to run_pending_traps after call to
CHECK_TERMSIG
lib/sh/zread.c
- zread: call check_signals_and_traps if read() returns -1/EINTR
instead of just ignoring the EINTR and deferring handling any
signal that generated it
builtins/mapfile.def
- mapfile: don't set interrupt_immediately before calling zgetline()
(which uses zread internally)
builtins/read.def
- read_builtin: don't set interrupt_immediately before calling zread
(moved code around so that it was only being set right around calls
to zread to avoid signal handler conflicts). Inspired by report
from lanshun zhou <zls.sogou@gmail.com>
- edit_line: don't set interrupt_immediately around call to readline()
- include shmbutil.h
- read_builtin: don't call read_mbchar unless is_basic(c) returns
false for the character we just read
10/15
-----
sig.c
- throw_to_top_level: if interrupt_state is non-zero, make sure that
last_command_exit_value reflects 128+SIGINT if it's not already
greater than 128
10/20
-----
builtins/wait.def
- WAIT_RETURN: set wait_signal_received back to 0 for the potential
next call to wait
quit.h
- CHECK_WAIT_INTR: macro to check whether trap_handler handled a
signal and set wait_signal_received; longjmp to wait_intr_buf in
that case
jobs.c
- wait_for, waitchld: call CHECK_WAIT_INTR at the same places we call
CHECK_TERMSIG to check for terminating signals
- wait_sigint_handler: don't longjmp out of the wait builtin unless
interrupt_immediately is set; otherwise just SIGRETURN from the
handler
- wait_sigint_handler: if interrupt_immediately not set, but we are
executing in the wait builtin and SIGINT is not trapped, treat it
as a `normally received' SIGINT: restore the signal handler and
send SIGINT to ourselves
- waitchld: when in posix mode and running SIGCHLD traps, don't longjmp
to wait_intr_buf (and let wait be interrupted) if we're running from
a signal handler. Wait for CHECK_WAIT_INTR to do the longjmp.
run_pending_traps will run the SIGCHLD trap later
nojobs.c
- reap_zombie_children, wait_for_single_pid, wait_for: call
CHECK_WAIT_INTR where we call CHECK_TERMSIG
- wait_sigint_handler: don't longjmp out of the wait builtin unless
interrupt_immediately is set; otherwise just SIGRETURN from the
handler
trap.c
- trap_handler: make sure wait_signal_received is set if the wait
builtin is executing, and only longjmp if interrupt_immediately is
set. This whole set of fixes was prompted by report from
lanshun zhou <zls.sogou@gmail.com>
10/24
-----
lib/glob/glob.c
- glob_filename: only check directory_name for globbing chars if
it's of non-zero length
lib/sh/strchrnul.c
- new simpler implementation
subst.c
- command_substitute: call set_shellopts after turning off errexit
in subshells so it's reflected in $SHELLOPTS
11/7
----
builtins/evalstring.c
- parse_and_execute: treat ERREXIT case like reader_loop does: set
variable_context to 0 before longjmping back to top_level. Don't
run the unwind-protect context to avoid side effects from popping
function contexts. Part of fix for problem reported by Nikolai
Kondrashov <nikolai.kondrashov@redhat.com>
execute_cmd.c
- execute_simple_command: call unlink_fifo_list only if this is the
last element of a pipeline (or not in a pipeline), rather than for
every child. Fixes difference in behavior between /dev/fd and
FIFOs reported by Zev Weiss <zev@bewilderbeest.net>
- execute_null_command: do the same thing in the parent branch after
make_child
11/14
-----
subst.c
- parameter_brace_expand: a variable is null if it's special ($@, $*),
the expansion occurs within double quotes, and the expansion turns
into a quoted null. Fixes debian bug 692447 reported by
Matrosov Dmitriy <sgf.dma@gmail.com>
jobs.c
- run_sigchld_trap: make sure `running_trap' sentinel is set
appropriately
- waitchld: only run the sigchld trap if we're not in a signal
handler, not running a trap, and executing the wait builtin.
Otherwise, queue for later handling. We still run one instance
of the trap handler per exited child. Bulk of fix for bug
reported by Elliott Forney <idfah@cs.colostate.edu>
trap.c
- queue_sigchld_trap: set catch_flag so run_pending_traps notices,
and set trapped_signal_received for completeness. Rest of fix
for bug reported by Elliott Forney <idfah@cs.colostate.edu>
lib/malloc/malloc.c
- block_signals: renamed to _malloc_block_signals, made public
- unblock_signals: renamed to _malloc_unblock_signals, made public
lib/malloc/imalloc.h
- extern declarations for _malloc_{un,}block_signals
lib/malloc/table.c
- mregister_alloc, mregister_free: block signals around table
manipulation
11/15
-----
trap.c
- run_pending_traps: set SIG_INPROGRESS flag around calls to
run_sigchld_handler so other parts of the shell know that the
SIGCHLD trap handler is executing
- run_pending_traps: if we get a situation where we are looking at
running a SIGCHLD trap but the trap string is IMPOSSIBLE_TRAP_HANDLER
and the SIG_INPROGRESS flag is set, just skip it. This is possible
if run_pending_traps is called from a SIGCHLD trap handler run by
run_sigchld_trap
doc/bash.1,lib/readline/doc/{rluser.texi,readline.3}
- corrected description of the effect of `set history-size 0'. Report
from Vesa-Matti J Kari <vmkari@cc.helsinki.fi>
include/stdc.h
- CPP_STRING: new define, replaces __STRING
lib/malloc/{malloc.c,imalloc.h}
- replace __STRING with CPP_STRING
11/16
-----
lib/readline/bind.c
- sv_histsize: if argument evaluates to a value < 0, unstifle the
history
11/22
-----
redir.c
- do_redirection_internal: if we have REDIR_VARASSIGN set in the
redirection flags and we set up `redirector' using fcntl or dup2,
don't add a redirect to make sure it stays open. Let the
script programmer manage the file handle. Fixes bug reported by
Sam Liddicott <sam@liddicott.com>
11/24
-----
jobs.c
- wait_for_any_job: new function, waits for an unspecified background
job to exit and returns its exit status. Returns -1 on no background
jobs or no children or other errors. Calls wait_for with new
sentinel value ANY_PID
- wait_for: changes to handle argument of ANY_PID: don't look up or
try to modify the child struct, only go through the wait loop once.
Return -1 if waitpid returns no children
jobs.h
- ANY_PID: new define
builtins/wait.def
- new option: -n. Means to wait for the next job and return its exit
status. Returns 127 if there are no background jobs (or no
children). Feature most recently requested by Elliott Forney
<idfah@cs.colostate.edu>
doc/{bash.1,bashref.texi}
- document new `wait -n' option
execute_cmd.c
- execute_command_internal: save make_command_string () result in a
temp variable before calling savestring() on it; avoids evaluating
make_command_string() result twice. Fix from John E. Malmberg
<wb8tyw@qsl.net>
11/28
-----
builtins/declare.def
- declare_internal: if an array variable is declared using `declare -a'
or `declare -A', but not assigned a value, set the `invisible'
attribute so the variable does not show up as set. Fix for bug
about variable initialization reported by Tim Friske <me@timfriske.com>
builtins/{mapfile,read}.def
- after calling find_or_make_array_variable, make sure the invisible
flag is turned off, in case the variable was declared previously
using `declare -a' or `declare -A'. Side effect of above change to
declare_internal
subst.c
- shell_expand_word_list: handle the W_ASSNGLOBAL flag and put -g into
the list of options passed to make_internal_declare as appropriate.
Fix for bug reported by Tim Friske <me@timfriske.com>
11/30
-----
test.c
- unary_op: make sure -v and -n check that the variable is not marked
as invisible before calling var_isset. Fix for bug reported by Tim
Friske <me@timfriske.com>
12/2
----
subst.c
- process_substitute: turn off the `expanding_redir' flag, which
controls whether or not variables.c:find_variable_internal uses the
temporary environment to find variables. We want to use the
temp environment, since we don't have to worry about order of
evaluation in a subshell. Fixes bug reported by Andrey Borzenkov
<arvidjaar@gmail.com>
12/4
----
lib/glob/glob.c
- glob_filename: changes to avoid null filenames and multiple entries
returned for patterns like **/** (globstar enabled). Fixes bug
reported by Ulf Magnusson <ulfalizer@gmail.com>
12/10
-----
lib/glob/glob.c
- glob_filename: finish up a series of changes to make globstar-style
globbing more efficient, avoid more duplicate filenames, and be more
compatible with other shells that implement it
o collapse a sequence of **/**/** to one **
o note when the directory name is all ** or ends in ** so we
can treat it specially when the filename is **
All inspired by report from Andrey Borzenkov <arvidjaar@gmail.com>
lib/sh/zread.c
- zreadn: new function, like zread, but takes an additional argument
saying how many bytes to read into the local buffer. Can be used to
implement `read -N' without so many one-byte calls to zreadc. Code
from Mike Frysinger <vapier@gentoo.org>
12/12
-----
lib/glob/sm_loop.c
- PATSCAN (glob_patscan): if passed string already points to end of
pattern, return NULL immediately. Fixes problem with
extglob_skipname reported by Raphaël Droz <raphael.droz@gmail.com>
12/13
-----
execute_cmd.c
- execute_coproc: handle the command's exit status being inverted
(an oversight). Fixes bug reported by DJ Mills
<danielmills1@gmail.com> and Andreas Schwab <schwab@linux-m68k.org>
12/14
-----
lib/readline/readline.c
- bind_arrow_keys_internal: add MINGW key bindings for Home, End,
Delete, and Insert keys. Fix from Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr>
builtins/printf.def
- printf_builtin: '%()T' conversion: if there is no argument supplied,
behave as if -1 had been supplied (current time). ksh93-like feature
suggested by Clark Wang <dearvoid@gmail.com>
doc/{bash.1,bashref.texi}
- document new printf %()T default argument behavior
12/15
-----
lib/readline/display.c
- displaying_prompt_first_line: new variable, indicates whether or
not the first line of output is displaying the prompt. Always true
in normal mode, sometimes false in horizontal scrolling mode
- rl_redisplay: set displaying_prompt_first_line to true unless we
are in horizontal mode; set to false in horizontal mode if the left
margin of the displayed line is greater than the end of the prompt
string
- rl_redisplay: when in horizontal scroll mode, don't adjust
_rl_last_c_pos by the wrap offset unless the line is displaying
a prompt containing invisible chars
- update line: don't adjust _rl_last_c_pos by the wrap offset unless
the line is displaying a prompt containing invisible chars
- update_line: if shrinking the line by reducing the number of
displayed characters, but we have already moved the cursor to the
beginning of the line where the first difference starts, don't
try to delete characters
builtins/read.def
- unbuffered_read: set to 2 if invoked as `read -N'
- if unbuffered_read is set to 2, compute the number of chars we
need to read and read that many with zreadn. Posix mode still
uses zreadintr. Code from Mike Frysinger <vapier@gentoo.org>
doc/{bash.1,bashref.texi}
- read: make it clear that if read times out, it saves any input
read to that point into the variable arguments. Report from
Fiedler Roman <Roman.Fiedler@ait.ac.at>
subst.c
- command_substitute: change direct assignment of exit_immediately_on_error
to use change_flag ('e', FLAG_OFF) instead
flags.c
- use errexit_flag as the variable modified by changes to the -e
option, reflect those changes to exit_immediately_on_error
execute_cmd.c
- execute_builtin: new global variable, builtin_ignoring_errexit, set
to 0 by default and set to 1 if eval/source/command executing in a
context where -e should be ignored
- execute_builtin: set exit_immediately_on_error to errextit_flag
after executing eval/source/command in a context where -e should
be ignored
flags.c
- if builtin_ignoring_errexit is set, changes to errexit_flag are
not reflected in the setting of exit_immediately_on_error. Fixes
bug reported by Robert Schiele <rschiele@gmail.com>
12/23
-----
include/posixjmp.h
- setjmp_nosigs: new define, call setjmp in such a way that it will
not manipulate the signal mask
{expr,test,trap}.c
- setjmp_nosigs: call instead of setjmp; don't need to manipulate
signal mask
builtins/read.def
- read_builtin: setjmp_nosigs: call instead of setjmp; don't need
to manipulate signal mask
builtins/evalstring.c:
- parse_and_execute: setjmp_nosigs: call instead of setjmp; don't need
to manipulate signal mask
- parse_string: setjmp_nosigs: call instead of setjmp; don't need
to manipulate signal mask
- parse_and_execute: save and restore the signal mask if we get a
longjmp that doesn't cause us to return or exit (case DISCARD)
12/24
-----
general.c
- bash_tilde_expand: only set interrupt_immediately if there are no
signals trapped; we want to jump to top level if interrupted but
not run any trap commands
12/25
-----
jobs.c
- run_sigchld_trap: no longer set interrupt_immediately before calling
parse_and_execute, even if this is no longer run in a signal handler
context
input.c
- getc_with_restart: add call to QUIT instead of CHECK_TERMSIG
parse.y
- yy_stream_get: now that getc_with_restart calls QUIT, don't need to
set interrupt_immediately (already had call to run_pending_traps)
execute_cmd.c
- execute_subshell_builtin_or_function,execute_function,execute_in_subshell:
setjmp_nosigs: call instead of setjmp when saving return_catch; don't
need to manipulate signal mask
- execute_subshell_builtin_or_function,execute_in_subshell:
setjmp_nosigs: call instead of setjmp where appropriate when saving
top_level; don't need to manipulate signal mask if we're going to
exit right away
subst.c
- command_substitute: setjmp_nosigs: call instead of setjmp when saving
return_catch; don't need to manipulate signal mask
- command_substitute: setjmp_nosigs: call instead of setjmp where
appropriate when saving top_level; don't need to manipulate signal
mask if we're going to exit right away
trap.c
- run_exit_trap: setjmp_nosigs: call instead of setjmp when saving
return_catch; don't need to manipulate signal mask
- run_exit_trap: setjmp_nosigs: call instead of setjmp where
appropriate when saving top_level; don't need to manipulate signal
mask if we're going to exit right away
- _run_trap_internal: setjmp_nosigs: call instead of setjmp when saving
return_catch; don't need to manipulate signal mask
builtins/evalfile.c
- _evalfile: setjmp_nosigs: call instead of setjmp when saving
return_catch; don't need to manipulate signal mask
builtins/evalstring.c
- evalstring: setjmp_nosigs: call instead of setjmp when saving
return_catch; don't need to manipulate signal mask
shell.c
- main: setjmp_nosigs: call instead of setjmp where appropriate when
saving top_level; don't need to manipulate signal mask if we're
going to exit right away
- run_one_command: setjmp_nosigs: call instead of setjmp where
appropriate when saving top_level; don't need to manipulate signal
mask if we're going to exit right away
- run_wordexp: setjmp_nosigs: call instead of setjmp where
appropriate when saving top_level; don't need to manipulate signal
mask if we're going to exit right away
eval.c
- reader_loop: save and restore the signal mask if we get a longjmp
that doesn't cause us to return or exit (case DISCARD)
12/26
-----
parse.y
- shell_input_line_{index,size,len}: now of type size_t; in some cases
the unsigned property makes a difference
- STRING_SAVER: saved_line_{size,index} now of type size_t
- shell_getc: don't allow shell_input_line to grow larger than SIZE_MAX;
lines longer than that are truncated until read sees a newline;
addresses theoretical buffer overflow described by Paul Eggert
<eggert@cs.ucla.edu>
- set_line_mbstate: size_t changes like shell_getc
- shell_getc: if shell_input_line is larger than 32K, free it and
start over to avoid large memory allocations sticking around
variables.c
- bind_global_variable: new function, binds value to a variable in
the global shell_variables table
variables.h
- bind_global_variable: new extern declaration
builtins/declare.def
- declare_internal: if -g given with name=value, but variable is not
found in the global variable table, make sure to call
bind_global_variable so the variable is created and modified at
global scope. Fixes a bug where declare -g x=y could modify `x'
at a previous function scope
command.h
- W_ASSIGNARRAY: new word flag, compound indexed array assignment
subst.h
- ASS_MKGLOBAL: new assignment flag, forcing global assignment even in
a function context, used by declare -g
execute_cmd.c
- fix_assignment_words: set W_ASSIGNARRAY flag if -a option given to
declaration builtin
subst.c
- do_assignment_internal: explicitly handle case where we are
executing in a function and we want to create a global array or
assoc variable
- shell_expand_word_list: call make_internal_declare if -a option
given to declaration builtin (W_ASSIGNARRAY); handle -g option with
it (W_ASSNGLOBAL). Fixes inconsistency noticed by Vicente Couce
Diaz <vituko@gmail.com>, where declare -ag foo=(bar) could modify
array variable foo at previous function scope, not global scope
12/27
-----
bashline.c
- Minix needs the third argument to tputs to be a void funtion taking
an int argument, not an int-returning function. Fix from
John E. Malmberg <wb8tyw@qsl.net> as part of VMS bash port
12/29
-----
configure.ac,version.c,patchlevel.h
- bash-4.3-devel: new version, new shell compatibility level (43)
subst.c
- parameter_brace_patsub: put the bash-4.2 code back in from the
change of 3/3 that runs the replacement string through quote
removal, make it dependent on shell_compatibility_level <= 42
builtins/shopt.def
- compat42: new shopt option
- set_compatibility_level: change logic to set and unset various
compat variables and shell_compatibility_level
COMPAT
- new documentation for bash-4.3 compatibility changes
doc/{bash.1,bashref.texi}
- compat42: document new shopt option
builtins/shopt.def
- set_compatibility_opts: new function, sets the various shopt
compat variables based on the value of shell_compatibility_level
builtins/common.h
- set_compatibility_opts: new extern declaration
variables.c
- BASH_COMPAT: new special variable; sets the shell compatibility
level. Accepts values in decimal (4.2) or integer (42) form;
Unsetting variable, setting it to empty string, or setting it to
out-of-range value sets the shell's compatibility level to the
default for the current version. Valid values are 3.1/31 through
the current version
- sv_shcompat: new function implementing logic for BASH_COMPAT
variables.h
- sv_shcompat: new extern declaration
doc/{bash.1,bashref.texi}
- BASH_COMPAT: description of new variable
lib/readline/complete.c
- _rl_colored_stats: default back to 0 for 4.3 release branch
1/5/2013
--------
quit.h
- remove spurious call to itrace in CHECK_WAIT_INTR
bashline.c
- bash_event_hook: if we're going to jump to top_level, make sure we
clean up after readline() by calling rl_cleanup_after_signal().
Fixes bug reported against devel branch by Raphaël Droz
<raphael.droz@gmail.com>
- bash_event_hook: reset the event hook before checking for signals
or traps in case we longjmp
doc/{bash.1,bashref.texi}
- small additions to the set -e section to make it more clear that
contexts where -e is ignored extend to compound commands as well
as shell functions
lib/readline/readline.h
- rl_signal_event_hook: new extern declaration
lib/readline/input.c
- rl_signal_event_hook: new variable, hook function to call when a
function (currently just read(2)) is interrupted by a signal and
not restarted
- rl_getc: call rl_signal_event_hook instead of rl_event_hook
lib/readline/doc/rltech.texi
- rl_signal_event_hook: document new function
bashline.c
- changes to set rl_signal_event_hook instead of rl_event_hook
lib/readline/readline.h
- change readline version numbers to 6.3
1/6
---
doc/{bash.1,bashref.texi}
- a couple of changes to the descriptions of the ERR trap and its
effects based on a message from Rob Nagler <nagler@bivio.biz>
1/9
---
expr.c
- expassign: invalidate curlval before freeing and NULLing tokstr to
avoid aliasing issues. Fixes bug reported by Eduardo A. Bustamante
López<dualbus@gmail.com> and Dan Douglas <ormaaj@gmail.com>
braces.c
- array_concat: don't be so aggressive in trying to short-circuit. We
can only short-circuit if we have a single-element array where the
element is an empty string (array[0] == "" array[1] = 0x0). Existing
practice requires us to replicate arrays and prefix or append empty
strings. Fixes bug reported by Eduardo A. Bustamante López
<dualbus@gmail.com>
1/11
----
execute_cmd.c
- execute_builtin: since mapfile uses evalstring() to run its callbacks
internally, just like eval, so it needs to handle the case where the
temp environment given to mapfile persists throughout the entire
set of callback commands. This might be a problem with trap also, but
trap isn't run in the same way. Fixes bug reported by Dan Douglas
<ormaaj@gmail.com>
1/13
----
redir.c
- redirection_error: before expanding the redirection word (if
expandable_redirection_filename returns true), disable command
substitution during expansion. Fixes bug reported by Dan Douglas
<ormaaj@gmail.com>
subst.c
- expand_word_internal: case '\\': if the next character is an IFS
character, and the expansion occurs within double quotes, and the
character is not one for which backslash retains its meaning, add
the (escaped) '\' and the (escaped) character. Fixes bug reported
by Dan Douglas <ormaaj@gmail.com>
1/15
----
builtins/cd.def
- cd_builtin: make sure call to internal_getopt handles -e option.
Fixes bug reported by <mashimiao.fnst@cn.fujitsu.com>
1/17
----
subst.c
- expand_word_list_internal: make sure tempenv_assign_error is
initialized to 0
execute_cmd.c
- execute_simple_command: make sure tempenv_assign_error is reset to 0
after it's tested to see if an error should force the shell to exit.
Fixes problem where a the failure of a tempenv assignment preceding
a non-special builtin `sticks' and causes the next special builtin
to exit the shell. From a discussion on bug-bash started by
douxin <wq-doux@cn.fujitsu.com>
1/20
----
subst.c
- parameter_brace_expand_rhs: call stupidly_hack_special_variables
after assigning with ${param[:]=word} even if IFS is changing.
Suggested by Dan Douglas <ormaaj@gmail.com> [TENTATIVE, needs work
on IFS side effects]
command.h
- W_GLOBEXP (which was unused) is now W_SPLITSPACE (which isn't used
yet)
{execute_cmd,subst,variables}.c
- removed all code that mentioned W_GLOBEXP
- removed mention of gnu_argv_flags and code that set it
1/22
----
subst.c
- param_expand: set W_SPLITSPACE if we expand (unquoted) $* and
IFS is unset or null so we can be sure to split this on spaces
no matter what happens with IFS later
- expand_word_internal: note that param_expand returns W_SPLITSPACE
in the returned word flags and keep track of that state with
`split_on_spaces'
1/23
----
subst.c
- expand_word_internal: if split_on_spaces is non-zero, make sure
we split `istring' on spaces and return the resultant word. The
previous expansions should have quoted spaces in the positional
parameters where necessary. Suggested by Dan Douglas
<ormaaj@gmail.com>
execute_cmd.c
- execute_command_internal: make sure any subshell forked to run a
group command or user subshell at the end of a pipeline runs any
EXIT trap it sets. Fixes debian bash bug 698411
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698411
subst.c
- shell_expand_word_list: fix code that creates args for and calls
make_internal_declare to avoid calling it twice (missing `else'
in 12/26 change)
- do_assignment_internal: fix code from 12/26 change to fix problem
where an existing assoc variable could be converted to an array
without checking `mkassoc'
1/24
----
builtins/evalfile.c
- _evalfile: add missing `close (fd)' calls before returning to
avoid fd leaks. Bug and fix from Roman Rakus <rrakus@redhat.com>
1/25
----
builtins/read.def
- read_builtin: don't try to play tricks with the top of the unwind-
protect stack after read gets a SIGALRM; save input_string to new
memory, run the stack, then restore input_string and assign the
variables. Part of fix for bug reported by konsolebox
<konsolebox@gmail.com>; the rest of the fix is with the changes in
trap and signal handling and doing away with interrupt_immediately
1/26
----
redir.c
- redirection_expand, write_here_string, write_here_document: before
calling any of the word expansion functions, after setting
expanding_redir to 1 (which bypasses the temp environment in the
variable lookup functions), call sv_ifs to reset the cached IFS-
related variables set by subst.c:setifs(). This ensures that
redirections will not get any IFS values that are set in the
temporary environment, as Posix specifies. Then, after the word
expansions, after resetting expanding_redir to 0, call sv_ifs
again to make sure the cached IFS values are set from any
assignments in the temporary environment. We force executing_builtin
to 1 to `fool' the variable lookup functions into using any temp
environment, then reset it to its old value after sv_ifs returns.
This is what allows read() to use the (cached) IFS variables set
in the temp environment. Fixes inconsistency reported by Dan Douglas
<ormaaj@gmail.com>
1/29
----
lib/readline/display.c
- update_line: fix off-by-one error when updating vis_lbreaks array
in a multibyte locale that occurs when moving multibyte chars from
one line down to another. Bug report and fix from Egmont
Koblinger <egmont@gmail.com>
1/30
----
configure.ac
- changed version to 4.3-alpha
redir.c
- redir_open: handle open returning -1/EINTR, which seems to happen
a lot with FIFOs and SIGCHLD, and call QUIT to handle other
signals that can interrupt open(2). Bug report and initial fix
from Mike Frysinger <vapier@gentoo.org>
1/31
----
subst.c
- parameter_brace_expand: make sure to propagate the PF_ASSIGNRHS flag
to parameter_brace_expand_word
- parameter_brace_expand_word: make sure that if the PF_ASSIGNRHS flag
is set and we are expanding ${a[@]} or ${a[*]} we set quoted to
include Q_DOUBLE_QUOTES before calling array_value_internal, mirroring
what we do for $@ and $*. Fixes inconsistency reported by Dan
Douglas <ormaaj@gmail.com>
configure.ac
- use AC_CHECK_TOOL instead of AC_CHECK_PROG to check for ar, since it
will find $host-prefixed versions of utilities. Report and fix from
Mike Frysinger <vapier@gentoo.org>
builtins/setattr.def
- set_var_attribute: check whether bind_variable (called when the
variable whose attributes are being modified is found in the temp
environment) just modified a read-only global variable, and don't
bother marking the temporary variable for propagation if so. The
propagation is superfluous and will result in a strange error
message
2/2
---
variables.c
- initialize_shell_variables: don't try to import function definitions
with invalid names from the environment if already in posix mode,
but create them as (invisible) exported variables so they pass
through the environment. Print an error message so user knows
what's wrong. Fixes bug reported by Tomas Trnka <ttrnka@mail.muni.cz>
2/9
---
builtins/read.def
- sigalrm_seen, alrmbuf: now global so the rest of the shell (trap.c)
can use them
- sigalrm: just sets flag, no longer longjmps to alrmbuf; problem was
longjmp without manipulating signal mask, leaving SIGALRM blocked
quit.h
- move CHECK_ALRM macro here from builtins/read.def so trap.c:
check_signals() can call it
trap.c
- check_signals: add call to CHECK_ALRM before QUIT
- check_signals_and_traps: call check_signals() instead of including
CHECK_ALRM and QUIT inline. Integrating check for read builtin's
SIGALRM (where zread call to check_signals_and_traps can see it)
fixes problem reported by Mike Frysinger <vapier@gentoo.org>
2/12
----
lib/glob/xmbsrtowcs.c
- xdupmbstowcs2: fixed but where end of string was not handled
correctly, causing loop to go past end of string in a bunch of cases.
Fixes bug reported by "Dashing" <dashing@hushmail.com>
2/13
----
builtins/pushd.def
- popd_builtin: treat any argument that isn't -n or of the form
[-+][[:digit:]]* as an error. Fixes problem reported by Bruce
Korb <bruce.korb@gmail.com>
2/14
----
configure.ac
- add check for sig_atomic_t; already a placeholder for it in
config.h.in
2/15
----
subst.c
- do_compound_assignment: don't call assign_compound_array_list with
a NULL variable in case make_local_xxx_variable returns NULL
(it will if you try to shadow a readonly or noassign variable).
Fixes bug reported by Richard Tollerton <rich.tollerton@ni.com>
2/16
----
variables.c
- make_local_variable: print error messager if an attempt is made to
create a local variable shadowing a `noassign' variable. Previously
we just silently refused to do it
trap.[ch]
- get_original_signal: now global so rest of the shell can use it
sig.c
- initialize_shell_signals: install a signal handler for SIGTERM
that does nothing except set a sigterm_received flag instead of
ignoring it with SIG_IGN, as long as SIGTERM is not ignored when
the shell is started. Use get_original_signal early to get the
original handler, since we will do that later anyway
- set_signal_handler: if installing sigterm_sighandler as the SIGTERM
handler, make sure to add SA_RESTART flag to make it as close to
SIG_IGN as possible
sig.h
- sigterm_sighandler: new extern declaration
quit.h
- RESET_SIGTERM: set sigterm_receved to 0
- CHECK_SIGTERM: check sigterm_received; if it's non-zero, treat it
as a fatal signal and call termsig_handler to exit the shell
jobs.c
- make_child: call RESET_SIGTERM just before fork() so we can detect
if the child process received a SIGTERM before it's able to change
the signal handler back to what it was when the shell started
(presumably SIG_DFL). Only has effect if the shell installed
sigterm_sighandler for SIGTERM, interactive shells that were not
started with SIG_IGN as the SIGTERM handler
- make_child: call RESET_SIGTERM in the parent after fork() so the
rest of the shell won't react to it
execute_cmd.c
- execute_simple_command: call CHECK_SIGTERM after make_child in child
to catch SIGTERM received after fork() and before restoring old
signal handlers
- execute_disk_command: call CHECK_SIGTERM after make_child in child
process after restoring old signal handlers and again just before
calling shell_execve. Fixes race condition observed by
Padraig Brady <p@draigbrady.com> when testing with his `timeout'
program
lib/readline/display.c
- open_some_spaces: new function, subset of insert_some_chars that just
opens up a specified number of spaces to be overwritten
- insert_some_spaces: now just calls to open_some_spaces followed by
_rl_output_some_chars
- update_line: use col_temp instead of recalculating it using
_rl_col_width in the case where we use more columns with fewer bytes
- update_line: use open_some_spaces and then output the right number
of chars instead of trying to print new characters then overwrite
existing characters in two separate calls. This includes removing
some dodgy code and making things simpler. Fix from Egmont
Koblinger <egmont@gmail.com>
- use new variable `bytes_to_insert' instead of overloading temp in
some code blocks (nls - nfd, bytes that comprise the characters
different in the new line from the old)
2/18
----
redir.c
- do_redirection_internal: add undoable redirection for the implicit
close performed by the <&n- and >&n- redirections. Fixes bug
reported by Stephane Chazelas <stephane.chazelas@gmail.com>
2/19
----
sig.c
- termsig_handler: an interactive shell killed by SIGHUP and keeping
command history will try to save the shell history before exiting.
This is an attempt to preserve the save-history-when-the-terminal-
window-is-closed behavior
2/21
----
braces.c
- brace_expand: if a sequence expansion fails (e.g. because the
integers overflow), treat that expansion as a simple string, including
the braces, and try to process any remainder of the string. The
remainder may include brace expansions. Derived from SuSE bug
804551 example (https://bugzilla.novell.com/show_bug.cgi?id=804551)
2/23
----
{quit,sig}.h,sig.c
- sigterm_received declaration now in sig.h; type is sig_atomic_t
- sigwinch_received type now sig_atomic_t
- sig.h includes bashtypes.h and <signal.h> if SIG_DFL not defined
(same logic as trap.h) to pick up sig_atomic_t
unwind_prot.c
- include sig.h before quit.h (reverse order)
2/27
----
builtins/shopt.def
- reset_shopt_options: make sure check_window_size is reset to the
default from config.h, not unconditionally to 0
jobs.[ch]
- last_made_pid, last_asynchronous_pid: now volatile. Change from SuSE
jobs.c
- wait_for: if we're using sigaction to install a handler for SIGCHLD,
make sure we specify SA_RESTART
lib/{tilde,readline}/shell.c
- get_home_dir: instead of looking in the password file every time,
look once and cache the result
sig.[ch]
- sigwinch_received, sigterm_received: now `volatile' qualified
sig.c,quit.h
- interrupt_state,terminating_signal: now sig_atomic_t
3/1
---
MANIFEST,examples/*
- removed around 120 files without FSF copyrights; requested by
Karl Berry in early January
3/2
---
lib/malloc/malloc.c
- morecore: only check whether SIGCHLD is trapped if SIGCHLD is defined
doc/bashref.texi
- Fixed most of the examples in the GNU Parallel section to use better
shell idioms following complaints on bug-bash; added a couple of
examples and smoothed out the text
quit.h
- include "sig.h" for sig_atomic_t
lib/readline/display.c
- update_line: when inserting one or more characters at the end of
the display line in a non-multibyte environment, just write from the
first difference to the end of the line and return. We don't have
to adjust _rl_last_c_pos. This is needed to adjust from the old
two-part copy to a single call to _rl_output_some_chars (change of
2/16)
3/4
---
Makefile.in,doc/Makefile.in
- PACKAGE_TARNAME, docdir: new variables substituted by autoconf
- OTHER_DOCS,OTHER_INSTALLED_DOCS: new variables with auxiliary
documentation files to be installed into $(docdir)
- install: add new rule to install $(OTHER_DOCS)
- uninstall: add new rule to uninstall $(docdir)/$(OTHER_INSTALLED_DOCS)
doc/bash.1
- add URL to `POSIX' file in `SEE ALSO' section; put pointer to that
section in --posix and set -o posix descriptions
examples/
- removed around 110 examples at the request of the FSF due to copyright
issues
3/5
---
builtins/setattr.def
- readonly: modified help text slightly to make it clearer that
functions aren't changed or displayed unless the -f option is given.
Report from <gotmynick@gmail.com>
3/9
---
include/typemax.h
- SIZE_MAX: define to 65535 (Posix minimum maximum) if not defined
parse.y
- include "typemax.h" for possible SIZE_MAX definition, make sure we
include it after shell.h
{braces,expr}.c
- include "typemax.h" for possible INTMAX_MIN and INTMAX_MAX definitions
3/10
----
bashline.c
- bash_default_completion: make sure completion type of `!' (same as
TAB but with show-all-if-ambiguous set) and glob-word-completion
sets rl_filename_completion_desired to 0 so extra backslashes don't
get inserted by `quoting' the completion. We can't kill all the
matches because show-all-if-ambiguous needs them. Bug report from
Marcel (Felix) Giannelia <info@skeena.net>
[bash-4.3-alpha frozen]
3/14
----
general.c
- trim_pathname: use memmove instead of memcpy since the source and
destination pathnames may overlap. Report and fix from Matthew
Riley <mattdr@google.com>
3/18
----
configure.ac
- socklen_t is defined as `unsigned int' if configure can't find it
3/20
----
lib/readline/complete.c
- S_ISVTX: since it's not defined on all platforms (Minix), make sure
its use is protected with #ifdef
3/21
----
doc/{bash.1,bashref.texi}
- Added mention of ${!name[@]} and ${!name[*]} expansions to get all
indices of an array. Suggested by Jonathan Leffler
<jonathan.leffler@gmail.com>
3/24
----
subst.h
- SD_IGNOREQUOTE: new define for skip_to_delim; if set, means that
single quotes (for now) will be treated as ordinary characters
subst.c
- skip_to_delim: handle SD_IGNOREQUOTE. no callers use it for now
3/25
----
support/config.{guess,sub}
- updated to versions from autoconf-2.69
3/31
----
lib/sh/shquote.c
- sh_single_quote: short-circuit quoting a single "'" instead of
creating a long string with empty single-quoted strings
parser.h
- DOLBRACE_QUOTE2: new define, like DOLBRACE_QUOTE, but need to single-
quote results of $'...' expansion because quote removal will be
done later. Right now this is only done for ${word/pat/rep}
parse.y
- parse_matched_pair: set state to DOLBRACE_QUOTE2 for pattern
substitution word expansion so we don't treat single quote specially
in the pattern or replacement string
- parse_matched_pair: if we're parsing a dollar-brace word expansion
(${...}) and we're not treating single quote specially within
double quotes, single-quote the translation of $'...' ansi-c
escaped strings. Original report and fix from Eduardo A.
Bustamante López <dualbus@gmail.com>
subst.c
- extract_dollar_brace_string: ${word/pat/rep} scanning now sets the
DOLBRACE_QUOTE2 flag instead of DOLBRACE_QUOTE so we don't treat
single quotes specially within a double-quoted string
execute_cmd.c
- fix_assignment_words: skip over assignment statements preceding a
command word before trying to figure out whether or not assignment
statements following a possible declaration command should be
treated specially. Fixes bug reported by Dan Douglas
<ormaaj@gmail.com>
4/4
---
lib/readline/readline.c
- _rl_dispatch_subseq: only call _rl_vi_set_last (and check whether
the key is a text modification command) if the key sequence length
is 1. That keeps the arrow keys from setting the last command
when called in vi command mode. Fixes bug reported by Ian A.
Watson <watson_ian_a@lilly.com>
4/6
---
lib/readline/bind.c
- rl_parse_and_bind: when parsing a double-quoted string as the value
of a variable, make sure we skip past the leading double quote.
Fix from Andreas Schwab <schwab@linux-m68k.org>
variables.c
- hash_lookup: set new local variable last_table_searched to the table
a successful lookup appears in; tested in make_local_variable to
solve the problem below
- make_local_variable: if we find a variable with the tempenv flag
set at the same `level' as variable_context', but not found in the
temporary_env (temp environment preceding the builtin), return it.
The temp environment preceding the function call has already been
merged (in execute_function) into the list of variable contexts the
function sees as shell_variables by the time this is called. Fixes
inconsistency pointed out by Dan Douglas <ormaaj@gmail.com>
subst.c
- expand_arith_string: expanded out contents of expand_string,
expand_string_internal, expand_string_if_necessary to create a
WORD_DESC and call call_expand_word_internal() on it directly.
We don't want process substitution to be performed ( 1<(2) ) should
mean something different in an arithmetic expression context.
It doesn't work to just turn on the DQUOTE flag, since that means
that things like ${x["expression"]} are not expanded correctly.
Fixes problem pointed out by Dan Douglas <ormaaj@gmail.com>
4/13
----
subst.c
- process_substitute: run the EXIT trap before exiting, as other
shells seem to. Fixes problem pointed out by Dan Douglas
<ormaaj@gmail.com>
lib/readline/readline.c
- readline_internal_setup: call rl_vi_insertion_mode to enter vi
mode instead of rl_vi_insert_mode to avoid resetting the saved last
command information. Posix says that `.' can repeat a command
that was entered on a previous line so we need to save the info.
Fixes bug reported by Ian A. Watson <watson_ian_a@lilly.com>
4/14
----
lib/readline/complete.c
- rl_completion_matches: make sure xrealloc returns something non-null
(can happen when interrupted by a signal) before trying to add
matches to match_list
subst.c
- array_remove_pattern: return NULL right away if array_variable_part
returns an invisible variable
- array_length_reference: handle array_variable_part returning an
invisible variable
- get_var_and_type: handle array_variable_part returning an invisible
variable
4/15
----
execute_cmd.c
- execute_command_internal: make sure to run the EXIT trap for group
commands anywhere in pipelines, not just at the end. From a point
raised by Andreas Schwab <schwab@linux-m68k.org>
variables.c
- bind_int_variable: make sure invisible flag is unset. Fixes problems
like "declare -ai a; : $(( a[4]=4 ));"
arrayfunc.c
- array_variable_part: return variable even if invisible flag set,
callers must handle invisible vars
4/18
----
builtins/set.def
- unset_builtin: if -n flag given, call unset_nameref instead of
unset_variable
variables.c
- find_variable_nameref: print warning message if nameref circular
reference detected, return NULL and let caller deal with it
builtins/declare.def
- declare_builtin: only disallow global references at this point if
we are at the global scope
5/16
----
configure.ac
- update release status to beta
5/23
----
trap.c
- run_pending_traps: save and restore pipeline around calls to
evalstring() in case we get a trap while running a trap. Have to
figure out the recursive running traps issue elsewhere. Fixes
bug reported by Roman Rakus <rrakus@redhat.com>
- run_pending_traps: make sure to set running_trap to the appropriate
signal value when running a trap command
- run_pending_traps: short-circuit immediately if running_trap set
when invoked. Could change this later to only skip if it would
run the same trap as currently being run (running_trap == sig + 1)
configure.ac
- add warning if bison not found
lib/readline/doc/rltech.texi
- new section with an example program illustrating the callback
interface. Suggested by Peng Yu <pengyu.ut@gmail.com>
examples/loadables/Makefile.in
- remove references to `cut' and `getconf', which were removed in
early March
5/28
----
lib/sh/pathphys.c
- sh_realpath: correct inverted two arguments to call to sh_makepath.
Report and fix from Julien Thomas <jthomas@exosec.fr>
6/7
---
execute_cmd.c
- executing_line_number: the else clauses that are conditional on
various options being defined can simply be if clauses -- they are
mutually exclusive and all have `return' in the body. Fixes bug
reported by Flavio Medeiros <flaviomotamedeiros@gmail.com>
6/25
----
lib/readline/readline.c
- readline_internal_setup: only sent the meta-key enable string to the
terminal if we've been told to use one and the terminal has been
successfully initialized (RL_ISSTATE (RL_STATE_TERMPREPPED) != 0).
Suggested by Dan Mick <dan.mick@inktank.com>
lib/readline/signals.c
- _rl_signal_handler: call any defined signal hook after calling
rl_resize_terminal when handling a SIGWINCH. We already have called
the original SIGWINCH handler but will not be resending the signal
to ourselves
6/27
----
lib/readline/doc/history.3, doc/bash.1
- fix description of the `$' modifier to note that it expands to the
last *word*, which is not always the last argument. Report from
ariyetz@gmail.com via gnu.org RT
6/29
----
lib/glob/smatch.c
- glob_asciiranges: initialize to value of GLOBASCII_DEFAULT instead
of 0 (0 if not defined)
configure.ac,config.h.in
- --enable-glob-asciiranges-default: new option, controls the value of
GLOBASCII_DEFAULT; use it to turn globasciiranges shopt option on
by default
doc/bashref.texi
- document new --enable-glob-asciiranges-default configure option
variables.c
- assign_in_env: implement += value appending semantics for assignments
preceding command names
7/4
---
expr.c
- set lasttok = NUM in all of the functions that result in a number,
even if it's a boolean, to avoid errors with constructs like
1 * x = 1, which should be an asignment error. Fixes problem
pointed out by Dan Douglas <ormaaj@gmail.com>
parse.y
- decode_prompt_string: don't bother to call strcpy if
polite_directory_format returns its argument unchanged. It's not
necessary and Mac OS X 10.9 aborts because of a supposed overlapping
string copy. Bug and fix from simon@hitzemann.org
subst.c
- parameter_brace_find_indir: new function, code from
parameter_brace_expand_indir that looks up the indirectly-referenced
variable, but does not expand it
- parameter_brace_expand_indir: call parameter_brace_find_indir to
look up indirected variable reference
- get_var_and_type: call parameter_brace_find_indir if it looks like we
are trying to manipulate an indirect variable reference like
${!b%%foo}. This makes a difference if !b references an array
variable. Bug report from Dan Douglas <ormaaj@gmail.com>
7/6
---
lib/sh/casemod.c
- sh_modcase: make sure argument passed to is_basic is <= UCHAR_MAX,
since cval can convert something to a wchar_t greater than UCHAR_MAX.
Fixes bug reported by Tomasz Tomasik <scx.mail@gmail.com>
7/8
---
lib/readline/history.c
- add_history_time: if history_length == 0, referencing history_length
- 1 will result in an array bounds error, so make history_length be
at least 1 before going on. Fixes bug reported by Geng Sheng Liu
<gsliu.tju@gmail.com>
builtins/setattr.def
- show_func_attributes: display definition (if NODEFS argument is 0) and
attributes for a particular function; used by `declare -fp name'
builtins/declare.def
- declare_internal: call show_func_attributes if -f supplied with -p.
Fixes inconsistency observed by Linda Walsh <bash@tlinx.org>
builtins/common.h
- new extern declaration for show_func_attributes
builtins/read.def
- read_builtin: check the first supplied variable name for validity
before attempting to read any input, since we know we will have to
at least use that one. Don't check any other names yet. Suggested
by jidanni@jidanni.org
7/10
----
redir.c
- do_redirection_internal: when closing a file descriptor with
r_close_this ([n]<&-) count close errors as redirection errors if
errno ends up as EIO or ENOSPC. Originally reported back in April
2012 by Andrey Zaitsev <jstcdr@gmail.com>
7/11
----
redir.c
- do_redirection_internal: before calling check_bash_input, make sure
that we don't call check_bash_input for an asynchronous process that
is replacing stdin with something else. The seek backwards affects
the parent process as well, since parents and children share the
file pointer. Fixes problem originally reported in March 2013 by
Martin Jackson <mjackson220.list@gmail.com>
7/13
----
doc/{bash.1,bashref.texi}
- slight change to add a description of `shopt -o' suggested by Bruce
Korb <bruce.korb@gmail.com>
7/19
----
lib/readline/histfile.c
- history_do_write: if close returns < 0, make sure we restore the
backup history file and return a non-zero value
- history_truncate_file: if write or close return < 0, make sure we
return a non-zero value
[bash-4.3-beta frozen]
7/21
----
lib/readline/isearch.c
- rl_display_search: now takes an entire search context flags word as
the second argument, instead of just reverse flag; changed callers
- rl_display_search: if the search has failed, add `failed ' to the
beginning of the search prompt
- _rl_isearch_dispatch: if the search has failed, display the entire
search string with an indication that the search failed but with the
last matching line. Suggested by jidanni@jidanni.org
command.h
- W_ASSIGNINT: new word flag; used internally for make_internal_declare
and set by fix_assignment_words
execute_cmd.c
- fix_assignment_words: set W_ASSIGNINT if compound assignment and -i
given as option. We don't do anything with the value yet
subst.c
- shell_expand_word_list: rework the way the option list that is
passed to make_internal_declare is created
8/1
---
doc/{bash.1,bashref.texi}
- minor changes to description of $! based on a report from Chris
Down <chris@chrisdown.name>
arrayfunc.c
- assign_array_element_internal: before trying to get an array's max
index to process a negative subscript, make sure the array exists.
Bug report from Geir Hauge <geir.hauge@gmail.com>
8/2
---
arrayfunc.c
- assign_array_element_internal: before using array_max_index() when
processing a negative subscript, make sure the variable is an array.
if it's not, use 0 as array_max_index assuming it's a string.
Fixes bug report from Geir Hauge <geir.hauge@gmail.com>
8/3
---
Makefile.in
- pcomplete.o: add dependency on $(DEFDIR)/builtext.h. Suggested by
Curtis Doty <curtis@greenkey.net>
8/5
---
lib/glob/sm_loop.c
- strcompare: short-circuit and return FNM_NOMATCH if the lengths of the
pattern and string (pe - p and se - s, respectively) are not equal
- strcompare: don't bother trying to set *pe or *se to '\0' if that's
what they already are. Fixes bug reported by Geir Hauge
<geir.hauge@gmail.com>
8/6
---
doc/{bash.1,bashref.texi},builtins/hash.def,lib/readline/doc/rluser.texi
- minor typo changes from Geir Hauge <geir.hauge@gmail.com>
bultins/help.def
- show_longdoc: avoid trying to translate the empty string because it
often translates to some boilerplate about the project and
translation. Report and fix from Geir Hauge <geir.hauge@gmail.com>
8/8
---
builtins/help.def
- help_builtin: try two passes through the list of help topics for each
argument: one doing exact string matching and one, if the first pass
fails to find a match, doing string prefix matching like previous
versions. This prevents `help read' from matching both `read' and
`readonly', but allows `help r' to match everything beginning with
`r'. Inspired by report from Geir Hauge <geir.hauge@gmail.com>
8/13
----
builtins/fc.def
- fc_builtin,fc_gethnum: calculate `real' end of the history list and
use it if -0 is specified as the beginning or end of the history
range to list. Doesn't work for fc -e or fc -s by design. Feature
requested by Mike Fied <micfied@gmail.com>
8/16
----
trap.c
- _run_trap_internal: use {save,restore}_parser_state instead of
{save,restore}_token_state. It's more comprehensive
8/23
----
doc/bash.1
- disown: remove repeated text. Report and fix from Thomas Hood
<jdthood@gmail.com>
8/25
----
lib/readline/rltty.c
- set_special_char: fix prototype (last arg is rl_command_func_t *)
sig.c
- set_signal_handler: return oact.sa_handler only if sigaction
succeeds; if it doesn't, return SIG_DFL (reasonable default). From
https://bugzilla.redhat.com/show_bug.cgi?id=911404
bashline.c
- attempt_shell_completion: fix to skip assignment statements preceding
command name even if there are no programmable completions defined.
From https://bugzilla.redhat.com/show_bug.cgi?id=994659
- attempt_shell_completion: if still completing command word following
assignment statements, do command completion even if programmable
completion defined for partial command name entered so far
8/26
----
pcomplete.c
- pcomp_filename_completion_function: make sure rl_filename_dequoting_function
is non-NULL before trying to call it. Bug and fix from
Andreas Schwab <schwab@linux-m68k.org>
bashline.c
- bash_command_name_stat_hook: if *name is not something we're going
to look up in $PATH (absolute_program(*name) != 0), just call the
usual bash_filename_stat_hook and return those results. This makes
completions like $PWD/exam[TAB] add a trailing slash
9/2
---
builtins/read.def
- read_builtin: before comparing what we read to the delim, make sure
we are not supposed to be ignoring the delimiter (read -N). We
set the delim to -1, but it's possible to read a character whose
int value ends up being between -1 and -128. Fixes bug
reported by Stephane Chazelas <stephane.chazelas@gmail.com>
doc/{bash.1,bashref.texi}
- word splitting: crib some language from Posix to make it clear that
characters in IFS are treated as field *terminators*, not field
*separators*. Addresses issue raised by DJ Mills
<danielmills1@gmail.com>
lib/readline/{util.c,rldefs.h}
- _rl_stricmp,_rl_strnicmp: now take const char * string arguments;
changed prototype declarations
9/5
---
doc/{bash.1,bashref.texi}
- [[: modify description of pattern matching to make it clear that the
match is performed as if the extglob option were enabled. From Red
Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=1002078
9/12
----
lib/readline/isearch.c
- _rl_isearch_dispatch: if we read an ESC and it's supposed to
terminate the search, make sure we check for typeahead with
_rl_pushed_input_available, since installing a hook function causes
typeahead to be collected in `ibuffer' (input.c). If there is any,
make sure we still use the ESC as a prefix character. Bug and fix
from Mike Miller <mtmiller@ieee.org>
9/16
----
builtins/{caller,cd,kill,pushd,wait}.def
- builtin_usage(): make sure call to this sets return status to
EX_USAGE
9/18
----
terminal.c
- rl_change_environment: new application-settable variable; if non-
zero (the default), readline will modify LINES and COLUMNS in the
environment when it handles SIGWINCH
- _rl_get_screen_size: if rl_change_environment is non-zero, use setenv
to modify LINES and COLUMNS environment variables
readline.h
- rl_change_environment: new extern declaration for applications
9/22
----
configure.ac
- relstatus: bumped version to bash-4.3-beta2
9/24
----
lib/readline/readline.c
- bind_arrow_keys_internal: added more key bindings for the numeric key
pad arrow keys on mingw32. Patch from Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr>
10/19
-----
bashline.c
- maybe_restore_tilde: version of restore_tilde that honors `direxpand';
calls restore_tilde after saving directory expansion hook if
necessary. Report from Andreas Schwab <schwab@linux-m68k.org>
builtins/cd.def
- -@: new option, allows cd to use `extended attributes' present in
NFSv4, ZFS; idea taken from ksh93. Attributes associated with a
file are presented as a directory containing the attributes as
individual files. Original patch contributed by Cedric Blancher
<cedric.blancher@gmail.com>
10/20
-----
aclocal.m4
- BASH_CHECK_MULTIBYTE: check for wcwidth being broken with unicode
combining characters needs a value to use when cross-compiling.
Bug report from Bert Sutherland <bertsutherland@gmail.com>
doc/{bash.1,bashref.texi}
- document new -@ option to cd builtin
10/28
-----
lib/glob/{{gmisc,glob}.c,glob.h}
- extglob_pattern renamed to extglob_pattern_p, declared in glob.h
subst.c
- expand_word_internal: typo fix: case to fix " $@\ " bug in bash-4.2
had a typo (& isexp instead of &&)
10/29
-----
input.c
- getc_with_restart: make sure local_index and local_bufused are
reset to 0 before returning EOF, in case we are running an interactive
shell without line editing and ignoreeof is set. Report and fix
from Yong Zhang <yong.zhang@windriver.com>
lib/readline/search.c
- _rl_nsearch_init: take out extra third argument to rl_message; it
only matches prototype (and maybe format) in cases where
PREFER_STDARG and USE_VARARGS are both undefined, which is rare
10/31
-----
subst.c
- process_substitute: when opening the named pipe in the child, open
without O_NONBLOCK to avoid race conditions. Happens often on AIX.
Bug report and fix from Michael Haubenwallner
<michael.haubenwallner@salomon.at>
builtins/ulimit.def
- RLIMIT_NTHR: if RLIMIT_PTHREAD is not defined, but RLIMIT_NTHR is,
use RLIMIT_NTHR (NetBSD)
11/5
----
locale.c
- set_default_locale_vars,set_locale_var: if TEXTDOMAINDIR has been
set, and default_dir has a non-null value, call bindtextdomain(3)
when TEXTDOMAIN is assigned a value. Fixes problem reported by
Michael Arlt <qwertologe@googlemail.com>
11/6
----
builtins/cd.def
- cdxattr: only create synthetic pathname in `buf' if NDIRP argument
is non-null
- change_to_directory: if we have specified -@ and cdxattr returns
failure, fail immediately. Fixes bug reported by Joshuah Hurst
<joshhurst@gmail.com>
11/12
-----
redir.c
- print_redirection: change r_err_and_out (&>) and its append form,
r_append_err_and_out (&>>) cases to separate redirection operator
from filename by a space, in case we have a process substitution.
Fixes bug reported by admn ombres <admn.ombres@gmail.com>
11/15
-----
execute_cmd.c
- execute_simple_command: don't close process substitution fds until
we are finished executing any current shell function. Partial fix
for bug reported by John Dawson <john.dawson@gmail.com>
support/shobj-conf
- add support for Darwin 13 (Mac OS X 10.9, Mavericks). Based on a
report by Ludwig Schwardt <ludwig.schwardt@gmail.com>
11/20
-----
[bash-4.3-rc1 frozen]
11/24
-----
builtins/printf.def
- bind_printf_variable: make sure that the variable assigned to is
no longer marked as invisible. Fixes bug reported by NBaH
<nbah@sfr.fr>
11/28
-----
jobs.c
- delete_old_job: fix off-by-one error in job index in call to
internal_warning. Bug report from Peter Cordes <peter@cordes.ca>
11/30
-----
doc/bashref.texi
- add string to description of special parameters with name of
special parameter prefixed by a $, so you can search for $#,
for instance
12/2
----
lib/readline/{histexpand.c
- get_history_event: account for current_history() possibly returning
NULL. Report and fix from Pankaj Sharma <pankaj.s01@samsung.com>
12/11
-----
lib/readline/parse-colors.c
- get_funky_string: don't call abort if we see something we can't
parse; just return an error
- _rl_parse_colors: if we encounter an error while parsing $LS_COLORS
we need to leave _rl_color_ext_list as NULL after freeing its
elements, then turn off _rl_colored_stats. Report and fix from Martin
Wesdorp <mwesdorp@casema.nl>
12/13
-----
lib/readline/parse-colors.c
- _rl_parse_colors: if we encounter an unrecognized prefix, throw an
error but try to recover and go on to the next specification
variables.c
- make_local_variable: for new variables this function creates, set
the att_invisible attribute. All callers from declare_internal.
Indirectly, this is a fix for bug with `declare -n var; var=foo;'
reported by Pierre Gaston <pierre.gaston@gmail.com>
- bind_variable: if assigning to nameref variable that doesn't have
a value yet (e.g., with `declare -n var; var=foo'), don't try to
use the unset name. Fixes a segfault reported by Pierre Gaston
<pierre.gaston@gmail.com>
execute_cmd.c
- execute_command_internal: make sure last_command_exit_value is set
to 0 after any command executed in the background. Fixes bug
reported by Martin Kealey <martin@kurahaupo.gen.nz>
12/17
-----
support/config.{guess,sub}
- updated to latest versions from git
12/19
-----
parse.y
- struct STRING_SAVER: now has a new `flags' element, to identify the
caller: alias expansion, double-paren parsing, or parse_and_execute
- push_string: now sets flags to PSH_ALIAS if `ap' argument is non-NULL
- push_string: now doesn't attempt to call strlen on a NULL string to
set shell_input_line_size
- parser_expanding_alias, parser_save_alias, parser_restore_alias: new
functions to provide an external interface to push_string and
pop_string; parser_save_alias sets flags element to PSH_SOURCE (could
be renamed PSH_EXTERN someday)
- shell_getc: when yy_getc returns '\0', instead of just testing
whether the pushed_string_list is not-empty before popping it, don't
pop if if the saved string has flags PSH_SOURCE, indicating that
parse_and_execute set it before setting bash_input to the string.
We should continue reading to the end of that string before popping
back to a potential alias. Partial solution for the problem of aliases
with embedded newlines containing `.' commands being executed out of
order reported by Andrew Martin <andrew.martin@gmail.com>
- shell_getc: when yy_getc returns '\0' and there is a saved string of
type PSH_SOURCE, restart the read without popping the string stack
if we have not read to the end of bash_input.location.string. Rest
of fix for out-of-order execution problem
externs.h
- parser_expanding_alias, parser_save_alias, parser_restore_alias: new
extern function declarations
builtins/evalstring.c
- pe_prologue: if the parser is expanding an alias, make sure to add
an unwind-protect to restore the alias; undoes the work that will be
performed by parse_and_execute/parse_string
- parse_and_execute,parse_string: after calling push_stream to save
bash_input, check whether or not the parser is currently expanding
an alias (parser_expanding_alias() != 0). If it is, we want to save
that string in the pushed_string_list, which we do with
parser_save_alias.
12/23
-----
execute_cmd.c
- execute_for_command: make sure to set line_number before expanding
the word list, so expansion errors have the right line number.
From a report from Ben Okopnik <ben@okopnik.com>
expr.c
- exp2: save token pointer before calling readtok(), arrange to use
saved token pointer when printing error token on a division by 0
error
12/27
-----
lib/readline/display.c
- rl_redisplay: when calculating effects of invisible characters in a
prompt that is split across physical screen lines to set the indices
of linebreaks, don't bother testing local_prompt_prefix (line 751).
That prefix doesn't matter when calculating prompt visible and
invisible characters. Fixes problem reported by Jinesh Choksi
<jinesh@onelittlehope.com>
Makefile.in
- install: make sure to use $(DESTDIR) when installing OTHER_DOCS.
Report and fix from Matthias Klose <doko@debian.org>
doc/texinfo.tex
- updated to version of 2013-09-11
12/28
-----
lib/readline/undo.c
- rl_do_undo: if we are undoing from a history entry (rl_undo_list ==
current_history()->data), make sure the change to rl_line_buffer is
reflected in the history entry. We use the guts of
rl_maybe_replace_line to do the work. Fixes problem reported by
gregrwm <backuppc-users@whitleymott.net>
12/30
-----
sig.c
- sigint_sighandler: if we get a SIGINT (and this signal handler is
installed) while the wait builtin is running, note that we received
it in the same way as jobs.c:wait_sigint_handler and return. The
various wait_for functions will look for that with CHECK_WAIT_INTR.
This fixes the wait builtin not being interruptible in an interactive
job control shell
12/31
-----
trap.c
- set_signal_hard_ignored: rename set_signal_ignored to this, since it
both sets original_signals[sig] and sets the HARD_IGNORE flag
- set_signal_ignored: new function, now just sets original_signals[sig]
trap.h
- set_signal_hard_ignored: new external declaration
sig.c
- initialize_terminating_signals: call set_signal_hard_ignored instead
of set_signal_ignored for signals with disposition SIG_IGN when the
shell starts
execute_cmd.c
- setup_async_signals: make sure we get the original dispositions for
SIGINT and SIGQUIT before starting the subshell, and don't call
set_signal_ignored because that sets original_signals[sig]. If we
don't, subsequent attempts to reset handling using trap will fail
because it thinks the original dispositions were SIG_IGN. Posix
interpretation 751 (http://austingroupbugs.net/view.php?id=751)
1/2/2014
--------
lib/sh/stringvec.c
- strvec_mcreate, strvec_mresize: versions of create and resize that
use malloc and realloc, respectively, instead of xmalloc/xrealloc
braces.c
- expand_amble,mkseq: use strvec_mcreate/strvec_mresize so we can
catch and handle memory allocation failures instead of aborting
with the xmalloc/xrealloc interface
lib/sh/strdup.c
- strdup replacement function for ancient systems that don't have it
lib/sh/itos.c
- mitos: new function, itos that uses strdup instead of savestring
externs.h
- strvec_mcreate/strvec_mresize: new extern declarations
- mitos: new extern declaration
configure.ac
- bash version moved to 4.3-rc2
1/6
---
doc/bash.1,lib/readline/doc/{rluser.texi,readline.3}
- separate the description of what happens when readline reads the
tty EOF character from the description of delete-char, leaving a
note in the delete-char description about common binding for ^D.
From suggestion by Parke <parke.nexus@gmail.com>
lib/readline/doc/{version.texi,history.3,*.texi}
- updated email addresses and copyright dates
1/7
---
variables.c
- delete_var: new function, just removes a variable from a hash table
and frees it, without doing anything else
- make_variable_value: if we are trying to assign to a nameref variable,
return NULL if the value is null or the empty string or not a valid
identifier
variables.h
- delete_var: new extern declaration
subst.h
- ASS_NAMEREF: new define for assignments, means assigning to a nameref
variable
builtins/declare.def
- declare_internal: if we are creating and assigning to a nameref
variable, make sure the value is a valid variable name (checks done
by make_variable_value via bind_variable_value) and display an
error message, deleting the variable we just created, if it is not.
Fixes bug reported by Peggy Russell <prusselltechgroup@gmail.com>
1/9
---
builtins/declare.def
- declare_internal: turning on nameref attribute for an existing
variable turns off -i/-l/-u/-c attributes (essentially the ones
that cause evaluation at assignment time) for ksh93 compat
builtins/setattr.def
- show_name_attributes: if asked to display attributes and values for
a nameref variable, don't follow the nameref chain to the end. More
ksh93 compat
1/10
----
trap.c
- _run_trap_internal: use {save,restore}_parser_state instead of
{save,restore}_token_state, like in run_pending_traps(); don't
need to save and restore last_command_exit_value as a result
- _run_trap_internal: call {save,restore}_pipeline like in
run_pending_traps()
- run_pending_traps: since we no longer run traps in a signal handler
context, do not block and unblock the trapped signal while the
trap is executing
- run_pending_traps: allow recursive invocations (basically, running
traps from a trap handler) with only a warning if the shell is
compiled in debug mode. If a caller doesn't want this to happen,
it should test running_trap > 0. signal_in_progress (sig) only works
for the signals the shell handles specially
bashline.c
- bash_event_hook: make sure we clean up readline if interrupt_state
is set, not only when SIGINT is not trapped. check_signals_and_traps
will call check_signals, which calls QUIT, which will longjmp back
to top_level, running the interrupt trap along the way. Fixes the
problem of signal handlers being reset out from under readline, and
not being set properly the next time readline is called, because
signals_set_flag is still set to 1. XXX - might need to do this
for other signals too?
1/11
----
subst.h
- SD_GLOB: new define for skip_to_delim; means we are scanning a
glob pattern.
subst.c
- skip_to_delim: if flags include SD_GLOB, assume we are scanning a
glob pattern. Currently only used to skip bracket expressions
which may contain one of the delimiters
1/12
----
subst.c
- parameter_brace_expand: when expanding $@ as part of substring
expansion, pattern substitution, or case modification, don't turn
on the QUOTED_NULL flag. The code that constructs the word to be
returned from expand_word_internal expects a different code path
when $@ is being expanded. Fixes bug reported by Theodoros
V. Kalamatianos <thkala@gmail.com>
1/19
----
subst.c
- list_dequote_escapes: new function; analogue of list_quote_escapes
pathexp.c
- quote_string_for_globbing: fix case where unescaped ^A is last char
in string; need to pass it through unaltered instead of turning it
into a bare backslash
- quote_string_for_globbing: when quoting for regexp matching in [[,
don't treat backslash as a quote character; quote the backslash as
any other character. Part of investigation into reports from
Eduardo A. Bustamante López <dualbus@gmail.com>
1/25
----
builtins/gen-helpfiles.c
- write_helpfiles: add prototype
- make sure to #undef xmalloc/xfree/xrealloc/free if USING_BASH_MALLOC
is defined. the code does not use them, and we don't link against
xmalloc.o. Report from Linda Walsh <bash@tlinx.org>
Makefile.in
- variables.o: add dependency on builtins/builtext.h; helps with
parallel builds. Report from Linda Walsh <bash@tlinx.org>
support/shobj-conf
- darwin: combine the stanzas into one that will not require them to
be updated on each Mac OS X release. Report and fix from Max Horn
<max@quendi.de>
1/27
----
support/shobj-conf
- darwin: changed the install_name embedded into the shared library
to contain only the major version number, not the minor one. The
idea is that the minor versions should all be API/ABI compatible,
and it is better to link automatically with the latest one. Idea
from Max Horn <max@quendi.de>
1/29
----
[bash-4.3-rc2 released]
1/30
----
lib/readline/readline.h
- rl_clear_history, rl_free_keymap: add extern declarations. Report
from Hiroo Hayashi <hiroo.hayashi@computer.org>
general.c
- include trap.h for any_signals_trapped() prototype
lib/sh/unicode.c
- include <stdio.h> for sprintf prototype
1/31
----
execute_cmd.c
- execute_simple_command: only posix-mode shells should exit on an
assignment failure in the temporary environment preceding a special
builtin. This is what the documentation and code comments have
always said
- execute_simple_command: make sure redirection errors, word expansion
errors, and assignment errors to Posix special builtins cause a
non-interactive posix mode shell to exit. Previously the shell
would not exit if the failed special builtin was on the LHS of ||
or &&
pathexp.c
- quote_string_for_globbing: when quoting a regular expression
(QGLOB_REGEXP), allow an unquoted backslash to pass through
unaltered. Don't use it as a quote character or quote it. More
investigation from 1/24 and report by Mike Frysinger
<vapier@gentoo.org>
- quote_string_for_globbing: when quoting a regular expression
(QGLOB_REGEXP), turn CTLESC CTLESC into CTLESC without adding a
backslash to quote it. We should not have to quote it because it is
not a character special to EREs. More investigation from 1/24
lib/glob/glob.c
- glob_testdir: now takes a second flags argument (currently unused);
changed prototype and callers
2/1
---
lib/glob/glob.c
- glob_testdir: if flags argument includes GX_ALLDIRS (globstar), use
lstat so we skip symlinks when traversing the directory tree.
Originally reported by Chris Down <chris@chrisdown.name>
2/2
---
lib/readline/undo.c
- rl_do_undo: make sure CUR is non-zero before dereferencing it to
check cur->data against rl_undo_list. Report and fix from
Andreas Schwab <schwab@linux-m68k.org>
doc/{bash.1,bashref.texi}
- added slight clarifying language to the description of $*,
describing what happens when the expansion is not within double
quotes
2/4
---
test.c
- unary_test: add code to -v case so that it interprets `bare' array
references (foo[1]) and returns true if that index has a value
2/5
---
trap.c
- restore_default_signal: fix SIGCHLD special case for SIG_TRAPPED flag
off but SIG_INPROGRESS mode set and handler IMPOSSIBLE_TRAP_HANDLER;
continue with resetting handler in this case. maybe_set_sigchld_trap
will check these things before resetting sigchld trap from
run_sigchld_trap. Fixes (apparently long-standing?) problem reported
by Alexandru Damian <alexandru.damian@intel.com>
2/6
---
lib/sh/strtrans.c
- ansic_quote: fixed a bug when copying a printable character that
consumes more than one byte; byte counter was not being incremented.
Bug report from jidanni@jidanni.org
2/7
---
input.c
- getc_with_restart: if read(2) returns -1/EINTR and interrupt_state or
terminating_signal is set (which means QUIT; will longjmp out of this
function), make sure the local buffer variables are zeroed out to
avoid reading past the end of the buffer on the next call. Bug report
from Dan Jacobson <jidanni@jidanni.org>
2/9
---
bashline.c
- command_word_completion_function: if a directory in $PATH contains
quote characters, we need to quote them before passing the candidate
path to rl_filename_completion_function, which performs dequoting on
the pathname it's passed. Fixes bug reported by Ilyushkin Nikita
<ilyushkeane@gmail.com>
2/11
----
parse.y
- xparse_dolparen: save and restore shell_eof_token around call to
parse_string, intead of just leaving it set to ')'
- shell_getc: when -v is set, only print the command line when
shell_eof_token is 0, so we don't print it multiple times when
recursively entering the parser to parse $(...) commands. Fixes
bug reported by Greg Wooledge <wooledg@eeg.ccf.org>
[changed release status to 4.3-release]
2/13
----
lib/sh/strtrans.c
- ansic_quote: handle case where mbrtowc reports that the multibyte
sequence is incomplete or invalid. Fixes bug reported by
Eduardo A. Bustamante López <dualbus@gmail.com>
2/14
----
variables.c
- find_variable_nameref_context: fix a problem that caused the loop
to go one context too close to the global context. In some cases,
simple variable assignment would set a variable in the global
context instead of a local context. Bug report from
Geir Hauge <geir.hauge@gmail.com>
2/26
----
[bash-4.3 released]
2/27
----
aclocal.m4
- broken wcwidth check: fix typo reported by David Michael
<fedora.dm0@gmail.com>
2/28
----
support/bashbug.sh
- add ${BUGADDR} to error message printed if sending mail fails
trap.c
- _run_trap_internal: don't call {save,restore}_pipeline if running
DEBUG trap; run_debug_trap calls them itself. Fixes bug reported
by Moe Tunes <moetunes42@gmail.com>
test.c
- unary_test: fix 'R' case by using find_variable_noref instead of
find_variable
- test_unop: add back missing 'R' case. Fixes bug reported by
NBaH <nbah@sfr.fr>
3/2
---
jobs.c
- end_job_control: if job control is active, we changed the terminal's
process group, so make sure we restore it. Fixes bug reported by
Eduardo A. Bustamante López <dualbus@gmail.com>
3/7
---
pcomplete.c
- pcomp_curtxt: new variable, holds the original text to be completed
as passed to the programmable completion code
- pcomp_filename_completion_function: if we are running compgen
(presumably in a shell function completion) and performing readline
completion, check the word being completed. If it's not empty, but
the original word passed to the programmable completion code is an
empty string (""), call a dequoting function if one is available.
This compensates for an assumption in bash-completion. Reported by
Albert Shih <Albert.Shih@obspm.fr>
lib/readline/readline.c
- _rl_dispatch_subseq: when deciding whether or not to set vi mode's
idea of the last command, use whether or not the dispatching keymap
is vi_movement_keymap instead of the key sequence length. The `c',
`d', and `y' commands all take motion commands as `arguments' and
will produce key sequences longer than 1 character. The arrow keys
will end up dispatching out of a different keymap, so the test will
prevent arrow keys from setting the last command (the problem in
bash-4.2). Bug report from Daan van Rossum <daan@flash.uchicago.edu>
lib/readline/vi_mode.c
- _rl_vi_motion_command: convenience function to test whether a key is
a vi-mode motion command
lib/readline/rlprivate.h
- _rl_vi_motion_command: extern declaration
parse.y
- parse_matched_pair: we should not skip processing single quotes in
posix mode if dolbrace_state == DOLBRACE_QUOTE2 (pattern
substitution). Fixes bug reported by David Sines
<dave.gma@googlemail.com>
3/10
----
lib/readline/readline.c
- _rl_dispatch_callback: treat a return value of -1 as the end of
a command dispatch sequence if the current context doesn't
indicate that we're reading a multi-key sequence
((cxt->flags & KSEQ_SUBSEQ) == 0). Turn off the multikey flag
and free the context chain in this case. Fixes one bug reported
by Felix Yan <felixonmars@gmail.com> to bug-readline list
- _rl_dispatch_callback: treat a return value of > 0 the same as 0
and return from the function, since only values < 0 cause us to
simulate recursion. Rest of fix for bug tracked down by
Anatol Pomozov <anatol.pomozov@gmail.com>
3/11
----
execute_cmd.c
- execute_in_subshell: if a longjmp occurs, set result to
EXECUTION_FAILURE only if last_command_exit_value == EXECUTION_SUCCESS;
use value of last_command_exit_value otherwise. Fixes cosmetic
issue reported by Dennis Lambe Jr. <malsyned@malsyned.net>
doc/bash.1
- shell-kill-word and shell-backward-kill-word should be documented
as unbound by default. Report from Oliver Hartley
<ohartley@talktalk.net>
trap.c
- run_pending_traps: save value of $? before running trap commands in
trap_saved_exit_value, like run_exit_trap
- _run_trap_internal: save value of $? before running trap commands in
trap_saved_exit_value, like run_exit_trap
builtins/common.c
- get_exitstat: when running `return' in a trap action, and it is not
supplied an argument, use the saved exit status in
trap_saved_exit_value. Fixes Posix problem reported by
Eduardo A. Bustamante López <dualbus@gmail.com>
3/13
----
lib/sh/shquote.c
- sh_contains_quotes: new function, returns true if a given string
contains any of the shell quote characters (single quote, double
quote, or backslash)
externs.h
- sh_contains_quotes: new extern declaration
pcomplete.c
- pcomp_filename_completion_function: more changes for the benefit of
bash-completion: if the argument is not the same as the original
argument passed to the programmable completion code (pcomp_curtxt),
and we are being run by compgen as part of a completion, dequote the
argument as bash-completion expects. Fix for the complete-word-
with-quoted-special-chars problem with bash-completion
3/17
----
execute_cmd.c
- execute_intern_function: when in posix mode, make defining a function
with the same name as a special builtin a fatal error only when the
shell is not interactive. Interactive shells display an error
message and go on. From a discussion with Doug McIlroy
<doug@cs.dartmouth.edu>
3/18
----
arrayfunc.c
- assign_compound_array_list: when using expand_assignment_string_to_string
to expand the value in a ( [x]=y ) compound assignment, make sure
that we convert 0x0 to "" when expanding [x]= so it doesn't appear as
if the index is unset. Fixes bug reported by Geir Hauge
<geir.hauge@gmail.com>
builtins/common.c
- get_exitstat: update fix of 3/11 to allow the DEBUG trap to use the
current value of $? instead of the value it had before the trap
action was run. This is one reason the DEBUG trap exists, and
extended debug mode uses it. Might want to do this only in Posix
mode
doc/{bash.1,bashref.texi}
- return: add language cribbed from Posix saying what happens when
return is run without an argument from a trap, including the DEBUG
trap exception
3/19
----
lib/glob/gmisc.c
- extglob_pattern_p: make sure ?(patlist) is flagged as an extglob
pattern
lib/glob/glob.c
- extglob_skipname: rewrite to handle patterns that begin but do not
end with an extglob pattern; change test for easy case and loop
through patterns accordingly. Fixes problem with matching filenames
with a leading dot reported by Stephane Chazelas
<stephane.chazelas@gmail.com>
- wextglob_skipname: make analogous changes
3/20
----
Makefile.in
- pass -DDEBUG down to builds in readline and history directories
lib/readline/util.c
- _rl_trace and related functions are now only compiled in if DEBUG
is defined
lib/readline/Makefile.in
- substitute @DEBUG@ and pass -DDEBUG, if necessary, to compilation
in LOCAL_CFLAGS
3/21
----
parse.y
- shell_getc: when checking whether or not to reallocate
shell_input_line to add trailing newline, don't try to subtract from
shell_input_line_size. size_t is unsigned, so if its value is less
than 3 (like, say, 2), size-3 is a very large number and the string
will not be reallocated. Use len+3 > size instead of len > size-3.
Fixes bug reported in
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1295467
3/27
----
lib/readline/display.c
- _rl_clean_up_for_exit: don't bother to call _rl_move_vert to whatever
readline thinks the last displayed line is if it's 0. Two reasons: a
minor optimization, and it protects against unwanted moving if this
function is called twice, as it is when ^C is pressed. Fixes bug
reported by Egmont Koblinger <egmont@gmail.com>
3/28
----
bashline.c
- invalid_completion: new function, used to identify attempts to
complete words that are syntax errors
- attempt_shell_completion: if invalid_completion returns true for a
word in a command position, punt on all completions. Fixes cosmetic
issue reported by Uwe Storbeck <uwe@ibr.ch>
- attempt_shell_completion: add clause so that in_command_position
remains set to 1 for an empty word following a command separator like
(, &, or |
lib/readline/kill.c
- rl_yank, rl_yank_nth_arg_internal: don't return -1 from bindable
functions, return 1 instead
lib/readline/text.c
- rl_rubout, _rl_rubout_char, rl_delete, rl_change_case,
rl_transpose_chars, rl_transpose_words, _rl_set_mark_at_pos,
rl_exchange_point_and_mark, _rl_insert_next, _rl_char_search,
_rl_char_search_internal:
don't return -1 from bindable functions, return 1 instead
lib/readline/vi_mode.c
- rl_vi_end_word, rl_vi_rubout, rl_vi_delete, rl_vi_char_search,
rl_vi_match, _rl_vi_set_mark, _rl_vi_goto_mark:
don't return -1 from bindable functions, return 1 instead
lib/readline/macro.c
- rl_start_kbd_macro, rl_end_kbd_macro:
don't return -1 from bindable functions, return 1 instead
builtins/setattr.def
- set_var_attribute: honor setting of no_invisible_vars when setting
att_invisible on a variable
- include "../flags.h" for no_invisible_vars
builtins/declare.def
- declare_internal: honor setting of no_invisible_vars when setting
att_invisible on a variable
- include "../flags.h" for no_invisible_vars
Makefile.in,builtins/Makefile.in
- make sure declare.o and setattr.o depend on flags.h
execute_cmd.c
- decpoint: new function, returns locale's decimal point or `.' default
- mkfmt: use decpoint() to get decimal point instead of unconditionally
using `.'. Fixes bug reported by Andrey Tataranovich
<tataranovich@gmail.com> in debian bug 741669
4/10
----
lib/readline/rltypedefs.h
- add back old Function/VFunction/etc typedefs, since other packages
(python, samba) use them. Mark as deprecated using gcc and clang
attributes. Report and fix from Max Horn <max@quendi.de>
4/14
----
jobs.c
- run_sigchld_trap: unwind-protect value of this_shell_builtin, since
it matters in some cases whether or not we are running `wait' or
`eval'. Fixes bug reported by Eduardo A. Bustamante López
<dualbus@gmail.com>
4/18
----
shell.h
- sh_parser_state_t: add `need_here_doc' flags member, since
xparse_dolparen (via parse_command) sets it to 0
parse.y
- gather_here_documents: make sure need_here_doc is > 0, since we
don't want to just decrement it forever if it ends up < 0. Partial
fix for bug reported by Jared Yanovich <slovichon@gmail.com>
- {save,restore}_parser_state: save and restore need_here_doc flag.
Rest of fix for bug reported by Jared Yanovich <slovichon@gmail.com>
4/19
----
subst.c
- cond_expand_word: since we are not supposed to be performing word
splitting here, set expand_no_split_dollar_star to 1 in addition to
setting W_NOSPLIT2
- expand_word_internal: if we have a case where we have an unquoted
$@ but we are in a case where we don't want to split (W_NOSPLIT2),
make sure we return a list consisting of a single word with the
arguments separated by spaces and don't do word splitting. Fixes
bug reported by Greg Wooledge <wooledg@eeg.ccf.org> from an IRC
discussion
builtins/hash.def
- print_portable_hash_info: single-quote pathnames and hashed filenames
that contain shell metacharacters. Fixes bug reported by
<g1pi@libero.it> in debian bash bug #739853
4/20
----
lib/readline/display.c
- When using horizontal scrolling, the redisplay code erases too much
of the line containing successful results, so make sure we only
erase to the end of the line after making sure we move the cursor
to the end. Fixes bug reported by <Trond.Endrestol@ximalas.info>
4/23
----
{bashhist,bashline}.c
builtins{bind,help,type}.def
lib/glob/glob.c, lib/intl/{loadmsgcat,localealias}.c,lib/sh/mktime.c
- fixes to memory leaks uncovered by coverity scan
4/24
----
{bashhist,subst,redir,assoc,jobs,array,trap}.c
lib/intl/l10flist.c
builtins/complete.def
- fixes to memory leaks and other resource usage problems uncovered by
coverity scan
redir.c
- do_redirection_internal: if dup2 fails (presumably because of a
resource limit), close the file descriptor we opened before returning
error
4/25
----
config-top.h
- DEFAULT_BASHRC: new define with the name of the default shell
startup file
bashline.c
- bash_directory_completion_matches: don't dequote the directory name.
If rl_completion_found_quote is non-zero, readline will dequote the
filename itself. Fixes bug reported by Clark Wang
<dearvoid@gmail.com>
4/27
----
subst.c
- parameter_brace_expand_rhs: if parameter_brace_find_indir returns
NULL or "", or if it returns something that is not a valid identifier,
report an error and return &expand_wdesc_error so the error can
propagate up. Fixes bug reported by Andre Holzhey
<andre.holzhey@gmx.de>
4/29
----
subst.c
- parameter_brace_substring: don't short-circuit right away if the
value is NULL but we are looking at the positional parameters. Part
of fix for bug reported by Pierre Gaston <pierre.gaston@gmail.com>
- pos_params: if there are no positional parameters, only short-circuit
if we are looking for $1 and above. Rest of fix for bug reported
by Pierre Gaston <pierre.gaston@gmail.com>
subst.h
- SD_NOPROCSUB: new flag for skip_to_delim, means to not allow any
process subsitutions (should not have overloaded SD_NOSKIPCMD)
subst.c
- skip_to_delim: honor SD_NOPROCSUB flag
make_cmd.c
- make_arith_for_expr: set W_NOPROCSUB flag in the created word
- make_arith_for_command: set SD_NOPROCSUB in the flags argument to
skip_to_delim so we don't treat <( or >( as a process substitution
(we won't evaluate them in eval_arith_for_expr anyway). Fixes
bug reported by Pierre Gaston <pierre.gaston@gmail.com>
5/1
---
lib/glob/gmisc.c
- glob_dirscan: new function, takes a pattern and a directory separator
argument and advances the pattern to the last occurrence of the
separator. Like strrchr, but understands extended glob patterns and
uses glob_patscan to skip over them
lib/glob/glob.c
- extglob_skipname: if the extended globbing pattern is invalid, don't
skip the name
- glob_filename: if there is a slash in the pattern to be matched, and
extglob is enabled, use glob_dirscan to find the real last occurrence
of `/' to avoid being confused by slashes in extglob patterns. Fix
for bug reported by Pierre Gaston <pierre.gaston@gmail.com>
5/6
---
variables.c
- make_local_variable: only set the att_invisible attribute if
no_invisible_vars isn't set
- find_variable_for_assignment: new function, intended to be called by
code that eventually wants to assign a value to the variable; will not
skip invisible variables; currently identical to find_variable
- find_variable_no_invisible: new function, finds the first visible
instance of variable with a given name in the variable context chain;
eventually will be used to replace find_variable; separate right now
for testing
variables.h
- find_variable_for_assignment: extern declaration
- find_variable_no_invisible: extern declaration
5/7
---
variables.c
- make_local_variable: don't clear `invisible' attribute if we are
returning an existing local variable at the right context. Let the
upper layers do that. Fixes bug reported by Dan Douglas
<ormaaj@gmail.com>
5/8
---
lib/readline/input.c
- rl_getc: call RL_CHECK_SIGNALS if a read(2) is interrupted (-1/EINTR)
by SIGALRM or SIGVTALRM (placeholder for non-keyboard-generated
signals of interest)
builtins/read.def
- edit_line: call bashline_set_event_hook and
bashline_reset_event_hook around call to readline(), so the right
signal handling happens
- read_builtin: make sure we add an unwind_protect call to
bashline_reset_event_hook. These changes fix bug reported in
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476
bashline.c
- bash_event_hook: make sure we clean up the readline state by calling
rl_cleanup_after_signal if sigalrm_seen is non-zero. The read builtin
sets this when it times out
5/12
----
doc/{bash.1,bashref.texi}
- clarify language to make it clear that changing attributes of a
nameref variable (e.g., export), actually changes the attributes of
the referenced variable. Fixes omission noted by Jeff Haemer
<jeffrey.haemer@gmail.com>
arrayfunc.c
- bind_array_var_internal: make sure ENTRY no longer has invisible
attribute before returning. Fixes bug reported by Geir Hauge
<geir.hauge@gmail.com>
5/22
----
execute_cmd.c
- shell_execve: if execve fails and we return 127 or 126, make sure to
set last_command_exit_value if a call to file_error or report_error
causes the shell to exit. This ensures that the shell exits with
the right value.
6/6
---
shell.c
- drop_priv_mode: print an error message on setuid() failure, optionally
exit if errno == EAGAIN, as it can be on Linux when RLIMIT_NPROC for
the target user is exceeded.
config-top.h
- EXIT_ON_SETUID_FAILURE: new settable define, will cause the shell to
exit if setuid fails with errno == EAGAIN
6/10
----
parse.y
- time_command_acceptable: fix so time is accepted everywhere the
grammar is looking for a `compound_list'. Fixes bug reported by
Dale Worley <worley@alum.mit.edu>
6/12
----
subst.c
- clear_fifo_list: new function, clears FDs associated with open pipes
in current FIFO list without closing the file descriptors. Can
possibly be used when shell_execve fails and the shell jumps back
to top_level and we don't want the shell to close the open FIFOs
each time through the read-execute loop. Bug reported by Harald
Koenig <koenig@tat.physik.uni-tuebingen.de>
6/16
----
builtins/shopt.def
- compat42: make sure the `compat42' option sets the correct variable
for compatibility level. Fixes bug reported by Ondrej Oprala
<ooprala@redhat.com>
support/bashbug.sh
- fix typo when echoing $USAGE. Report from Shantanu Kulkarni
<djbware@shantanukulkarni.org>
execute_cmd.c
- shell_execve: before longjmp back to subshell_top_level, clear out the
FIFO fd list by calling clear_fifo_list so the FDs (which we inherited
from our parent) aren't closed every time through the read-eval loop.
Fix for bug reported by Harald Koenig <koenig@tat.physik.uni-tuebingen.de>
6/18
----
subst.c
- extract_process_subst: add additional argument: xflags, allow callers to
pass flags like extract_command_subst
- extract_process_subst: call xparse_dolparen like command substitution
to avoid problems when parsing commands constructs with embedded open
parens. Fixes bug reported by Tim Friske <me@timfriske.com>
subst.h
- extract_process_subst: modified prototype for extern declaration
6/19
----
execute_cmd.c
- execute_pipeline: if running with lastpipe enabled, make sure that we
check whether or not the job id is valid using INVALID_JOB before
calling job_exit_status. the jobs list can get frozen and unfrozen in
the presence of nested pipelines and loops and wait_for can clear a
job table entry. Fixes bug reported by <scorp.dev.null@gmail.com>
jobs.c
- freeze_jobs_list: now returns old value of jobs_list_frozen; unused at
current time
jobs.h
- freeze_jobs_list: change return value
6/20
----
lib/glob/smatch.c
- MEMCHR: single-byte and wide character defines (memchr/wmemchr)
lib/glob/sm_loop.c
- GMATCH: when the wildcards are the last element of the pattern, make
sure they do not match a string containing a `/' if FNM_PATHNAME is
set in FLAGS
- GMATCH: when recursively calling GMATCH after we see a `*', don't
try to consume the rest of the pattern with `*' if FNM_PATHNAME is
set in FLAGS, just consume up to the next slash and then see whether
or not the rest of the pattern matches. Fixes bug reported by Ian
Kelling <ian@iankelling.org>
- GMATCH: when processing `*' in the pattern, after skipping consecutive
wildcards, if we hit a literal `/' in the pattern and we're looking
for a pathname, skip characters in the string until we find a `/'
(no slash means the match fails), and try to match the rest of the
pattern against the portion of the string after the next `/'. Picked
up from gnulib/glibc
pathexp.c
- split_ignorespec: since split_ignorespec gets globbing patterns,
make sure we call skip_to_delim with the SD_GLOB flag so delimiters
that occur within bracket expressions don't delimit the pattern.
Fixes problem with [[:digit:]] in GLOBIGNORE reported by Ian Kelling
<ian@iankelling.org>
unwind_prot.c
- unwind_protect_tag_on_stack: new function, returns 1 if unwind-protect
frame corresponding to `tag' argument is on unwind-protect stack
unwind_prot.h
- unwind_protect_tag_on_stack: extern declaration
6/30
----
lib/readline/misc.c
- _rl_revert_all_lines: set entry->data to 0 after assigning it to
rl_undo_list to avoid pointer aliasing problems that would result
in entry->line being freed by an undo. The subsequent free would
be a double free. Report and fix from Jared Yanovich
<slovichon@gmail.com>
subst.c
- command_substitute: other shells do not appear to inherit the -v
option when reading and executing command substitutions. Reported
by Ondrej Oprala <ooprala@redhat.com>
7/1
---
config-top.h
- CHECKHASH_DEFAULT: new define that supplies the default value for
check_hashed_filenames (`checkhash' shopt option); still 0 by default
findcmd.c
- check_hashed_filenames: initialize using CHECKHASH_DEFAULT
lib/readline/histexpand.c
- history_expand: double quotes can inhibit recognition of the history
comment character if history_quotes_inhibit_expansion is non-zero
lib/readline/doc/{history.3,hstech.texi}
- history_quotes_inhibit_expansion: expand definition to note that it
inhibits scanning for the history comment character as well; correct
typo to make it clear that it only works on double-quoted strings
lib/sh/zgetline.c
- add new fourth argument: DELIM, allows delimiter to be something
other than newline (if DELIM != '\n', UNBUFFERED_READ should be
non-zero)
- UNBUFFERED_READ is now fifth argument
- check character against DELIM rather than strictly newline
externs.h
- zgetline: change function prototype for extern declaration
builtins/mapfile.def
- mapfile: change calling sequence for zgetline calls
- mapfile_builtin: new -d option: DELIM, like in read builtin
- mapfile_builtin: pass `delim' to mapfile() as new argument; default
to '\n' unless -d option supplied
- mapfile: take new DELIM argument, pass to zgetline
- mapfile: if DELIM != '\n', set unbuffered_read to 1
doc/{bash.1,bashref.texi}
- mapfile: document new `-d DELIM' option
7/5
---
lib/readline/histfile.c
- history_truncate_file: if there is an error writing the truncated
history list back to the history file, use the same strategy as
history_do_write: create a backup file, rename the history file to
the backup file, and restore the original history file from the
backup file name if the write or the close fails. Suggestion from
Chen Gang <gang.chen.5i5j@gmail.com> to bug-readline
execute_cmd.c
- evalnest, evalnest_max: new variables establishing maximum number of
recursive `eval' calls; current max is 4096
- execute_builtin: unwind-protect value of evalnest around calls to
eval builtin. Suggested by Oliver Morais <oliver.morais@gmail.com>
- {initialize_subshell,execute_subshell_builtin_or_function}: reset
evalnest to 0 in a subshell
builtins/setattr.def
- show_name_attributes: show a variable's attributes even if it's
invisible (don't show any value since it has none). This means that
declare -p var will display VAR's attributes even when var marked
as invisible. Feature request from Peggy Russell
<prusselltechgroup@gmail.com>
- show_var_attributes: don't print assignment if array or assoc
attribute is set but variable marked as invisible
tests/array.right
- special note: changed all declare -a output tests because the shell
will no longer print out values for invisible array variables. This
is a change, but one for correctness:
declare -a foo='()'
and
declare -a foo
are not equivalent
7/22
----
subst.c
- parameter_brace_expand: after calling parameter_brace_expand_indir,
turn off the W_ARRAYIND flag in the word it returns, because there
is no way for it to return the index that should be used, and the
rest of the function assumes that IND is valid if W_ARRAYIND is set.
Fixes bug reported by Corentin Peuvrel <cpeuvrel@pom-monitoring.com>
8/2
---
parse.y
- read_token_word: if we read a character that will end a command
substitution, don't skip over quoted newlines when we read an
additional character to figure out whether it's a two-character
token. This lets the higher layers deal with quoted newlines after
the command substitution. Fixes bug reported by EmanueL Czirai
<amanual@riseup.net>
8/11
----
execute_cmd.c
- execute_pipeline: check whether lastpipe_jid corresponds to a valid
job before calling append_process, for the same reason as fix from
6/19. Fixes bug reported by <lolilolicon@gmail.com>
8/12
----
lib/sh/unicode.c
- stub_charset: use strncpy instead of strcpy because we are copying
into a local fixed-length buffer. Fixes vulnerability reported by
<romerox.adrian@gmail.com>
execute_cmd.c
- execute_pipeline: if we don't call append_process, call
wait_for_single_pid to get the status of `lastpid', since that will
check the status of already-reaped processes. Fixes spurious error
message about non-existent process from fix of 8/11
8/15
----
jobs.c
- running_in_background: new variable, keeps track of whether or not we
are running in the background (not perfect yet)
- initialize_job_control: even if we are not turning on job control,
get the terminal pgrp so we can use it later
- {set_job_control,initialize_job_control}: set running_in_background
to 1 if terminal pgrp != shell pgrp
- {stop_pipeline,make_child,wait_for}: if we are running in the
background, don't mess with the terminal's process group; assume that
the parent shell will do that. Fixes bug reported by Greg Wooledge
<wooledg@eeg.ccf.org>
shell.c
- shell_reinitialize: reset running_in_background back to 0
8/24
----
execute_cmd.c
- {execute_connection,execute_command_internal}: make sure that
asynchronous commands always set $? to 0 and are not affected by the
command's exit status being inverted using `!'. Fixes bug reported
by Vincent Lefevre <vincent@vinc17.net>
lib/readline/display.c
- rl_message: call vsnprintf with full msg_bufsiz, since it counts
one fewer than the buffer length passed as an argument. Bug report
and fix from Dylan Cali <calid1984@gmail.com>
8/26
----
builtins/evalstring.c
- evalstring: if CURRENT_TOKEN == yacc_EOF, reset it to newline. This
is instead of calling reset_parser(); that might still be needed.
Fixes bug with eval and a subsequent statement ending with EOF
reported by <jim.avera@gmail.org>
pcomplete.c
- filter_stringlist: when extglob is on, a leading ! in the filter
pattern should be left alone when it introduces a !(pat) pattern;
otherwise it messes up the pattern. Fixes bug reported by David
Korn <dgkorn@gmail.com>
8/27
----
doc/{bash.1,bashref.texi}
- clarify the behavior of bash when given the -c option, since $0 is
technically not a positional parameter. Bug reported by Stephane
Chazelas <stephane.chazelas@gmail.com>
8/28
----
lib/readline/history.c
- add_history: use history_max_entries (if history is stifled) or
DEFAULT_HISTORY_INITIAL_SIZE if not (new define, defaults to 502)
to size the initial allocation of the history array. Assumption
is that this will reduce the number of allocations
8/29
----
execute_command.c:
- sourcenest, sourcenest_max: new variables used to track level of
sourced files and (maybe) one day catch infinite source recursion
- execute_builtin: if current source level exceeds sourcenest_max,
trigger an error and jump back to the top level
- {initialize_subshell,execute_subshell_builtin_or_function}: reset
sourcenest to 0 in a subshell
9/2
---
variables.c
- bind_variable: if a nameref expands to an array reference, make
sure that assign_array_element gets called (maybe even
recursively) instead of bind_variable_internal, so invalid variable
names (like arr[0]) don't get created. Fixes bug reported by
<lolilolicon@gmail.com>
9/3
---
execute_cmd.c
- evalnest_max,sourcenest_max: initialize from EVALNEST_MAX and
SOURCENEST_MAX, respectively. Feature suggested by
<bogun.dmitriy@gmail.com>
config-top.h
- define EVALNEST_MAX and SOURCENEST_MAX to 0
9/6
---
bashline.c
- find_cmd_start: fix to (crudely) deal with >| token; even though
skip_to_delim finds `|' as a delimiter, we call it again and use
what the second call finds. Fixes bug reported by Dan Jacobson
<jidanni@jidanni.org>
findcmd.c
- find_in_path_element: if in posix mode, do not expand a literal
tilde in a $PATH element
doc/bashref.texi
- add change to tilde expansion in $PATH elements to posix mode
description
builtins/common.h
- ISHELP: new define for builtins that do their own option parsing
and don't use internal_getopt(); checks whether argument is --help
- CHECK_HELPOPT: convenience define to help builtins that do their
own option parsing to check for --help with one line of code
- CASE_HELPOPT: convenience define to help builtins that use
internal_getopt() check for --help with one line of code
builtins/help.def
- builtin_help: new function, prints out --help output for current
builtin
builtins/{kill,let,pushd}.def
- add CHECK_HELPOPT to builtins that use ISOPTION; call builtin_help
and return EX_USAGE (kill/let/pushd/popd/dirs)
builtins/{caller,fg_bg}.def
- use CHECK_HELPOPT to recognize --help, since these builtins perform
checks that can cause them to return before calling no_options
(caller/fg/bg)
builtins/{exit,return}.def
- use CHECK_HELPOPT to recognize --help before calling get_exitstat()
(return/exit/logout)
builtins/{break,shift}.def
- use CHECK_HELPOPT to recognize --help before any other checks
(break/continue/shift)
builtins/bashgetopt.h
- GETOPT_EOF: convenience define
- GETOPT_HELP: new define, to indicate internal_getopt saw --help
builtins/bashgetopt.c
- internal_getopt: return GETOPT_HELP for --help
builtins/common.c
- no_options: recognize --help, call builtin_help and return 2
(builtin/eval/source/./times)
builtins/command.def
- use CASE_HELPOPT() to handle --help after calling internal_getopt()
(command)
builtins/{colon,echo,test}.def
- do not recognize --help (:/true/false/echo/test)
9/8
---
sig.c
- termsig_sighandler: if readline is active now, set the bashline event
hook. Old code just set it for interactive shells. Part of fix for
bug reported by <mickael9@gmail.com>
bashline.c
- bash_event_hook: call rl_cleanup_after_signal if terminating_signal
is non-zero, since check_signals_and_traps() will cause the shell to
exit if it is and we want to clean up the readline state first. Rest
of fix for bug reported by <mickael9@gmail.com>
9/9
---
jobs.c
- waitchld: when running the wait builtin in posix mode, with a trap set
on SIGCHLD, use queue_sigchld_trap instead of trap_handler (SIGCHLD),
otherwise you will lose SIGCHLDs when children_exited > 1. Fixes bug
reported by <crispusfairbairn@gmail.com>
builtins/read.def
- read_builtin: if we are changing the tty settings, call
initialize_terminating_signals so we have a chance to catch all
terminating signals and potentially clean up the terminal before
exiting
- read_builtin: tty_modified: new variable, set to 1 if we change the
terminal attributes and have to call ttyrestore() to restore them
- if one of the `reads' returns -1/EINTR due to a terminating signal,
and we have modified the terminal, call ttyrestore before calling
CHECK_TERMSIG
- ttyrestore: set tty_modified to 0 when called
9/10
----
builtins/read.def
- termsave: now global to file so other functions can use it
- read_tty_cleanup: if tty_modified is non-zero, call ttycleanup to
restore old terminal settings and turn off tty_modified
sig.c
- termsig_handler: call read_tty_cleanup if currently executing read
builtin; it does the right thing. Final piece of fix for bug reported
by Jan Rome <jan.rome@gmail.com>
9/11
----
general.c
- printable_filename: general function to return a printable
representation of a string (presumed to be a filename)
general.h
- extern declaration for printable_filename
execute_cmd.c
- execute_disk_command: use printable_filename
builtins/{bind,cd,enable,hash,source}.def
- use printable_filename as appropriate when printing error messages.
From a suggestion by Vincent Lefevre <vincent@vinc17.net>
builtins/bind.def
- use CASE_HELPOPT() to handle --help after calling internal_getopt()
(bind)
9/12
----
builtins/common.h
- SEVAL_FUNCDEF: new flag for parse_and_execute; it means that we only
accept a single function definition command, as when we are importing
functions from the environment
- SEVAL_ONECMD: new flag for parse_and_execute; for future use
builtins/evalstring.c
- parse_and_execute: if the SEVAL_FUNCDEF flag is set, disallow anything
but a function definition command
variables.c
- initialize_shell_variables: don't allow functions with invalid names
to be imported from the environment, even though we still allow them
to be defined
- initialize_shell_variables: when importing function definitions from
the environment, call parse_and_execute with the SEVAL_FUNCDEF flag
to force the command to be just a function definition
subst.c
- param_expand: when expanding a $name variable expansion, make sure that
the variable is visible and set before following the nameref chain
- param_expand: when expanding a $name variable expansion and following the
nameref chain, make sure the resulting variable is visible and set
before using it
9/13
----
variables.c
- initialize_shell_variables: when importing function definitions from
environment, use SEVAL_ONECMD flag for parse_and_execute. Part of
CVE-2014-6271
builtins/evalstring.c
- parse_and_execute: if SEVAL_ONECMD flag set, return immediately after
calling execute_command_internal. Final piece for fix for bug
reported by Stephane Chazelas <stephane.chazelas@gmail.com>. Part of
CVE-2014-6271
9/24
----
parse.y
- reset_parser: reset eol_ungetc_lookahead to 0 here, since we don't want
shell_getc returning it on the next call. Fixes problem reported by
Tavis Ormandy <taviso@cmpxchg8b.com> and Michal Zalewski
<lcamtuf@coredump.cx>. Potentially part of CVE-2014-6271; fix for
CVE-2014-7169
9/25
----
parse.y
- push_heredoc: new function, pushes a here-doc redirection onto
redir_stack handling overflow of redir_stack. Exits on overflow.
Original fix from Florian Weimer <fweimer@redhat.com>. Fix for
CVE-2014-7186
- change straight assignments to redir_stack to call push_redir
- add one to size of word_lineno stack to avoid off-by-one error
below in read_token_word. Overflow just results in line numbers
being wrong. Fix for CVE-2014-7187
9/27
----
{execute_cmd,trap}.c
- changes to make minimal-config builds work again, mostly missing
#ifdefs for optional features
builtins/common.c
- builtin_help: dummy version to be included if HELP_BUILTIN not
defined, for minimal-config builds
variables.c
- initialize_shell_variables: incorporated patches from Florian
Weimer <fweimer@redhat.com> to change the strings bash looks
for when importing shell functions from the environment. It
adds a prefix (BASH_FUNC_) and a suffix (%%) to the name to
mark it as having been created by bash as an exported function.
Fix for remote attacks part of CVE-2014-6271 and CVE-2014-7169
- mk_env_string: takes new argument, indicating whether we are
constructing a function
- mk_env_string: encodes function names as described above, so
initialize_shell_variables can find them
9/28
----
copy_cmd.c
- copy_redirects: before calling savestring on here_doc_eof, make
sure it's not NULL (it could have been the result of a here
document delimited by EOF or EOS). Fixes bug reported by
Michal Zalewski <lcamtuf@coredump.cx>. Fix for CVE-2014-6277
make_cmd.c
- make_redirection: initialize here_doc_eof member to NULL. Rest of
fix for CVE-2014-6277
9/29
----
parse.y
- current_input_line_state: return a sh_input_line_state_t containing
the current shell_input_line and its index and size variables
shell.h
- current_input_line_state: extern declaration
builtins/evalstring.c
- parse_and_execute: call reset_parser() before returning if
SEVAL_ONECMD set. Fixes bug reported by Michal Zalewski
<lcamtuf@coredump.cx> and designated CVE-2014-6278
- parse_and_execute: if we parse a function definition when
SEVAL_FUNCDEF is set, but don't consume the entire passed string,
throw an error, reset the parser, and return. Part of fix for
CVE-2014-6278
- parse_and_execute: if parsing the shell function definition when
SEVAL_FUNCDEF is set transforms the function name (e.g., if it
begins with a newline or begins or ends with whitespace), throw
an error, reset the parser, and return. Fixes bug reported by
Eric Kobrin <ekobrin@akamai.com>
10/2
----
jobs.c
- bgp_prune: don't do anything if bgpids.npid == 0 or
bgpids.list == NULL. This can happen if something gets run before
the job control framework is initialized. Bug report from
<mancha1@zoho.com>
10/3
----
parse.y
- xparse_dolparen: don't set token_to_read to newline after calling
parse_string() and cleaning up when the shell is not interactive. This
makes the parser think it's ok to read new commands even if it's not in
a state where that should be possible. Underlying fix for bug reported
by Michal Zalewski <lcamtuf@coredump.cx> and designated CVE-6278
- parser_remaining_input: new function, returns the portion of
shell_input_line that hasn't yet been read
- current_input_line_state: removed
shell.h
- parser_remaining_input: extern declaration
- current_input_line_state: removed
builtins/evalstring.c
- parse_and_execute: change code that checks whether parse_command has
consumed the entire passed string when SEVAL_FUNCDEF is used to use
parser_remaining_input instead of messing around with (new)
current_input_line_state. Part of fix for CVE-2014-6278
variables.c
- initialize_shell_variables: if we don't call parse_and_execute, free
the temporary string, since parse_and_execute won't. Report and fix
from Eric Kobrin <ekobrin@akamai.com>
10/4
----
print_cmd.c
- print_function_def: when in posix mode, print shell function
definitions as posix specifies them, without the leading
`function' keyword
general.c
- exportable_function_name: return 1 if the passed string can be
added to the environment as an exported function name. Currently
prohibits function names containing `/' and `=' from being
exported
general.h
- exportable_function_name: extern declaration
builtins/setattr.def
- set_or_show_attributes: if exporting a function with export -f,
call exportable_function_name to determine whether the function
should be exported; don't export function if it returns 0
10/7
----
builtins/setattr.def
- set_or_show_attributes: don't show identifiers that are invisible
and imported from the environment, since that combination of
attributes means that the imported variable is not a valid shell
identifier. Report from Stephane Chazelas
<stephane.chazelas@gmail.com>
10/8
----
shell.c
- shell_initialize: set new variable should_be_restricted, which
says whether or not the shell will be a restricted one based on the
shell name; use in calls to initialize_shell_variables (to inhibit
importing shell functions) and initialize_shell_options (to inhibit
parsing $SHELLOPTS) and initialize_bashopts (to inhibit parsing
$BASHOPTS). Report from <paulfm@umn.edu>
10/12
-----
execute_cmd.c
- execute_function: unwind-protect loop_level, set loop_level to 0
when entering a function so break and continue in functions don't
break loops running outside of the function. Fix picked up from
dash via Herbert Xu <herbert@gnodor.apana.org.au>
10/13
-----
doc/Makefile.in
- bashref.pdf: create using texi2dvi --pdf rather than postprocessing
the dvi file, so we have PDF bookmarks and links. Fix from
Siep Kroonenberg <siepo@cybercomm.nl>
10/14
-----
subst.h
- Q_ARITH: new quoting flag. Semantics are per Posix's spec for
arithmetic expansion: act as if string is quoted, but don't treat
double quotes specially (in this case, they will be removed by quote
removal)
- Q_ARRAYSUB: new quoting flag, indicates we are expanding an indexed
array subscript
subst.c
- expand_arith_string: if we are not expanding the string, but we saw
a quote with Q_ARITH specified as one of quoting flags, perform
quote removal even if Q_DOUBLE_QUOTES is specified
- param_expand: change calls to expand_arith_string for $[ and $((
cases to specify Q_ARITH. Now $(( "$x" )) and $(( "x" )) work if x
has a value that evaluates to a valid number, as Posix specifies
- expand_word_internal: add test for quoted&Q_ARITH to the tilde case,
so we continue to perform tilde expansion in arithmetic contexts
- expand_word_internal: if quoted&Q_ARITH, continue processing when we
see a `"', acting as if the double quote isn't present (already
Q_DOUBLE_QUOTED)
arrayfunc.c
- array_expand_index: pass Q_DOUBLE_QUOTED|Q_ARITH|Q_ARRAYSUB as quoted
argument in call to expand_arith_string. This inhibits word
splitting (Q_DOUBLE_QUOTED) while discarding double quotes (Q_ARITH),
identical to the quote flags passed while expanding $(( )) and $[ ].
Q_ARRAYSUB reserved for future use. Fixes problem reported by
Stephane Chazelas <stephane.chazelas@gmail.com>
10/16
-----
subst.c
- parameter_brace_expand_word: if the PF_ASSIGNRHS flag is set and we
are expanding what looks like an array subscripted with @ or *,
make sure the variable we're expanding is actually an array before
we add Q_DOUBLE_QUOTES to the flags. If we don't, things like
scalar[@] will remain quoted. Fixes ubuntu bug 1381567
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1381567
10/17
-----
{jobs,nojobs}.c
- get_original_tty_job_signals: get original signal dispostions for
SIGTSTP, SIGTTIN, SIGTTOU before we start manipulating them in
make_child
- default_tty_job_signals: make sure we set SIGTSTP, SIGTTIN, or
SIGTTOU to SIG_IGN if they were ignored at shell startup instead of
unconditionally setting them to SIG_DFL. Fixes bug reported by
idallen@idallen.ca
jobs.h
- get_original_tty_job_signals: extern declaration
trap.c
- initialize_traps: add call to get_original_tty_job_signals
10/22
-----
subst.c
- expand_string_for_rhs: when expanding in this context (rhs of a word
expansion or pattern removal), we don't perform word splitting, so
we don't want to split $* if IFS is empty. Fixes bug reported by
Stephane Chazelas <stephane.chazelas@gmail.com>
10/23
-----
subst.c
- param_expand: when expanding $* in a pattern context where the
expansion is quoted (Q_PATQUOTE), don't quote the expansion --
the outer quotes don't make the characters in the expansion of
$* special. Posix interp 221. Reported by Stephane Chazelas
<stephane.chazelas@gmail.com>
10/28
-----
lib/readline/bind.c
- enable-bracketed-paste: new bindable variable, enables support for
a terminal's `bracketed paste mode'. Code contributed by
Daniel Colascione <dancol@dancol.org>
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- enable-bracketed-paste: add description
lib/readline/{readline.c,rlprivate.h}
- _rl_enable_bracketed_paste: declarations
- #defines for use by bracketed paste implementation
lib/readline/rltty.c
- rl_prep_terminal: send BRACK_PASTE_INIT string to terminal if we
are supposed to enable bracketed-paste mode; change terminal_prepped
to indicate we sent that string and need to clean up
- rl_deprep_terminal: if terminal_prepped indicates we sent the
bracketed-paste mode init string to the terminal, send the cleanup
string before restoring the terminal modes
lib/readline/kill.c
- rl_bracketed_paste_begin: function to read bracketed paste until
BRACK_PASTE_SUFF; discard the suffix, and insert the rest of the
paste as a single (undoable) object. Bound to BRACK_PASTE_PREF
lib/readline/funmap.c
- bracketed-paste-begin: new bindable command, executes
rl_bracketed_paste_begin
lib/readline/readline.c
- bind_bracketed_paste_prefix: new function, sets up to recognize
the bracketed paste prefix sequence (BRACK_PASTE_PREF) in emacs
keymap and vi insertion keymap
- readline_initialize_everything: call bind_bracketed_paste_prefix
11/1
----
builtins/ulimit.def
- RLIMIT_POSIXLOCKS: now synonym for RLIMIT_LOCKS
- -k: new option: RLIMIT_KQUEUES, max kqueues allocated for this
process
- -P: new option: RLIMIT_NPTS, max number of pseudoterminals available
to this process
doc/{bash.1,bashref.texi}
- document `ulimit -k' option
- document `ulimit -P' option
parse.y
- `timespec list_terminator' production: if the list terminator is `;'
set last_read_token to `;' to allow things like `time ; command' to
time null commands and not throw a syntax error. Patch from
Piotr Grzybowski <narsil.pl@gmail.com>
- `BANG list_terminator' production: do the same thing
variables.c
- sv_optind: use find_shell_variable and get_variable_value so we can
have the variable's context in the case we need to do something
when we are restoring a previous variable context's value
builtins/getopt.h
- sh_getopt_state_t: struct to save sh_getopt's internal state so we
can restore it around function calls in the event that we have a
local copy of OPTIND
builtins/getopt.[ch]
- sh_getopt_{save,restore}_istate: new functions to save and restore
getopt's internal state
- sh_getopt_{alloc,dispose}_istate: new functions to allocate and
deallocate sh_getopt_istate_t objects
execute_cmd.c
- maybe_restore_getopt_state: restore sh_getopt state after executing
function body iff the funtion declared a local copy of OPTIND
- execute_function: save sh_getopt state before executing function body
- execute_function: note in getopt_state->flags whether or not the
function declared a local copy of OPTIND; used by
maybe_restore_getopt_state
- execute_function: maybe restore sh_getopt state before returning via
call to maybe_restore_getopt_state. Fixes bugs with getopts and
state between calls reported in 2011 by Bernd Eggink
<monoped@sudrala.de> and in 2014 by Oyvind Hvidsten
<oyvind.hvidsten@dampir.no>
configure.ac
- enable-function-import: new option, controls whether function imports
are included. Enabled by default. Patch from David Galos
<davegalos@google.com>
config.h.in
- FUNCTION_IMPORT: define controlled by enable-function-import above
variables.c
- initialize_shell_variables: include code to import function
definitions from the environment if FUNCTION_IMPORT is defined
doc/bashref.texi
- --enable_function-import: document new configuration option
11/5
----
lib/readline/history.c
- history_lines_read_from_file: new variable, set by read_history and
read_history_range to the actual number of lines read from the
history file. The value is valid immediately after a call to one
of those functions
- history_lines_written_to_file: new variable, set by write_history,
history_do_write, and history_truncate_file to the actual number of
lines written to the history file. The value is valid immediately
after a call to one of those functions
variables.c
- sv_histsize: set history_lines_in_file after history_truncate_file()
only if hmax < history_lines_in_file (lines we've already read); a
cosmetic change only
bashhist.c
- load_history: set history_lines_in_file after read_history() from
history_lines_read_from_file, since read_history reads all of the
lines from the history file even if it's more than $HISTSIZE
- maybe_save_shell_history: after calling write_history(), set
history_lines_in_file to history_lines_written_to_file, since we
can assume that we read everyhing we just wrote
builtins/history.def
- history_builtin: after calling read_history (history -r), set the
new value of history_lines_in_file, for the same reason as above
- history_builtin: after calling read_history_range (history -n), set
history_lines_in_file from history_lines_read_from_file
11/6
----
lib/readline/histfile.c
- history_truncate_file: since we move the old file to a backup copy
before truncating, make sure the new file is owned by the same uid
as the old
- history_do_write: use chown in the same way as history_truncate_file
11/12
-----
lib/readline/display.c
- expand_prompt: takes a new `flags' argument; only one flag defined
so far: PMT_MULTILINE
- expand_prompt: changed all callers to add new flags argument
- rl_expand_prompt, redraw_prompt: make sure to set PMT_MULTILINE in
FLAGS argument to expand_prompt if expanding parts of a prompt
containing embedded newlines
- expand_prompt: only add mode char to last line of a prompt with
embedded newlines, so mode indicator doesn't get lost and gets
updated properly. Fixes problem reported by Renlin Li
<lirenlin@gmail.com>
11/13
-----
lib/readline/display.c
- prompt_modestr: changed prompt_modechar to return a string denoting
the editing mode; default strings for emacs and both vi modes are
#defines in this file. prompt_modestr takes an argument in which
it returns the length of the mode string
- expand_prompt: if expanding mode strings in the prompt, get the
mode string to use and add it at the beginning of the prompt string,
before expanding it. This will allow future work allowing the mode
string to contain invisible characters
11/15
-----
lib/readline/rlprivate.h
- _rl_{emacs,vi_cmd,vi_ins}_mode_str: extern declarations for
variables to hold current values of user-settable mode strings;
variables to hold lengths
lib/readline/rlconf.h
- defines for default values of the mode strings for each editing mode
and keymap
lib/readline/display.c
- _rl_{emacs,vi_cmd,vi_ins}_mode_str: new variables to hold values of
user-settable mode strings
- _rl_{emacs,vi_cmd,vi_ins}_modestr_len: new variables to hold lengths
of corresponding mode string variables
- prompt_modestr: return appropriate user-settable mode string
variables
lib/readline/bind.c
- {emacs,vi-ins,vi-cmd}-mode-string: new user-settable mode string
variables
- sv_{emacs,viins,vicmd}_modestr: variable handling functions for user-
settable mode string variables. Non-null values are run through
rl_translate_keyseq so users can include invisible character
sequences in the mode strings; null values restore the default
- _rl_get_string_variable_value: handle values for new user-settable
mode string variables. Original code contributed by Dylan Cali
<calid1984@gmail.com>
lib/readline/doc/rluser.texi
- {emacs,vi-ins,vi-cmd}-mode-string: document, including the fact that
you can use \1 and \2 to bracket sequences of non-printing
characters
11/16
-----
lib/readline/history.c
- add_history: replace loop that copies history list down one item
with call to memmove to take advantage of whatever efficiencies
libc can offer. Won't be any slower than current loop
lib/readline/display.c
- rl_redraw_prompt_last_line: new function, calls redraw_prompt if
the prompt contains multiple lines; calls rl_forced_update_display
if not
lib/readline/readline.h
- rl_redraw_prompt_last_line: extern declaration, undocumented in
texinfo manual until I get it a little more work
bashline.c
- bash_execute_unix_command: instead of unconditionally calling
rl_forced_update_display, call rl_redraw_prompt_last_line if we
cleared the last line before executing the command. This keeps
commands that don't display any other output but just manipulate
the contents of the line buffer from redisplaying the prompt lines
before the last newline multiple times. Fixes bug reported by
Jesper Nygards <jesper.nygards@gmail.com> and Rob Foehl
<rwf@loonybin.net>. This means that commands that display output
will *only* display the final line of the prompt
- bash_execute_unix_command: if the command returns 124, we redraw
the line unconditionally, including all lines of the prompt
11/18
-----
builtins/mapfile.def
- mapfile_builtin: don't allow a valid array reference through to
mapfile(), since it will just create a shell variable with that name.
Bug and fix from Eduardo A. Bustamante López <dualbus@gmail.com>
11/19
-----
lib/readline/complete.c
- _rl_colored_completion_prefix: new variable, if non-zero, and color
support is compiled in, and the $LS_COLORS variable exists and
contains color definitions, display any common prefix of a set of
completions in blue when displaying all the possible completions.
Doesn't work with menu-complete, which inserts possible completions
inline
- colored_prefix_start(), colored_prefix_end(): new functions, used to
bracket colored completion prefixes
- fnprint: if prefix_bytes is non-zero, and _rl_colored_completion_prefix
is > 0, display the first PREFIX_BYTES bytes of the word bracketed
by calls to colored_prefix_start and colored_prefix_end
- print_filename: if _rl_colored_completion_prefix is > 0, compute the
length in bytes of the common prefix and pass that to fnprint
lib/readline/readline.c
- readline_initialize_everything: initialize the colors from $LS_COLORS
if _rl_colored_completion_prefix is non-zero
lib/readline/colors.c
- _rl_print_prefix_color: new function, changes text color to that
defined for the common prefix of a set of possible completions
(currently cyan, same as directories); currently uses C_PREFIX,
defined in colors.h as C_DIR
lib/readline/colors.h
- _rl_print_prefix_color: new extern declaration
lib/readline/bind.c
- colored-completion-prefix: new bindable variable, if set, common
prefix of a set of possible completions is displayed in color.
Feature requested by several, most recently by Richard Neill
<rn214@richardneill.org> (in a slightly different form) and
Duy Nguyen <pclouds@gmail.com>
11/20
-----
builtins/printf.def
- printf_builtin: allow null (empty) format strings supplied with
-v var to set `var' to the empty string. That is, printf -v var ""
is now the same as var="". Change suggested by Mike Frysinger
<vapier@gentoo.org>
pathexp.h
- FNMATCH_NOCASEGLOB: macro to decide whether or not to pass
FNM_CASEFOLD flag to strmatch depending on whether glob_ignore_case
is set; analogout to FNMATCH_IGNCASE
pathexp.c
- glob_name_is_acceptable: use FNMATCH_NOCASEMATCH to determine flags
passed to strmatch; if nocaseglob is used to generate glob matches,
it should be used to generate ignored matches
11/21
-----
pcomplete.c
- filter_stringlist: the call to strmatch now honors the setting of
nocasematch. Feature request from Ville Skytta <ville.skytta@iki.fi>
back in 2010
doc/bash.1,lib/readline/doc/rluser.texi
- complete -X: document that filtering the list of possible completions
honors the nocasematch option when performing matching
lib/glob/gmisc.c
- include chartypes.h and strmatch.h for new defines
- match_pattern_{wchar,char}: now take new third FLAGS argument, flags
have same meanings as strmatch(); intent is to handle case
insensitive comparisons under same conditions as strmatch
- FOLD: imported case-folding define from sm_loop.c; wide and single-
byte character versions
- match_pattern_{wchar,char}: use FOLD when comparing characters to
honor FNM_CASEFOLD if set in FLAGS argument
externs.h
- match_pattern_{wchar,char}: updated extern declarations
subst.c
- match_{upattern,wpattern}: update strmatch/wcsmatch calls to include
FNMATCH_IGNCASE in flags argument
- match_{upattern,wpattern}: update match_pattern_{char,wchar} calls
to include FNMATCH_IGNCASE in flags argument (consistent with calls
to strmatch). This makes pattern substitution word expansion honor
nocasematch shell option. Feature requested by Davide Baldini
<baldiniebaldini@gmail.com>
- match_wpattern: make sure to fold case if necessary when doing simple
matching
doc/{bash.1,bashref.texi}
- pattern substitution: updated description to include honoring setting
of nocasematch when performing matching
subst.c
- expand_word_internal: optimize handling of "$@" idiom by calling
list_rest_of_args() and quote_list() directly at the top of the
function instead of going through normal code path
- cached_quoted_dollar_at: WORD_LIST of quoted positional parameters,
used by same code above that optimizes "$@"; if non-null we just
return a copy of the list; if null, we save a copy of the list we
create
- invalidate_cached_quoted_dollar_at: convenience function to allow
other parts of the shell (e.g., remember_args()) to destroy the
cached list of quoted positional parameter when the positional
parameters change
builtins/common.c
- remember_args: call invalidate_cached_quoted_dollar_at()
builtins/shift.def
- shift_builtin: call invalidate_cached_quoted_dollar_at after modifying
dollar_vars[]
builtins/source.def
- maybe_pop_dollar_vars: call invalidate_cached_quoted_dollar_at just
to be safe
11/23
-----
builtins/evalfile.c
- _evalfile: return -1 if errno == ENOENT and the flags don't include
FEVAL_ENOENTOK. If we print an error message we should return an
error
- force_execute_file: new function, reads and executes commands from
a file but returns an error if file doesn't exist
builtins/common.h
- force_execute_file: new extern declaration
shell.c
- main: call start_debugger even if dollar_vars[1] == 0 if the shell
isn't interactive (interactive_shell == 0)
- start_debugger: call force_execute_file instead of maybe_execute_file;
turn off debugging mode if it returns value < 0
11/24
-----
hashlib.h
- DEFAULT_HASH_BUCKETS: doubled to 128, cost in memory use is small but
changes traversal order when not sorting results
11/25
-----
doc/{bash.1,bashref.texi}
- make it clearer, by breaking it out into a separate paragraph, that
referencing an array without a subscript is equivalent to referencing
it with subscript 0
- add text saying that referencing any variable using a valid subscript
is OK
11/28
-----
arrayfunc.c
- bind_array_variable, bind_assoc_variable: allow binding value to a
readonly variable if the ASS_FORCE flag is set in the FLAGS
argument
subst.h
- ASS_FORCE: new assignment flag; means to allow assignment even if
variable is marked readonly
builtins/declare.def
- when assigning a value to an array or assoc variable using
something like `declare -r foo=bar' where foo is an existing array
variable, pass the ASS_FORCE to assign_array_var_from_string so
the assignment is allowed. Fixes debian bug 765759
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765759
builtins/setattr.def
- var_attribute_string: new function to return (as argument) a char
array with attribute flag values for a given variable; returns the
length of the array
lib/sh/shquote.c
- sh_quote_reusable: function returning a version of its string
argument that is quoted for reuse
externs.h
- sh_quote_reusable: extern declaration
builtins/common.h
- MAX_ATTRIBUTES: define used to size arrays for attribute flag
characters
- var_attribute_string: new extern function declaration
subst.c
- array_remove_pattern: fixed a bug where `var' instead of `v' was
tested for invisible attribute
- get_var_and_type: fill in a valid *VARP if returning VT_VARIABLE
because callers may need to use it
- parameter_brace_transform: family of functions to implement the new
mksh-inspired ${param@spec} transformation word expansions. Some
of the operators transform the (expanded) value of the parameter,
the rest expand to information about the parameter itself
(array_transform, parameter_list_transform, list_transform,
string_transform, pos_params_assignment, array_var_assignment,
string_var_assignment)
- parameter_brace_expand: changes to parse the new `@' word expansion
operator and call parameter_brace_transform appropriately
- parameter_brace_expand: make sure we handle ${#@} as we have before
even in the presence of the new `@' operator
variables.c
- push_temp_var: make sure to call bind_variable_internal with the
ASS_FORCE flag so we override readonly variables created with
something like `tempvar=foo declare -r foo'.
- bind_variable_internal: honor ASS_FORCE flag to allow binding even
if a variable is readonly
execute_cmd.c
- struct func_array_state: new state to save state of BASH_LINENO,
BASH_SOURCE, and FUNCNAME during function execution so it can be
restored on a jump to top level
- restore_funcarray_state: new function to restore func_array_state
- execute_function: fill in func_array_state variable, add unwind-
protect to restore it on jump to top level, call explicitly at
end of function if subshell != 0 (may not be necessary, but safe
for now). Fixes bug with local assignments to FUNCNAME reported
by Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
11/29
-----
arrayfunc.c
- assign_compound_array_list: turn off ASS_APPEND flag when processing
each individual assignment inside the parens in var+=(...). The
outer += should not affect assignments to existing subscripts;
those should be treated like usual assignments unless += supplied
inside the parens. Bug report from Maarten Billemont
<lhunath@lyndir.com>, fix from Eduardo A. Bustamante López
<dualbus@gmail.com>
config.h.in
- HAVE_PSELECT: define if pselect(2) available
configure.ac
- check for pselect(2), define HAVE_PSELECT if found
lib/readline/input.c
- rl_getc: use pselect(2) to wait for input ready on readline's
input fd or for a signal to arrive, will handle SIGWINCH (which
does not interrupt read(2)) and thus allow resize to happen without
having to wait to read more input. Only works if pselect available
and returns -1/EINTR on a signal even if the signal was installed
with SA_RESTART. From a suggestion from Egmont Koblinger
<egmont@gmail.com>
12/3
----
variables.c
- flush_temporary_env: new function, disposes all temp variables in
temporary_env hash table
- bind_variable: only try to update a temporary variable's value in the
temporary env if the value argument is not null. Fixes bug reported
by <tangqinghao@360.cn>
variables.h
- flush_temporary_env: new extern declaration
subst.c
- command_substitute: if running command substitution as part of
expanding a redirection (expanding_redir == 1), flush any temporary
environment we've inherited as part of this command, since we are not
supposed to have access to the temporary environment. Since
expanding_redir only controls access to the temporary environment for
variable lookup and binding, we can turn it off in the subshell
12/4
----
builtins/printf.def
- printstr: make sure a missing precision specifier after a `.' is
treated as 0, as printf(3) specifies. Fixes ubuntu bash bug
1399087 (https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1399087)
12/5
----
subst.c
- skip_to_delim: if scanning past process substitution (skipcmd == 1,
noprocsub == 0), use extract_delimited_string instead of
extract_process_subst, which was changed a while back (bash-4.3.23)
to use xparse_dolparen. xparse_dolparen complains if the command
or process substitution is unterminated, since it runs the parser,
which is not what we want here. Command substitution does the same
thing. Fixes bug reported by Daniel Kahn Gillmor
<dkg@fifthhorseman.net> as Debian bash bug 771968
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771968)
12/6
----
subst.c
- command_substitute: short-circuit without forking on a command string
that consists entirely of <blank>s and newlines
jobs.c
- make_child: changes to allow interrupts through if fork fails and
we are sleeping for `forksleep' seconds
- waitchld: make things a little more resilient if CHILD ends up NULL
12/12
-----
lib/readline/complete.c
- rl_display_match_list: when calculating common prefix to display in
color, make sure we correctly handle a common prefix with a trailing
`/' as we do when checking whether or not to add an ellipis.
printable_part() doesn't return the whole pathname if it ends in a
slash, to avoid printing null strings, so we have to make sure we
have the entire prefix
lib/readline/complete.c
- _rl_complete_display_matches_interrupt: new variable, set to 1 by
_rl_complete_sigcleanup to let rl_display_match_list know it has
freed the match list
- display_matches: check for signals during the printing loops with
RL_SIG_RECEIVED(), return immediately if there is a pending signal
(might not want to do this if it's SIGWINCH -- CHECK)
- rl_complete_internal: if _rl_complete_display_matches_interrupt
set after calling display_matches, just null out `matches' since
it's already been freed and call any application-set signal hook
12/14
-----
parse.y
- time_command_acceptable: if the token before a newline is `|',
return 0, since it's not really valid to time inside a pipeline.
Only handles a single newline but allows things like
echo a |
time cat
to invoke /usr/bin/time, which is probably enough to catch the
stray carriage return. Fixes bug reported by Andre Majorel
<aym-ung@teaser.fr>
builtins/declare.def
- declare_internal: don't try to perform compound assignments unless
the WORD_DESC has flags including W_COMPASSIGN (maybe should check
W_ASSIGNMENT as well), avoiding unexpected evaluation if a word
is of the form (word) and is assigned to an array variable like so:
declare -x var=$value. Bug reported by Stephane Chazelas
<stephane.chazelas@gmail.com>. Will eventually be contingent on
compatibility level > 43, but not there yet. TENTATIVE
12/15
-----
lib/sh/Makefile.in
- add missing dependencies for shmatch.o. Pointed out by Sergey
Mikhailov <sergey.mikhailov@gmail.com>
12/16
-----
{execute_cmd,subst}.c
- W_ASSIGNINT: remove, not used any more
execute_cmd.c
- fix_assignment_words: don't look for `-i' option and set W_ASSIGNINT
flag any more; doing things a different way
- shell_expand_word_list: instead of using W_ASSIGNINT flag, since it
doesn't take into account all options that can transform values on
assignment (-l/-u/-c can also), go through option arguments looking
for options that need special handling and add them to the `opts'
array for make_internal_declare to use. Fixes bug with constructs
like `declare -al foo=(UPONE UPTWO UPTHREE)' not being lowercased on
assignment reported by Linda Walsh <bash@tlinx.org>
12/18
-----
lib/readline/readline.c
- rl_internal_char: when we read EOF on a non-empty line, check for
signals and invoke any readline signal handling and any application-
installed signal hook
12/20
-----
lib/readline/readline.c
- rl_internal_char: if we read EOF on a non-empty line, set c to
_rl_eof_char the first time through. If we read EOF the next time,
return EOF from readline(). If callbacks are defined, this returns
EOF immediately, since lastc isn't available. Fix for problem
most recently identified by Jiri Kukacka <jiri.kukacka@orcle.com>,
it has come up in the past
12/21
-----
builtins/declare.def
- declare_internal: keep track of whether or not an assignment statement
argument to declare is an array subscript assignment; need to
differentiate assignments from straight declarations (declare a[4])
which are accepted for backwards compatibility
- assignment statements like declare a[2]=foo are now treated as
straight subscript assignment statements if a already exists as an
array variable
- declare foo='(1 2 3)' is treated as an assignment to foo[0] if foo
exists and is an array, just as it would be if it were an assignment
statement and `declare' was not present. All this from a proposal
by Stephane Chazelas <stephane.chazelas@gmail.com>
12/22
-----
builtins/read.def
- read_tty_modified: function to tell the rest of the shell if the
read builtin has modified the tty
- read_builtin: make sure to initialize terminating signals before
installing a SIGALRM signal handler in case we modify the tty as
well as ask for a timeout; the subsequent call to
initialize_terminating_signals would overwrite the read-builtin-
local SIGALRM handler
builtins/common.h
- read_tty_modified: new extern declaration
shell.c
- exit_shell: if read_tty_modified() returns true, call read_tty_cleanup
to undo the terminal modifications. Extension of previous fixes;
fixes bug with read -s reported by Richard W. Marsden
<richard@marsden.nu>
12/23
-----
builtins/setattr.def
- show_var_attributes: call print_array_assignment and print_assoc_assignment
with a `not quoted' flag so the assignment statements are not
surrounded by single quotes. Caused changes to a lot of test output
12/29
-----
lib/readline/complete.c
- stat_char: Windows doesn't handle X_OK flag to access(2); use file
extensions to determine whether or not a file is executable. Bug
report and fix from Eli Zaretskii <eliz@gnu.org>
configure.ac
- changed version to bash-4.4-devel
lib/readline/readline.h
- changed version to readline-6.4
12/30
-----
readline.h
- struct readline_state: fix types of `ignorefunc' and `attemptfunc'
members
lib/sh/shquote.c,externs.h
- sh_contains_shell_metas, sh_contains_quotes: now take `const char *'
as parameter
stringlib.c,externs.h
- strcreplace: `text' argument now `const char *'
pathexp.[ch]
- quote_globbing_chars: `string' argument now `const char *', accompanying
changes to function local variables
pcomplete.c
- preproc_filterpat: `text' argument now `const char *'
- filter_stringlist: `text' argument now `const char *'
12/31
-----
builtins/evalstring.c
- should_suppress_fork: new function, broke code that decides whether
to turn on CMD_NO_FORK flag out of parse_and_execute into a separate
function
execute_cmd.c
- execute_command_internal: AND_AND, OR_OR: call should_suppress_fork
for the RHS of && and ||, make `make' invocations marginally more
efficient
flags.c
- get_current_flags: returns a bitmap of all single-letter shell
options with a non-zero value meaning option is enabled
- set_current_flags: set current single-letter options from a passed
bitmap, which has presumably been initialized with get_current_flags
flags.h
- {get,set}_current_flags: new extern declarations
builtins/declare.def
- declare_internal: if invoked as `local', interpret name argument of
`-' to mean to save (and restore at shell return) single-letter
shell options
variables.c
- push_func_var: if we encounter `-' as the name of a local variable,
take the value and call set_current_flags on it to restore old
flag settings
builtins/set.def
- get_current_options: returns a bitmap of all shell options settable
with `set', with a non-zero value meaning option is enabled
- set_current_options: set current shell options from a passed
bitmap, which has presumably been initialized with get_current_options
1/1/2015
--------
lib/readline/parens.c
- _rl_blink_matching_paren: initialize to 0 whether or not select(2) is
available. Inconsistency reported by Mark Karpov
<markkarpov@opmbx.org>
builtins/declare.def
- declare_internal: use get_current_options instead of
get_current_flags, so `local -' can be generalized
variables.c
- push_func_var: use set_current_options instead of set_current_flags
so `local -' can be generalized
doc/{bash.1,bashref.texi}
- document new `local -' feature; originally inspired by Robert Elz
<kre@munnari.oz.au> describing feature in NetBSD sh
1/3
---
lib/readline/{complete,funmap,kill,histfile,util}
lib/readline/readline.h
lib/tilde/tilde.c
- fixes for filename- and evironment-related issues on Windows. Fixes
from Eli Zaretskii <eliz@gnu.org>
- Windows can paste to the console from the clipboard like Cygwin
- Windows uses $APPDATA as a pseudo-$HOME
lib/readline/input.c
- rl_getc: use _getch on Windows to avoid being overridden by a getch
ncurses function
- win32_isatty: replace Windows isatty(3) with a function that does
additional checks, sinces Windows isatty returns non-zero for
every character device. From Eli Zaretskii <eliz@gnu.org>
lib/readline/display.c
- delete_chars: if compiled with ncurses on Windows, this code can
work, so build it in if NCURSES_VERSION defined
- open_some_spaces: ditto
1/6
---
doc/{bash.1,bashref.texi}
- minor grammar and typo corrections from TonyMc <afmcc@btinternet.com>
1/8
---
sig.c
- throw_to_top_level: only attempt to run the interrupt trap if SIGINT
is trapped -- minor optimization
- throw_to_top_level: if we are running a trap, call run_trap_cleanup
to turn off the sigmodes flags
trap.c
- _run_trap_internal: temporarily suppress pending SIGINTs while running
one of the traps the shell handles internally (e.g., ERR). Fixes bug
reported by Keith Thompson <keithsthompson@gmail.com>
1/10
----
bashhist.c
- bash_history_inhibit_expansion: use skip_to_delim with the history
expansion character to see whether or not the instance of the
history expansion character should be skipped because, for instance,
it is in a command substitution. Fixes issue reported by
Zigmund.Ozean@zig-home.localdomain
1/14
----
lib/readline/isearch.c
- _rl_isearch_dispatch: if we are in a multibyte locale, make sure to
use _rl_find_prev_mbchar when trying to delete characters from the
search string, instead of just chopping off the previous byte.
Fixes bug reported by Kyrylo Shpytsya <kshpitsa@gmail.com>
lib/readline/complete.c
- rl_filename_completion_function: if we tilde-expand `dirname', make
sure we use the expanded result instead of throwing it away for the
quote-removed `users_dirname', which still has any leading tilde.
Fixes bug reported by Dave Rutherford <dave@evilpettingzoo.com>
execute_cmd.c
- select_query: if the read builtin doesn't return anything in REPLY,
return NULL (failure). Fixes bug reported by Etherial Raine
<osirisgothra@hotmail.com>
builtins/read.def
- read_builtin: if REPLY has the readonly or noassign attribute, return
failure
1/16
----
redir.c
- redir_open: if open() returns -1/EINTR, check traps as well as
using QUIT to handle signals
1/18
----
jobs.c
- wait_for: make sure queue_sigchld is set to 1 before unblocking
SIGCHLD if MUST_UNBLOCK_CHLD is defined
1/19
----
pcomplete.h
- new progcomp option: COPT_NOSORT, means to not sort list of possible
completions
pcomplete.c
- pcomp_set_readline_variables: if COPT_NOSORT set in compspec flags,
set rl_sort_completion_duplicates to 0
builtins/complete.def
- _compopt: new option value: -o nosort, sets COPT_NOSORT in compspec
option flags. Provides new -o nosort option for complete and compgen
bashline.c
- attempt_shell_completion: make sure rl_sort_completion_matches is
set to 1 before completion is attempted; allow a compspec to turn
it off
lib/readline/kill.c
- rl_vi_yank_pop: new function, vi-mode version of yank-pop. Original
code from Ian Kelling <ian@iankelling.org>
lib/readline/funmap.c
- `vi-yank-pop': bindable name mapped to rl_vi_yank_pop
lib/readline/readline.h
- rl_vi_yank_pop: extern declaration
1/21
----
lib/sh/shquote.c
- sh_backslash_quote: change to understand and handle multibyte
characters, using is_basic, COPY_CHAR_P. See
https://bugzilla.redhat.com/show_bug.cgi?id=1184320 for original
report
1/23
----
include/posixjmp.h
- use setjmp_sigs instead of redefined setjmp, it fails on Cygwin.
Report from Eric Blake <eblake@redhat.com>
builtins/wait.def,shell.c
- use setjmp_sigs instead of setjmp call, since setjmp no longer
redefined to something known
include/chartypes.h, lib/readline/chardefs.h
- make sure all ctype.h macros are called with unsigned char args,
casting to make sure
lib/sh/casemod.c
- sh_modcase: don't assume that the upper and lower case versions of a
character are the same width, so don't try to do the conversion in
place: convert and copy the converted characters one or more at a
time to the returned string
- sh_modcase: since upper and lower case versions of same character
may have different widths in some locales, don't shortcut and assume
that we can do single-byte case modification (toupper) with a
single-byte input character (e.g., `i'). Fix for problem reported
by Stephane Chazelas <stephane.chazelas@gmail.com>
1/31
----
lib/readline/histfile.c
- history_truncate_file, history_do_write: if the first rename(2)
of the history file to the backup file fails, set the backup file
name to NULL to prevent any later attempts to restore the
original. Report from Jonathan Hankins <jhankins@homewood.k12.al.us>
- history_do_write: don't attempt to back up non-regular files.
Report from Jonathan Hankins <jhankins@homewood.k12.al.us>
2/2
---
trap.c
- run_interrupt_trap: now takes an argument indicating whether or not
it was called just before a longjmp to top_level; change callers
- run_interrupt_trap: if running a trap and we are being called before
a longjmp to top_level, call run_trap_cleanup on running trap so
a QUIT call while running a DEBUG trap, for instance, doesn't leave
sigmodes[DEBUG_TRAP] including SIG_INPROGRESS. Fixes bug reported
by Chih-Chieh Chou <ccchou@gmail.com>
sig.c
- throw_to_top_level: change call to run_interrupt_trap to pass arg 1
- termsig_handler: change call to run_interrupt_trap
trap.h
- run_interrupt_trap: update extern prototype declaration
2/4
---
lib/readline/histfile.c
- histfile_backup, histfile_restore: new functions to back up and restore
history file to `filename-', following (one level of) symlinks through
so we don't rename the symlink itself. From a suggestion by
Jonathan Hankins <jhankins@homewood.k12.al.us>
assoc.c
- assoc_to_assign: if an index happens to be `@' or `*', make sure it's
double-quoted. Bug report from Greg Wooledge <wooledg@eeg.ccf.org>
2/5
---
lib/readline/bind.c
- rl_bind_key: if we are rebinding a key that is not bound to a
function or a macro, construct a key sequence and pass it to
rl_bind_keyseq. Make sure that '\' when it is used as a key is
changed to "\\" so it can survive rl_translate_keyseq. Fixes
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776743
2/8
---
include/posixjmp.h
- _rl_longjmp, sh_longjmp: new defines, expand to siglongjmp or longjmp
depending on autoconf results, used to avoid redefining longjmp,
remove _OPENNT conditional code. Report from Eric Blake
<eblake@redhat.com>
{bashjmp,quit}.h,{execute_cmd,expr,jobs,sig,trap}.c,builtins/{evalstring.c,return.def}
- change calls to longjmp to use sh_longjmp
lib/readline/util.c
- change calls to longjmp to use _rl_longjmp
2/18
----
variables.c
- bind_int_variable: make sure `v' is non-null before making it visible
2/19
----
arrayfunc.c
- assign_array_var_from_word_list: after assignment, mark variable as no
longer invisible
- assign_array_var_from_string: after assignment, mark variable as no
longer invisible
builtins/declare.def
- declare_internal: add warning if an attempt is made to use a quoted
compound assignment as an argument to declare (declare -a foo='( 1 2 )');
backwards compatible with bash-4.3. Still a tentative change
2/20
----
lib/glob/smatch.c
- is_wcclass: check malloc() return value, return -1 if it fails
Report from Tobias Stoeckmann <tobias@stoeckmann.org>
lib/sh/shmatch.c
- sh_regmatch: check malloc() return value, handle NULL value if it
fails. Report from Tobias Stoeckmann <tobias@stoeckmann.org>
2/22
----
lib/readline/doc/rltech.texi
- rl_callback_handler_install: note that the handler function should
free the line it receives, as with readline. Suggested by
Ulf Magnusson <ulfalizer@gmail.com>
- Readline Signal Handling: note that application needs to clean up
readline's terminal state if it wants to handle a signal before
the line handler restores it. Suggested by Ulf Magnusson
<ulfalizer@gmail.com>
2/24
----
lib/readline/histfile.c
- history_do_write,history_truncate_file: if the write fails, make sure
to set history_lines_written_to_file to 0 so we don't lose those
history entries
2/27
----
execute_cmd.c
- execute_function: unwind-protect the value of line_number_for_err_trap,
so a function that returns a non-zero value and triggers an ERR trap
has the right value for LINENO. Any simple command in the function
body can change it. Bug report from Paul Donohue <gnu@paulsd.com>
3/5
---
lib/sh/shquote.c
- sh_backslash_quote: cast `c' to `unsigned char' before using as
index into backslash_table. Report and fix from
alexeyv.90@gmail.com
arrayfunc.[ch]
- valid_array_reference: added second `flags' argument for future use;
currently unused
parse.y,{redir,subst,variables,test}.c
builtins/{declare,printf,read,set}.def
- valid_array_reference: changed callers
3/7
---
lib/readline/signals.c
- _rl_handle_signal: if readline gets a SIGTSTP or SIGTTIN, block
SIGTTOU so a backgrounded readline can reset the terminal settings
appropriately, otherwise the terminal state and readline's idea
of it can get messed up. Original report from Dave Wysochanski
<dwysocha@redhat.com> and Dave Anderson <anderson@redhat.com>
trap.c
- run_pending_traps: don't allow recursive SIGWINCH trap invocations;
they're wasteful and trying to handle a stream of signals while a
user resizes the terminal can lead to malloc errors trying to save
and restore the_pipeline multiple times. Problem reported most
recently by Martin M. S. Pederson (Fedora bash bug 1197768
https://bugzilla.redhat.com/show_bug.cgi?id=1197768)
- reset_or_restore_signal_handlers: set pending_traps to 0 for all
signals when forking a child. TENTATIVE fix
jobs.c
- {save,restore}_pipeline: block SIGCHLD while manipulating the_pipeline
like cleanup_the_pipeline does. XXX - may not be necessary
lib/readline/display.c
- rl_redisplay: fixed case where multibyte character in the prompt
(e.g., \u03bb) in the last screen column causes problems with line
wrapping because the newline marker is put in the middle of the
multibyte char. Most recently reported on Ubuntu by
<sterpe@gmail.com>
pathexp.c
- quote_string_for_globbing: if a bracket expression doesn't have a
closing right bracket, rescan it from just after the opening
bracket without treating it as a bracket expression. Bug report
from Stephane Chazelas <stephane.chazelas@gmail.com>
3/9
---
subst.c
- process_substitute: keep the last pipeline created to run a process
substitution in LAST_PROCSUB_CHILD; discard it when another one is
created
jobs.[ch]
- discard_pipeline: now global, so process_substitute can call it
jobs.c
- last_procsub_child: new variable, set and modified only by the process
substitution code
- find_pipeline: if the requested pid is in LAST_PROCSUB_CHILD, return
it; analogous to the way this code handles the_pipeline
- waitchld: if we find a child via find_pipeline that is a part of the
last process substitution child, mark that child appropriately. If
the child is dead, add it to the bgp list. This and the previous
change allow waiting for the most recent process substitution (the
one corresponding to $!). Original report from Stephane Chazelas
<stephane.chazelas@gmail.com>
3/10
----
arrayfunc.c
- unbind_array_element: make sure skipsubscript() doesn't try to parse
embedded quotes in the subscript, since this has already been through
one round of word expansion before calling the unset builtin. (This
function is only called by the unset builtin). Fixes bug reported by
<vampyrebat@gmail.com>
3/17
----
jobs.c
- waitchld: move code that adds the last process substitution pid to
the bgpids array from waitchld (where it can call malloc in a signal
handler context) to cleanup_dead_jobs
3/19
----
subst.c
- parameter_brace_expand: if expanding an array in a context where word
splitting will not take place (W_ASSIGNRHS only for now), make sure
to pass the double-quoted flag to chk_atstar so we don't get the
unquoted $* behavior, which will cause unwanted word splitting.
Fixes bug reported by isabella parakiss <izaberina@gmail.com>
arrayfunc.c
- unbind_array_element: don't assume that caller will check and pass
only array variables; don't allow non-array variables to be unset
using the `@' or `*' subscripts and don't allow any subscripts other
than 0; return -2 in those cases
- unbind_array_element: unset a non-array variable if passed a subscript
of `0' (e.g., `unbind "scalar[0]"'). This is new functionality that
parallels the ${scalar[0]} expansion
builtins/set.def
- unset_builtin: don't check whether a variable is an array if it's
referenced using array syntax (scalar[0]); pass it to
unbind_array_element anyway and check the result. This means that
`unset scalar' and `unset scalar[0]' are equivalent
3/20
----
builtins/set.def
- set_builtin: make `-i' an invalid option, unconditionally for now.
From a bug-bash discussion started by Peng Yu <pengyu.ut@gmail.com>
3/21
----
lib/readline/colors.c
- _rl_print_color_indicator: handle dangling symlinks (C_ORPHAN) and
the `target' specifier for links (dereference S_ISLNK if the target
exists). Bug report and fix from andreas@stapelspeicher.org
{arrayfunc,subst}.c
- add code to save and restore this_command_name in places that set
this_command_name to NULL to prevent error messages from arithmetic
evaluation. Fixes bug reported by brian.carpenter@gmail.com
builtins/mapfile.def
- do_chop: remove a new DELIM argument from the line, instead of
unconditionally removing newline
- mapfile: if -d delim is supplied and we are breaking fields at DELIM,
remove DELIM if the -t option is supplied by passing DELIM to do_chop().
Suggested by Geir Hauge <geir.hauge@gmail.com>
doc/{bash.1,bashref.texi}
- mapfile: document new -t option behavior, defaults are the same
builtins/alias.def
- print_alias: if the first character of an alias name is `-', add a
`-- ' after `alias' to avoid option errors when trying to reuse the
output. Bug report and fix on savannah from Pasha Bolokhov
<pasha.bolokhov@gmail.com>
3/22
----
builtins/declare.def
- declare_internal: if creating a variable does not return a valid
variable in VAR, check for null variable before dereferencing it.
This happens with nameref variables referencing variables set to
the empty string.
Fixes bug reported by Arthur200000 <arthur200126@163.com>
3/23
----
doc/{bash.1,bashref.texi}
- INVOCATION: add language to make it clear that non-interactive login
shells execute ~/.bash_logout if they run the `exit' builtin. From a
question from Christoph Anton Mitterer <calestyo@scientia.net>
4/6
---
subst.c
- process_substitute: increment and decrement subshell_level around
calls to parse_and_execute, as in command substitution, so
$BASH_SUBSHELL gets new values in the subshell. Fixes inconsistency
pointed out by Peng Yu <pengyu.ut@gmail.com>
doc/{bash.1,bashref.texi}
- read: add clarifying text to note that the -N option does not split
on $IFS, but does retain backslash as an escape character subject
to -r. Report from isabella parakiss <izaberina@gmail.com>
builtins/declare.def
- declare_internal: unless it's the last statement in a {...} block,
NEXT_VARIABLE must be protected by braces. Bug introduced in patch
from 3/22, reported by Eduardo A. Bustamante López
<dualbus@gmail.com>
4/7
---
parse.y
- shell_getc: if bash is reading input from a string that ends with an
unquoted backslash, add another backslash instead of a newline, since
the backslash and newline will disappear in normal processing. Fixes
bug with `bash -c 'eval \\; echo y' ' skipping the eval command and
setting incorrect exit status, and `bash -ic 'eval \\; echo y' '
seeing EOF on empty line and exiting before the echo. Keep track of
backslash state with last_was_backslash; set in char reading loop.
Fixes bug reported by Eduardo A. Bustamante López <dualbus@gmail.com>
4/8
---
shell.c
- main: check for $INSIDE_EMACS as well as $EMACS when deciding whether
or not bash is being run in a GNU emacs shell window. Don't bother
checking whether $TERM is unset because variable initialization sets
it to `dumb' if unset. Fixes from Paul Eggert <eggert@CS.UCLA.EDU>
parse.y
- push_token: new function, rotates current_token through last_read_token,
saving old values like yylex() does, sets current_token to argument
evalfile.c
- _evalfile: if current_token is yacc_EOF, push a newline as the value
of current_token instead, using push_token(). yacc_EOF can result if
sourced file doesn't end with a newline but does end with an unescaped
backslash. Fixes bug reported by Pedro Gimeno
<pgwr-842@personal.formauri.es>
lib/readline/histfile.c
- use PARAMS(x) instead of __P(x). Bug reported by Evan Gates
<evan.gates@gmail.com>
4/9
---
execute_cmd.c
- execute_simple_command: if we haven't already forked, and we have
created FIFOs, turn off the no-fork optimization in the simple
command's flags. Originally reported to savannah by Kuang-che Wu as
https://savannah.gnu.org/support/index.php?108732
4/10
----
trap.c
- trap_if_untrapped: new function, sets a trap on a signal if that
signal is not already trapped
- maybe_set_debug_trap: new function, sets DEBUG trap to command string
argument only if it's not already trapped
trap.h
- maybe_set_debug_trap: new extern declaration
builtins/source.def
- source_builtin: if the -T option isn't set, use maybe_set_debug_trap
in the unwind-protect instead of unconditionally restoring the old
trap string. That means if the sourced file changes the DEBUG trap,
that new trap will persist instead of being undone when the old
value is restored. Fixes bug reported by Scott Bronson
<bronson@rinspin.com>
builtins/evalstring.c
- parse_string: before we jump to top_level, if we are at the `bottom'
of the parse_and_execute stack (parse_and_execute_level == 0), call
top_level_cleanup() before jumping so the right cleanup happens (e.g.,
cleaning up redirections and other state). Fixes bug reported by
Sam Liddicott <sam@liddicott.com>
4/15
----
jobs.c
- delete_job: only add J_ASYNC (and not J_FOREGROUND) jobs to the
bgpids array, since Posix says shells only need to save the status
of async jobs. Report and fix from John Fremlin <john@fb.com>
4/17
----
pcomplib.c
- COMPLETE_HASH_BUCKETS: increase to 256 since bash-completion is
over 300 completions by now
variables.c
- VARIABLES_HASH_BUCKETS: constant used to size shell variables hash
table instead of relying on hash library default. Used in calls
to hash_create in create_variable_tables(), push_temp_var(), and
push_func_var(). Currently set to 1024 because why not? From a
discussion starting at
https://lists.gnu.org/archive/html/bug-bash/2015-04/msg00089.html
- initialize_shell_variables: if FUNCTION_IMPORT is not defined, the
nested conditional compilation causes syntax errors. Bug and fix
from Eric Blake <eblake@redhat.com>
configure.ac
- function-import: fix typo, assign to correct variable. Found as the
result of a report by Eric Blake <eblake@redhat.com>
shell.c
- open_shell_script: check whether or not file argument is a
directory before opening; Posix says that implementations may open
a directory with O_RDONLY. Bug report from
Eduardo A. Bustamante López <dualbus@gmail.com>
4/19
----
ulimit.def
- fix typo in limits[] declaration of `k'
4/20
----
configure.ac
- add template definitions set by AC_USE_SYSTEM_EXTENSIONS from a report
from Andreas Schwab <schwab@linux-m68k.org>
variables.c
- FUNCTIONS_HASH_BUCKETS: constant used to size the hash tables used for
shell functions and the text of shell function definitions. Initially
set to 512, even though it's a really rare case that someone has more
than around 150 functions, even with bash-completion
4/21
----
shell.c
- main: malloc_set_register: change arg to 0 to disable keeping track of
allocations and frees in table; change to 1 for malloc debugging on
demand. Table is too small to keep effective track of allocations on
a modern system, need to use something like valgrind
4/22
----
shell.c
- main: move cmd_init() (initialize word desc and word list object
caches) after startup files are read so the cache doesn't get filled
up with semi-permanent storage for shell functions and variables
execute_cmd.c
- execute_function: use maybe_set_debug_trap in the same way as source
builtin change from 4/10 to allow functions to reset a DEBUG trap
when set -T not in effect. From a report by Peng Yu
<pengyu.ut@gmail.com>
4/23
----
execute_cmd.c
- execute_disk_command: don't overwrite value of subshell_environment
by assigning SUBSHELL_FORK; just OR in SUBSHELL_FORK so something
like SUBSHELL_ASYNC or SUBSHELL_PIPE is preserved
jobs.c
- wait_for: don't call give_terminal_to if running in a subshell
environment, not just if running_in_background is set; don't want
shell functions waiting for a process to complete in a pipeline to
give the terminal to the wrong process group. Part of fix for bug
reported by Valentin Bajrami <valentin.bajrami@gmail.com>
- make_child: child process should not try to give the terminal to the
pipeline_pgrp if running as part of a pipeline (SUBSHELL_PIPE in
subshell_environment); functions in execute_cmd.c don't set that
flag until after make_child returns and the child process is running.
Rest of fix for bug reported by Valentin Bajrami
<valentin.bajrami@gmail.com>
4/24
----
redir.c
- redirection_error: if the redirection involves {varname}, only use
`varname' in the error message if the error code is < 0 (one of the
internal redirection errors, like ambiguous or bad variable name);
otherwise the issue is probably with the filename and should be treated
as usual. Fixes problem reported by Dr. David Alan Gilbert
<dgilbert@redhat.com>
configure.ac,config.h.in
- sys/ioctl.h: add check in AC_CHECK_HEADERS macro, define HAVE_SYS_IOCTL_H
lib/readline/{rltty,terminal}.c
- sys/ioctl.h: include unconditionally for ioctl declaration, avoid
issues with `implicit declaration' warnings. Issue originally
raised on gdb list by Chen Gang <xili_gchen_5257@hotmail.com>
4/27
----
lib/malloc/table.c
- mem_table: now a circular buffer showing the state of the last
REG_TABLE_SIZE allocations rather than a hash table that quickly
fills up
builtins/declare.def
- typeset_builtin: add -n to list of supported options. Omission
reported by Valentin Bajrami <valentin.bajrami@gmail.com>
unwind_prot.c
- use object caches instead of malloc/free to allocate and deallocate
unwind-protect elements
- uwp_init: initialize unwind-protect element object cache
unwind_prot.h
- uwp_init: extern declaration
shell.c
- main: call uwp_init right after calling cmd_init -- initialize all the
object caches at the same place
lib/malloc/table.[ch]
- mlocation_table: new table to keep track of allocation locations by
file and line, functions to initialize table, record an allocation,
and dump the table to stderr
- mregister_alloc: call mlocation_register_alloc to record the location
(source file/line) for each allocation to pinpoint malloc hot spots
by number of calls. More detail than gprof
parse.y
- set_line_mbstate: replace free/xmalloc pair with xrealloc call
- read_token_word: call alloc_word_desc instead of xmalloc so we can take
advantage of the WORD_DESC cache
4/28
----
execute_cmd.c
- execute_simple_command: if command execution fails because the command
is a directory, and the `autocd' option is set, add a `--' argument
to the constructed `cd' command to protect against command names with
the same name as options to `cd'. Report and fix from
isabella parakiss <izaberina@gmail.com>
4/30
----
jobs.c
- printable_job_status, j_strsignal: change calls to strcpy and sprintf
that write to retcode_name_buffer to use strncpy and snprintf to
avoid buffer overflows caused by malicious translations. Bug and fix
from Trammell Hudson <Trammell.Hudson@twosigma.com>
5/1
---
strtrans.c
- ansicstr: make sure the buffer is at least 12 bytes to ensure enough
space for any eventual call to u32cesc for one multibyte char
5/4
---
jobs.c
- wait_for: if an interactive shell is running a loop and waiting for
a non-builtin command to exit, and the command exits due to SIGINT,
act as if the shell received the SIGINT as well and break the loop.
This matches the behavior when the shell is running a builtin command
in a loop, and when running a non-builtin command outside a loop, and
seems more broadly useful than running the trap handler over and over
again. Report originally from Kaz Kylheku <kkylheku@gnu.org>
builtins/set.def
- unset_builtin: use different variables for keeping the state of the
-f and -v options than the loop uses to decide whether or not to
treat a name as a function or a variable. Fixes problem with
unset_function setting `sticking' after you unset a function when
invoked with no options. Bug report from Dreamcat4
<dreamcat4@gmail.com>
shell.c
- open_shell_script: set running_shell_script to 1, set to 0 in every
other case (new variable)
- main: when checking whether or not to call start_debugger, test
running_shell_script instead of dollar_vars[1]. The goal is to not
invoke the debugger for interactive shells but allow it to run for
things like `bash --debugger -i /tmp/script'. Problem reported by
Rocky Bernstein <rocky@gnu.org>
lib/readline/histexpand.c
- history_event_delimiter_chars: new (as yet undocumented) variable
containing by default characters that can delimit a history event
specifier without requiring a `:': "^$*%-" as the documentation has
always said. Fixes bug reported by Anders Granlund
<anders.granlund.0@gmail.com>
5/10
----
lib/glob/gmisc.c
- match_pattern_char, match_pattern_wchar: if passed an empty string,
return a match if the first character of the pattern is `*'
subst.c
- pat_subst: change to allow empty strings to be replaced as long as
pattern matches empty string. Report and fix from isabella parakiss
<izaberina@gmail.com>
5/12
----
lib/sh/strtrans.c
- ansic_wshouldquote: make behavior consistent in the event of an
invalid multibyte sequence: return 1 to the caller so the string
will be $'...' quoted
builtins/cd.def
- cd_builtin: print the right error message even if printable_filename
changes errno (e.g., EILSEQ)
lib/sh/shquote.c
- sh_backslash_quote: in multibyte locales, even if is_basic does not
return true, backslash-quote an ASCII character that backslash_table
says should be quoted. Part of fix for bug reported by Igor
Bogomazov <ygrex@ygrex.ru>
bashline.c
- directory_exists: new function, dequotes the string argument, removes
any trailing slash, and returns true if the result is a valid
existing filename
- bash_filename_stat_hook,bash_directory_completion_hook: use
directory_exists instead of calling lstat/stat on the quoted
directory name. Rest of fix for bug reported by Igor Bogomazov
<ygrex@ygrex.ru>
5/15
----
aclocal.m4
- BASH_CHECK_MULTIBYTE: when checking for locale_charset, add $LIBINTL
to $LIBS. If we're using the included lib/intl/libintl.a, it will
include a version of locale_charset
5/17
----
lib/readline/bind.c
- sv_isrchterm: make sure we check for v[end] == 0 while in the loop
looking for whitespace. Bug report and fix from Sergio Durigan
Junior <sergiodj@sergiodj.net>
lib/sh/shmbchar.c
- mbstrlen,mbsmbchar: move calculation of MB_CUR_MAX out of loop;
calculate it once at beginning
lib/sh/mbscmp.c
- mbscmp: move calculation of MB_CUR_MAX out of loop; calculate it once
at beginning
lib/sh/mbscasecmp.c
- mbscasecmp: move calculation of MB_CUR_MAX out of loop; calculate it
once at beginning
lib/sh/shquote.c
- sh_backslash_quote: move calculation of MB_CUR_MAX out of loop;
calculate it once at beginning
lib/sh/casemod.c
- sh_modcase: move calculation of MB_CUR_MAX out of loop; calculate it
once at beginning
subst.c
- expand_word_internal: move calculation of MB_CUR_MAX out of loops;
calculate it once at beginning of function (XXX should use
locale_mb_cur_max)
5/22
----
lib/readline/rlmbutil.h
- _rl_wcwidth: new function, short-circuits wcwidth calls for ASCII
printable characters, returns 1 for those
- WCWIDTH: call _rl_wcwidth instead of wcwidth
lib/readline/display.c
- rl_redisplay: move calculation of MB_CUR_MAX out of loop; calculate
it once at beginning. Report and patch from Ole Laursen
<ole.laursen@gmail.com>
5/24
----
lib/readline/text.c
- rl_insert: change to attempt to batch-insert pending typeahead (not
pushed input or input from a macro) that maps to rl_insert. An
attempt to suppress redisplay until readline reads all typeahead --
pasted input, for instance. Inspired by report from Ole Laursen
<ole.laursen@gmail.com>. XXX - need to make this a bindable
variable; already controlled by _rl_optimize_typeahead
lib/readline/rlprivate.h
- _rl_optimize_typeahead: extern declaration
lib/readline/doc/{hstech.texi,history.3}
- next_history: clarify under what circumstances the history offset is
incremented; suggestion from Glenn Golden <gdg@zplane.com>
print_cmd.c
- print_arith_command: should be compiled in if either DPAREN_ARITHMETIC
or ARITH_FOR_COMMAND is defined. Report from Flavio Medeiros
<flaviomotamederios@gmail.com>
flags.c
- change_flag: new variable verbose_flag, set when `v' flag modified;
sets value of echo_input_at_read correspondingly
flags.h
- verbose_flag: new extern declaration
shell.c
- long_options: --verbose now sets verbose_flag
- main: set echo_input_at_read from verbose_flag after parsing any
long options
builtins/fc.def
- fc_builtin: don't unwind-protect echo_input_at_read directly; set it
to 1 before calling fc_execute_file as before, and reset it to value
of global verbose_flag using set_verbose_flag called from an
unwind_protect. Report from isabella parakiss <izaberina@gmail.com>
builtins/shopt.def
- shopt_set_debug_mode: new function, called when the extdebug shell
option changes. Right now, it sets function_trace_mode when extdebug
is enabled, and turns off when extdebug is disabled. The
documentation has always said that shopt does this. Report from
Peng Yu <pengyu.ut@gmail.com>
5/27
----
findcmd.[ch]
- add support for EXECIGNORE shell variable, list of extglob patterns
that prevent matching filenames from being identified as executable
files
variables.c
- EXECIGNORE: arrange for findcmd.c:setup_exec_ignore to be called when
$EXECIGNORE changes
variables.h
- sv_execignore: extern declaration
doc/{bash.1,bashref.texi}
- document EXECIGNORE variable
5/28
----
lib/readline/callback.c
- rl_callback_sigcleanup: new function, cleans up and unsets any state
rl_callback_read_char uses. Intended to be used after a signal
lib/readline/signals.c
- _rl_handle_signal: call rl_callback_sigcleanup on SIGINT. Fixes bug
reported to python group by Martin Panter <vadmium+floss@gmail.com>
lib/readline/isearch.c
- _rl_isearch_cleanup: now a public function so rl_callback_cleanup can
call it
lib/readline/search.c
- _rl_nsearch_cleanup: now a public function so rl_callback_cleanup can
call it
lib/readline/rlprivate.h
- _rl_[in]search_cleanup: extern declarations
lib/readline/readline.h
- rl_callback_sigcleanup: new extern declaration
lib/readline/doc/rltech.texi
- rl_callback_sigcleanup: documented
lib/readline/readline.h
- bump readline version to 7.0 due to addition of rl_callback_sigcleanup
5/29
----
builtins/declare.def
- declare_internal: if we are trying to change attributes or value for
a nameref variable whose value points to an unset variable, make
sure we create a new variable whose name is the value of the nameref
variable. That is,
declare -n foo=bar
unset foo # unsets bar
declare -i foo
should create a (invisible) variable named `bar' with the integer
attribute. Fixes problem reported by Greg Wooledge
<wooledg@eeg.ccf.org>
builtins/set.def
- unset_builtin: if we find a nameref variable when we look it up with
find_variable (the returned variable has a name different from what
we looked up), make sure we use that new name for the rest of the
function rather than rely on unbind_variable to do the same thing as
find_variable. Fixes problem reported by Greg Wooledge
<wooledg@eeg.ccf.org>
- unset_builtin: if we try to unset a nameref variable whose value is
not a set variable, make sure we don't try to unset the nameref
itself, but rather the variable it points to. This ensures that the
following always works as it should
declare -n foo=bar
unset foo # unsets bar and leaves foo unchanged
lib/readline/funmap.c
- vi-insertion-mode: make sure it maps to rl_vi_insert_mode, which is
actually what the `i' keybinding in vi_movement_keymap maps to.
Cosmetic fix from isabella parakiss <izaberina@gmail.com>
6/2
---
general.c
- conf_standard_path: moved get_standard_path here from command.def; made
public function
general.h
- conf_standard_path: extern declaration
6/3
---
parse.y
- parse_matched_pair: make sure that command substitution constructs
within ${...} expansions are parsed as such using parse_comsub, so
the P_FIRSTCLOSE flag doesn't stop parsing if a right brace appears
within the comsub. Report from Christos Zoulas <christos@zoulas.com>
findcmd.c
- search_for_command: take two new flags for FLAGS arg: CMDSRCH_STDPATH,
which means use the command -p path, and CMDSRCH_TEMPENV, currently
unused. Existing flag value of 1 now CMDSRCH_HASH
- search_for_command: don't set `path' to NULL if it wasn't found in
the temporary environment; we can use it later
- search_for_command: look for the hashed file if temp_path == 0, not
if we set path back to 0 (or path lookup failed)
- search_for_command: just call find_user_command_in_path with a
pathlist argument that's set depending on the flags passed
- find_in_path: new function, just calls find_user_command_in_path at
this point
- search_for_command: don't put non-existent files into the hash table
findcmd.h
- CMDSRCH_*: new flags for search_for_command
- find_in_path: extern declaration
execute_cmd.c
- execute_disk_command: check for CMD_STDPATH and call search_for_command
with CMDSRCH_STDPATH if it's set
builtins/command.def
- command_builtin: if -p given without -v or -V, set the CMD_STDPATH
flag in the simple command we construct from the rest of the
argument list. This fixes the command -p cmd issue with changing
$PATH for the duration of `cmd's execution reported by
<sdowdy@rap.ucar.edu>
builtins/common.h
- CDESC_STDPATH: new flag for describe_command; means to use standard
path for command -pv or -pV
builtins/command.def
- command_builtin: if -p given with -v or -V, pass the CDESC_STDPATH
flag to describe_command
builtins/type.def
- describe_command: if given the CDESC_STDPATH flag, use find_in_path
with the conf_standard_path() result. Since `all' will never be on
with this flag, at least not yet, we can allocate and free the path
list. Fixes the bug of a temporary environment value for PATH
preceding a `command -pv' or `command -pV' persisting when the
command finishes and means we use fewer unwind-protects
6/4
---
Makefile.in (plus other Makefile.ins)
- VPATH: remove `.' from VPATH value. It's not needed any more and it
trips a GNU make 4.1 bug on Cygwin. Report and fix from Eric Blake
<eblake@redhat.com>
lib/readline/histfile.c
- history_tempfile: new function, takes history file name as template
and creates a temp file name including the PID
- history_truncate_file, history_do_write: instead of creating backup
and restoring it on failure, use history_tempfile to create a temp
file name, write to it, then rename to original history filename
(handling symlinks using history_restore()). Original report and
patch from Russell Stuart <russell-savannah@stuart.id.au>
doc/{bash.1,bashref.texi}
- ulimit: clarify that -c and -f are in increments of 512 bytes when
in posix mode. Fix from Robin Johnson <robbat2@gentoo.org> via
<vapier@gentoo.org>
6/9
---
execute_cmd.c
- execute_in_subshell: don't call restore_default_signal for the exit
trap, reset_signal_handlers already does the right thing and keeps
the trap string around; no need to kill trap string. Bug report
from Miroslav Koskar <mk@mkoskar.com>
6/11
----
nojobs.c
- find_proc_slot: now takes pid as an argument to avoid finding old
procs when pids wrap around
- add_pid: pass pid to find_proc_slot to avoid multiple instances of
the same pid in the list when pids wrap around. Fixes bug reported
by Roy Keene <rkeene@rkeene.org>
execute_cmd.c
- REAP: test for job_control == 0 also to determine whether or not
to call reap_dead_jobs, since shells without job control enabled
don't report on background process status
doc/bash.1,lib/readline/doc/hsuser.texi
- history: clarify documentation of -a option to note that it will not
append the same line to the history file more than once. Fixes
problem reported by Reuben Thomas <rrt@sc3d.org>
6/12
----
execute_cmd.c
- execute_in_subshell: don't bother decrementing subshell_level before
this returns; the caller will just exit. This means that
$BASH_SUBSHELL will have consistent values in the subshell and any
subsequent exit trap. Fixes bug reported by Miroslav Koskar
<mk@mkoskar.com>
- shell_execve: before longjmp to subshell_top_level, call reset_parser
to free up any input line and stack of pushed strings
parse.y
- mk_alexpansion: if the last character of the alias is a shell
metacharacter, don't add a space to the string following the alias
value, since that will change the meaning of the command. THIS IS
NOT BACKWARDS COMPATIBLE AND MAY REQUIRE REVERTING. Inspired by an
email message from Jilles Tjoelker <jilles@stack.nl> to austin
group
6/13
----
subst.c
- dequote_string: don't turn strings consisting of a single CTLESC
into empty strings; return them unmodified. The idea is that there
is nothing to quote. This means that something like
c=$'\001'
x=$c
results in x containing '\001' when IFS=$'\001'. See if this will
cause problems by adding a debugging statement in the code
6/15
----
parse.y
- CHECK_FOR_RESERVED_WORD: don't return ESAC when you read `esac'
after a `|' while in a case pattern list (parser_state & PST_CASEPAT).
This is Posix grammar rule 4
(http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02)
6/16
----
jobs.c
- wait_for: make sure we queue SIGCHLD signals if a SIGCHLD trap
handler is running (signal_in_progress or IMPOSSIBLE_TRAP_HANDLER),
since we allow recursive trap invocations now
- wait_for: make sure we treat SIGCHLD as trapped if the trap handler
is set to IMPOSSIBLE_TRAP_HANDLER so we don't miss signals during
calls to run_sigchld_trap()
trap.c
- run_pending_traps: since we allow recursive trap handler invocations,
make sure we set pending_traps[SIGCHLD] to 0 while we mark the
signal handler in progress (SIG_INPROGRESS) and don't reset it to 0
after run_sigchld_trap returns in case more SIGCHLDs have been
queued while it's running
6/22
----
lib/readline/readline.c
- _rl_dispatch_subseq: if we shadowed any function, not just self-
insert, bind that function to the key we shadowed and dispatch on it.
This preserves and dispatches off the original key, not ANYOTHERKEY,
and makes sure we are dispatching from a keymap with the right key
binding. Fixes bug reported by Carlos Pita
<carlosjosepita@gmail.com>
6/23
----
bashline.c
- attempt_shell_completion: don't read past the end of rl_line_buffer
while skipping assignment statements before command names. Fix for
bug reported by Hanno Böck <hanno@hboeck.de>
lib/readline/parens.c
- _rl_enable_paren_matching: make paren matching work in vi insert
mode. Really, this time. Bug report from Carlos Pita
<carlosjosepita@gmail.com>
6/29
----
parse.y
- parse_comsub: when starting to parse a word, make sure that we set
lex_rwlen to 0 along with lex_wlen if we are in a position where we
can read a reserved word. Fixes bug reported by Nathan Neulinger
<nneul@neulinger.org>
6/30
----
sig.h
- include <signal.h> unconditionally and rely on guards in sig.h to
keep from including it more than once. Irix 6.5 defines SIG_DFL
in other files and defeats the test of SIG_DFL. Fixes bug
reported by Klaus Ziegler <klausz@haus-gisela.de>
alias.c
- ALIAS_HASH_BUCKETS: table size increased to 64
7/7
---
{jobs,nojobs}.c
- wait_sigint_cleanup: new function, to be called by longjmp targets
for wait_intr_buf. Performs any necessary cleanup of internal waitchld
state before going back to top level
jobs.h
- wait_sigint_cleanup: new extern declaration
builtins/wait.def
- wait_builtin: call wait_sigint_cleanup after longjmp back to
wait_intr_buf on interrupt
[bash-4.4-alpha frozen]
7/7
---
bashline.c
- attempt_shell_completion: when skipping assignment statements, don't
skip past rl_point to find the word on which to perform programmable
completion. Fixes bug reported by Hanno Böck <hanno@hboeck.de>
7/10
----
pcomplib.c
- compspec_copy: set the refcount on the copy to 1, since it's a freshly
allocated copy and there are no other pointers to it. Fixes memory
leak from gen_progcomp_completions
lib/readline/complete.c
- printable_part: if the pathname passed is just `/', just return it
instead of potentially reading before the `/'. Fixes bug reported
by Hanno Böck <hanno@hboeck.de>
7/11
----
support/man2html.c
- change calls to malloc to use xmalloc; provide standard xmalloc
definition. Report from Bill Parker <wp02855@gmail.com>
builtins/wait.def
- wait_intr_flag: set to denote validity of wait_intr_buf as target
for longjmp; reset by WAIT_RETURN macro; should always be 0 when
wait_builtin returns
quit.h
- CHECK_WAIT_INTR: now also checks wait_intr_flag to ensure valid state
of wait_intr_buf before sh_longjmp
{jobs,nojobs}.c
- wait_intr_flag: extern declaration for use by CHECK_WAIT_INTR
sig.c
- wait_intr_flag: set back to 0 every place the shell resets state after
a jump to top_level
- sigint_sighandler: only set wait_signal_received if wait_intr_flag
indicates that the wait builtin has correctly set wait_intr_buf.
Final fix for bug reported by Ondrej Oprala <ooprala@redhat.com>
subst.c
- parameter_brace_expand: fix so that ${!vvv@} is not interpreted as
introducing a `@' operator, but instead retains its meaning as all
variables whose name begins with vvv. Fixes bug reported by
konsolebox <konsolebox@gmail.com>
7/14
----
execute_cmd.c
- execute_connection: remove the fork optimization from and AND_AND
and OR_OR cases; it has trouble with `a && b && c', since the `&&'
is left-associative. Putting that code here can result in unwanted
fork optimizations since the `b' will end up as `second' on a
recursive call to execute_command. Bug reported by Mike Frysinger
<vapier@gentoo.org>
builtins/evalstring.c
- optimize_fork: moved code from execute_connection to here; checks
whether the RHS of a && or || passes the suppress_fork() tests and
turns on the NO_FORK bit if so
- parse_and_execute: if suppress_fork() tests fail, check whether the
command to be executed is a connection and attempt to optimize the
fork for the right side using optimize_fork(). The key is dealing
with the entire command passed to `bash -c' or `eval'
builtins/common.h
- optimize_fork: new extern declaration
execute_cmd.c
- execute_command_internal: enable code put in to undo redirections
before exiting the shell due to `set -e' in the case of a shell
function that gets command-not-found or a syntax error. Reported
back in May, 2014 by Mark Ferrell <major@homeonderanged.org>
bashhist.c
- bash_history_inhibit_expansion: enable change from 1/10 that skips
over history expansion character in command and process
substitution
7/15
----
lib/readline/{history,undo}.c
- replace_history_data now _hs_replace_history_data
7/16
----
lib/readline/readline.c
- make sure _rl_to_lower doesn't ever get characters that are outside
of its valid range by casting arg to unsigned char
lib/readline/colors.h
- change completion prefix color (C_PREFIX) to be the same as C_SOCK,
which is less likely to collide with file type colorings (magenta)
lib/readline/complete.c
- fnprint: now takes an additional argument: the full, expanded pathname
corresponding to the `toprint' argument
- fnprint: don't zero out prefix_bytes if we're not printing the
ellipisis but we still want to use prefix_bytes for displaying
the common prefix in a color
- print_filename: move colored-stats display responsibility into fnprint
- fnprint: change so colored-prefix and colored-stats can cooperate
and display filenames with multiple colors: one for the prefix and
one for the file type. The prefix is displayed in the prefix color
and the remainder of the pathname, if any, is displayed in the color
corresponding to the file type. Report and suggestion from Mike
Frysinger <vapier@gentoo.org>
7/17
----
lib/readline/readline.[ch]
- rl_readline_state: now unsigned long, prepare for more than 32 states
7/18
----
lib/readline/history.h
- history_offset: now declared here, was always a global variable
- copy_history_entry: now declared here, part of the public interface
- alloc_history_entry: now declared here, part of the public interface
7/20
----
lib/readline/readline.h
- RL_STATE_CHARSEARCH: new state, for vi mode character search. Was
previously handled by simply setting _rl_callback_func
lib/readline/vi_mode.c
- rl_domove_motion_callback: split into two functions, remaining code
after _rl_dispatch call goes into new function
_rl_vi_domove_motion_cleanup
- rl_vi_char_search: set RL_STATE_CHARSEARCH
- rl_vi_char_search: sets `i2' member of callback data to the key used
to invoke the char search
- _rl_vi_callback_char_search: unset RL_STATE_CHARSEARCH after reading
the character to find
- _rl_vi_domove_motion_cleanup: make sure RL_STATE_VIMOTION is unset in
all cases where this function returns
- _rl_vi_domove_motion_cleanup: use `end' member of vi motion context
as value of rl_end to restore after adding blank at end of line in
rl_domove_motion_callback; avoids need to keep `old_end' and somehow
pass it between the two functions
lib/readline/rlprivate.h
- _rl_vi_domove_motion_cleanup: new extern declaration
lib/readline/callback.c
- rl_callback_read_char: handle RL_STATE_CHARSEARCH, including case
where char search is vi motion command for d/c/y/m and RL_STATE_VIMOTION
is set when this is called. Last of set of fixes for bug reported
by Carlos Pita <carlosjosepita@gmail.com> with vi-mode `dty' command
in callback mode
7/21
----
subst.c
- command_substitute, process_substitute: add QUIT call in the child
after restoring original signal handlers to catch post-fork SIGINT
or terminating signal
jobs.c,nojobs.c
- make_child: after forking, clear interrupt_state in child
before restoring signal mask so children get their own set of
interrupts
7/22
----
lib/sh/shquote.c
- sh_double_quote: since all uses of the return value from this function
are for display and not subject to subsequent expansion, we don't
need to protect CTLESC and CTLNUL with CTLESC. Bug report and fix
from isabella parakiss <izaberina@gmail.com>
parse.y
- decode_prompt_string: need to protect literal instances of CTLESC
and CTLNUL with CTLESC, even if they are not coming out of one of
the backslash-expansions
subst.c
- make_internal_declare: fixed memory leak; make_internal_declare should
free the memory it allocates to construct the word list. From Red
Hat bug 1245233; https://bugzilla.redhat.com/show_bug.cgi?id=1245233
lib/readline/readline.c
- _rl_dispatch_subseq: when checking whether an ESC in vi insert mode
should be treated as part of a key sequence or as a single char,
make sure we are getting input from the keyboard before we check
_rl_input_queued(). If we are getting input from a macro, this
causes a needless delay. Report from Carlos Pita
<carlosjosepita@gmail.com>
7/23
----
input.c
- save_bash_input: before checking to see whether or not a new fd has a
stale associated buffer, make sure that the new fd is within bounds.
Bug report and fix from Alexey Makhalov <makhaloff@gmail.com>
7/24
----
doc/{bash.1,bashref.texi}
- note that the `return' builtin accepts arguments beginning with `-'
without requiring `--'
7/27
----
examples/loadables/Makefile.in
- add variables and targets to support `make install'; installs
supported builtins in $(libdir)/bash
7/28
----
lib/readline/{readline,rlprivate}.h, lib/readline/display.c
- rearrange some structure members for better alignment and to reduce
padding. Fix from <git-dpa@aegee.org>
tests/run-*
- use BASH_TSTOUT instead of hardcoded /tmp/xx as output file
trap.[ch]
- maybe_set_error_trap: set a trap for the ERR trap if it is not already
trapped; similar to maybe_set_debug_trap back from 4/10
lib/malloc/malloc.c
- internal_free: make sure `ubytes' is initialized if MALLOC_WATCH is
defined and we'll be passing it to _malloc_ckwatch. Report from
Flavio Medeiros <flaviomotamederios@gmail.com>
execute_cmd.c
- execute_function: use maybe_set_error_trap in the same way as
maybe_set_debug_trap. Fixes bug reported by David Waddell
<David.Waddell@owmobility.com>
7/29
----
jobs.c
- wait_for: no longer need to call job_signal_status when checking
whether a comsub shell reaped a child that died due to SIGINT; code
now uses child_caught_sigint
7/30
----
builtins/exec.def
- exec_builtin: after call to restore_original_signals, need to call
default_tty_job_signals to undo changes done by initialize_job_signals.
Fix for problem reported by Andreas Schwab <schwab@suse.de>
doc/{bash.1,bashref.texi}
- clarify definition of metacharacter to explicitly include newline;
prompted by report from George Gallo <georgeggallo@gmail.com>
8/3
---
lib/readline/search.c
- _rl_free_history_entry: should be void, not int. Report from
Dilyan Palauzov <dilyan.palauzov@aegee.org>
general.h
- sh_load_func_t, sh_unload_func_t: new function pointer types, used by
enable for load and unload hook functions
builtins/enable.def
- dyn_load_builtin: attempt to execute a function named
BUILTIN_builtin_load, where BUILTIN is the name of the command being
loaded. If that function returns 0, the load fails
- dyn_unload_builtin: attempt to execute a function named
BUILTIN_builtin_unload, where BUILTIN is the name of the command
being unloaded. It offers a dynamic builtin a way to clean up after
itself. Inspired by suggestion from Piotr Grzybowski
<narsil.pl@gmail.com> in response to a bug report from isabella
parakiss <izaberina@gmail.com>
8/6
---
lib/readline/colors.[ch]
- _rl_print_color_indicator: now takes `const char *' argument
lib/readline/complete.c
- colored_stat_start: now takes `const char *' argument
lib/malloc/table.h
- ma_table_t: `file' member is now `const char *'
lib/malloc/table.c
- mlocation_register_alloc: make sure variable assigned to `file' in
ma_table_t is of type `const char *'. Fixes from Dilyan Palauzov
<dilyan.palauzov@aegee.org>
lib/termcap/termcap.[ch]
- tputs: should return int instead of void
lib/readline/readline.h
- RL_STATE_DONE: correct value, avoid collision
lib/readline/vi_mode.c
- _rl_vi_redoing: now global, added _rl_ prefix to `vi_redoing'
lib/readline/readline.c
- _rl_subseq_result: call _rl_dispatch_subseq instead of rl_dispatch to
avoid changing _rl_dispatching_keymap
- _rl_subseq_result: in the -2 case, set _rl_dispatching_keymap to the
map passed as an argument. Without this, vi mode doesn't call
rl_vi_set_last when it should
- _rl_dispatch_subseq: if redoing a vi mode command with `.'
(_rl_vi_redoing != 0) in callback mode and we're indirecting into
another keymap that has shadowed the key corresponding to the command
we are redoing, just call _rl_subseq_result immediately: vi redo
doesn't need to read any additional input, and rl_vi_redo assumes
that a single call to rl_dispatch is sufficient. Fixes bug reported
by Carlos Pita <carlosjosepita@gmail.com>
8/7
---
subst.c
- parameter_brace_expand: if a substitution (parameter expansion) error
occurs, and shell_compatibility_level is <= 43, return expansion error
as in all previous versions. If shell_compatibility_level is > 43,
a posix-mode non-interactive shell will consider this a fatal error.
Problem reported by Christian Neukirchen <chneukirchen@gmail.com>
doc/bashref.texi
- documented that word expansion errors cause fatal errors in posix mode
non-interactive shells
8/8
---
subst.h
- SD_COMPLETE: skip_to_delim being called as part of word completion
- SX_COMPLETE: one of the string_extract functions being called as
part of word completion
bashline.c
- find_cmd_start,find_cmd_end,find_cmd_name: call skip_to_delim with
SD_COMPLETE flag
subst.c
- skip_double_quoted: takes new flags argument; changed callers
- skip_double_quoted: if flags argument includes SX_COMPLETE, pass it
to extract_command_subst
- extract_command_subst: if flags&SX_COMPLETE, call
extract_delimited_string instead of xparse_dolparen, since completion
may call this for unterminated command substitutions. Fixes
(imperfectly) bug reported by Ingo Ruhnke <grumbel@gmail.com>
- skip_to_delim: if passed the SD_COMPLETE flag, pass the SX_COMPLETE
flag to skip_double_quoted
- char_is_quoted: pass SX_COMPLETE flag to skip_double_quoted
- unclosed_pair: pass SX_COMPLETE flag to skip_double_quoted
8/9
---
execute_cmd.c
- time_command: catch longjmps to top_level and print command timing
statistics even after a jump to top_level. Fixes issue reported by
Sam Watkins <sam@nipl.net>
8/10
----
config-top.h
- OPENLOG_OPTS: if SYSLOG_HISTORY is defined, define to LOG_PID, so
each message is tagged with the pid
bashhist.h
- bash_syslog_history: the first time it's called, call openlog with
OPENLOG_OPTS and SYSLOG_FACILITY
8/11
----
doc/{bash.1,bashref.texi}
- GROUPS,FUNCNAME: change description to note that assignments are
silently ignored, but do not return an error (which would constitute
an assignment error and cause posix mode shells to abort). Problem
pointed out by Grzegorz Bajson <gbajson@gmail.com>
8/12
----
subst.c
- parameter_brace_expand_indir: if the value of the indirectly expanded
variable isn't something that the shell would expand if it were inside
${}, error out right away before calling parameter_brace_expand_word.
Fixes problem reported by isabella parakiss <izaberina@gmail.com>
- parameter_brace_expand: handle returning &expand_wdesc_error or
&expand_wdesc_fatal from parameter_brace_expand_indir in case it does
that someday
8/13
----
jobs.c
- {save,restore}_pipeline: saved_pipeline now a linked list of pipelines,
new ones allocated in save_pipeline and freed in restore_pipeline.
This allow multiple nested calls to save_pipeline (e.g., in traps
and then in process substitution). Fix for bug reported by isabella
parakiss <izaberina@gmail.com>
print_cmd.c
- named_function_string: if printing a function with the same name as a
reserved word, add the `function ' keyword before the name to avoid
parsing problems when trying to reuse it as input. Fix for bug
reported by isabella parakiss <izaberina@gmail.com>
8/14
----
lib/readline/text.c
- rl_insert: when optimizing typeahead, make sure we set rl_last_func
ourselves if we set pending input, since the mainline code path
won't set rl_last_func if input is pending. Fixes bug reported by
Hiroo Hayashi <hiroo.hayashi@computer.org>
8/15
----
builtins/type.def
- describe_command: if using the short description (CDESC_SHORTDESC) in
posix mode, describe posix special builtins as such. Requested by
Stephane Chazelas <stephane.chazelas@gmail.com>
builtins/enable.def
- BASH_LOADABLES_PATH: a colon-separated list of directories where bash
looks for loadable builtins specified as arguments to `enable -f'
doc/{bash.1,bashref.texi}
- BASH_LOADABLES_PATH: document new shell variable
configure.ac,Makefile.in,builtins/Makefile.in
- loadablesdir: set in configure, substitute into Makefiles. Reserved
for future use
8/18
----
subst.c
- shell_expand_word_list: if make_internal_declare fails, make sure to
propagate that error return back and make the assignment statement
fail. Fixes seg fault reported by Sergey Tselikh <stselikh@gmail.com>
8/20
----
builtins/declare.def
- declare_internal: made a slight tweak to the warning message about
quoted compound assignments by printing it only if the array (indexed
or assoc) does not already exist
8/21
----
braces.c
- mkseq: call strvec_dispose before throw_to_top_level if we saw SIGINT
to avoid a memory leak
trap.c
- maybe_set_return_trap: set the RETURN trap to string if it's not
already trapped, in the same way as the debug and error traps
execute_cmd.c
- execute_function: use maybe_set_return_trap to allow functions to set
return traps that persist across calls even if function tracing is
enabled
lib/readline/input.c
- rl_gather_tyi: make sure errno reset to 0 after select call, for
ioctl and read
- rl_gather_tyi: if read returns -1/EIO, return -1
- rl_read_key: if rl_gather_tyi returns -1/EIO, return READERR if in
RL_STATE_READCMD (reading command in readline_internal_char), EOF
if not (like rl_getc). Continue to return '\n' on other errors;
rl_done = 1 in any case. Fix for issue reported by
Lubomir Rintel <lkundrak@v3.sk>
lib/readline/{misc,text,vi_mode}.c
- fix return values from rl_read_key to handle < 0
8/22
----
parse.y
- parsing_redirection: macro that expands to true if the last read
token (always passed as an argument) is a redirection token that
will leave us reading a word that's the target of the redirection
- command_token_position: make sure that even if the parser state
indicates we are reading a simple command (PST_REDIRLIST), we do
not perform alias expansion on a WORD that is part of a redirection,
using parsing_redirection() to do so. Fixes but reported to Red Hat
by Robert Alm Nilsson <rorialni@gmail.com>
https://bugzilla.redhat.com/show_bug.cgi?id=795795
builtins/declare.def
- declare_internal: only print the warning now if the variable is not
already an array or if we are not creating an array with -a or -A,
cuts down the spurious warnings
- declare_internal: even if the rhs of the assignment looks like a
compound array, if we're not assigning to an existing array or we're
not creating an array, make it an array subscript assignment. This
means things like declare a[1]='(foo)' and a[1]='(foo)' behave
identically
builtins/help.def
- wdispcolumn: change use of displen and add new dispchars variable to
deal with locales where each wide character does not take up one
column position. Fix for bug reported by Mingye (Arthur) Wang
<arthur200126@hotmail.com>
8/23
----
sig.c
- sigint_sighandler: if we get a SIGINT while this_shell_builtin ==
wait_builtin, perform the special handling only if wait_intr_flag
is non-zero, don't just use it to set wait_sigint_received. This
makes sure we run bashline_set_event_hook. Fixes bug reported by
isabella parakiss <izaberina@gmail.com>
8/25
----
subst.h
- SD_HISTEXP: new flag for skip_to_delim, indicates we are looking for
the history expansion character (special double quote handling)
- skip_to_delim: handle SD_HISTEXP flag, changes double quote handling
to be similar to history library: don't call skip_double_quote, make
sure single quotes aren't special in double quotes, but continue to
skip over $(), ${}, and other similar constructs
8/27
----
support/bash.pc.in
- new file, pkgconfig template for bash, installed to support nascent
loadable builtins dev environment
examples/loadables/Makefile.inc
- new file, example Makefile with correct definitions for loadable
builtin development
configure.ac
- headersdir: directory where headers get installed to support loadable
builtin development
- examples/loadables/Makefile.inc, support/bash.pc: create
Makefile.in
- INSTALLED_HEADERS, INSTALLED_BUILTINS_HEADERS, INSTALLED_INCFILES,
CREATED_HEADERS: new variables holding names of include files to
install into $(headersdir) for loadable builtin development
- install-headers,install-headers-dirs: new targets to support
installing headers into $(headersdir) and subdirectories for loadable
builtin development
- uninstall-headers: target to uninistall headers in $(headersdir)
- uninstall: call uninstall-headers whether or not install-headers
was done; add uninstall in examples/loadables
- install: add install in examples/loadables
- clean: add clean in examples/loadables
examples/loadables/Makefile.in
- install-supported, install-unsupported: new targets, make install
chooses one based on $(SHOBJ_STATUS)
- install-supported: now cds to the top level build directory and
installs the header files
- install-supported: now installs Makefile.inc to $(loadablesdir) as
an example
- uninstall-supported,uninistall-unsupported: uninstall targets,
make uninstall chooses one based on $(SHOBJ_STATUS)
8/31
----
lib/glob/Makefile.in
- CPPFLAGS: move after ${INCLUDES} so library-specific include paths
take precedence. This is what the other parts of the shell do.
Report from Poor Yorick <org.gnu.lists.bug-bash@pooryorick.com>
builtins/read.def
- reset_alarm: cancel alarm before restoring signal handler to avoid
possible race condition. Report and fix from Oleg Popov
<dev-random@mail.ru>
subst.c
- string_extract_verbatim: if SEPARATORS is "'", don't short-circuit
to string_extract_single_quoted unless the SX_NOCTLESC flag is set.
Callers expect this function to honor CTLESC, even to quote a single
quote. Fixes bug reported by isabella parakiss <izaberina@gmail.com>
and several others
9/2
---
include/chartypes.h
- TOCTRL: handle '?' by special-casing it to 0x7f. Fixes a problem
with $'\c?' reported by Helmut Karlowski <helmut.karlowski@ish.de>
redir.c
- write_here_string: don't word-split the here string document. The
bash documentation has always said this doesn't happen, even though
bash has done so for years, and other shells that implement here-
strings don't perform any word splitting. The practical effect is
that sequences of IFS characters are collapsed to spaces. Fixes
bug reported by Clint Hepner <clint.hepner@gmail.com>
9/3
---
doc/{bash.1,bashref.texi}
- add \? to the list of backslash escapes expanded by $'...' ANSI-C
quoting. It was expanded but not documented
lib/readline/util.c
- _rl_audit_tty: updated from Red Hat patch
lib/readline/readline.c
- HAVE_DECL_AUDIT_USER_TTY: correct #define check
9/13
----
shell.c
- read_from_stdin: make sure value set to 1 appropriately if the shell
is reading from standard input, as Posix seems to specify (?)
lib/readline/kill.c
- _rl_copy_to_kill_ring: don't assume that rl_kill_ring has been
allocated if _rl_last_command_was_kill is non-zero; make sure it's
non-null before indexing into it
9/15
----
variables.c
- initialize_shell_variables: cope with a NULL env pointer. Fixes bug
reported by ziyunfei <446240525@qq.com>
9/16
----
builtins/exec.def
- exec_builtin: if -c is supplied, pass an empty array instead of a NULL
pointer to shell_execve
variables.c
- set_pwd: only believe $PWD if it begins with a slash; try to
canonicalize it and set it to physical path if canonicalization fails.
Reported by ziyunfei <446240525@qq.com>
9/17
----
subst.c
- do_compound_assignment: make sure to dispose of word list generated
by expand_compound_array_assignment; fixes memory leak reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1264101
variables.c
- adjust_shell_level: clamp the value of shell_level at 1000 and reset
there, instead of > 1000, since the itos replacement code doesn't
handle the value 1000. Fixes bug reported by ziyunfei
<446240525@qq.com>
shell.h,parse.y
- save_parser_state,restore_parser_state: now save and restore
redir_stack, short-circuiting if need_here_doc == 0. If we save a
non-zero value for need_here_doc, we have to make sure there is
something valid for gather_here_documents to work on. Fixes bug
reported by Brian Carpenter <brian.carpenter@gmail.com>
9/18
----
array.c
- array_to_assign: use ansic_shouldquote to check whether each element
value contains non-printable characters and use ansic_quote to
generate the value instead of using sh_double_quote unconditionally
assoc.c
- assoc_to_assign: if either the key or the value of an associative
array element contains non-printable characters (ansic_shouldquote
returns true), use ansic_quote to quote them instead of using double
quotes unconditionally
9/19
----
subst.c
- pat_subst: handle REP being NULL. Fixes bug reported by Brian
Carpenter <brian.carpenter@gmail.com>
builtins/evalstring.c
- parse_string: if we get a longjmp to top_level with DISCARD as the
code (in which case we are going to go on), return -DISCARD to our
caller (always xparse_dolparen) after doing our own cleanup instead
of calling jump_to_top_level
parse.y
- xparse_dolparen: if parse_string returns < 0, do the appropriate
cleanup and then jump_to_top_level with the negative of the return
value. This allows us to do the appropriate parser cleanup in
case we're not going to exit the shell. Fixes bug reported by Brian
Carpenter <brian.carpenter@gmail.com>
subst.c
- extract_delimited_string: if a recursive call to one of the extract_
functions or a call to ADVANCE_CHAR leaves i past the end of the
string, cut the loop off at the end of the string. Fixes bug
reported by Brian Carpenter <brian.carpenter@gmail.com>
9/20
----
subst.c
- get_var_and_type: return appropriate values if variable indirection
results in a NULL variable. Fixes bug reported by Brian Carpenter
<brian.carpenter@gmail.com>
lib/readline/history.c
- history_get_time: handle strtol overflows caused by malicious
modifications to timestamps in the history file. Fixes issue
reported by rens@endoria.net
9/21
----
lib/readline/rlconf.h
- ENABLE_AUDIT_TTY_SUPPORT: now undefined (off) by default
9/24
----
jobs.c
- waitchld: if we get a SIGINT while waiting for a child to exit, but
the kernel doesn't interrupt the waitpid(2) call, assume the child
caught SIGINT if it exited for some reason other than SIGINT. Fix
suggested by Stephane Chazelas <stephane.chazelas@gmail.com>
input.c
- make_buffered_stream: use B_TEXT in buffered stream flags instead
of (typo) O_TEXT. Report and fix from Eric Blake <eblake@redhat.com>
9/27
----
execute_cmd.c
- shell_execve: call reset_parser before calling initialize_subshell,
which calls delete_all_aliases. reset_parser wants to free the
pushed string list, which has pointers back into the alias table
(use after free)
- execute_simple_command: if we fork for an async command, make sure
the child process increments shell_level before performing any
word expansions, so $BASH_SUBSHELL is incremented. Fixes issue
reported by ziyunfei <446240525@qq.com>
10/1
----
builtins/kill.def
- kill_builtin: make -L equivalent to -l for compatibility with other
(Linux) versions of kill
doc/{bash.1,bashref.texi}
- kill: document new `-L' option
10/2
----
[bash-4.4-beta frozen]
10/5
----
doc/{bash.1,bashref.texi}
- LC_TIME: document that the shell recognizes it and calls setlocale
when it changes; and that the shell uses it for time formatting
10/6
----
subst.c
- skip_single_quoted: now takes an additional `flags' argument, like
skip_double_quoted; changed callers
- skip_single_quoted: now pays attention to SX_COMPLETE flag, allows
backslash to escape single quote, like $'...' allows
- skip_to_delim: added case where we are completing and we are
skipping over a $'...' string to call skip_single_quoted with
SX_COMPLETE flag to allow backslash to quote single quote. Fixes
bug reported by Daniel Colascione <dancol@dancol.org>
- char_is_quoted: make analogous changes to handle $'...' so we can
accommodate $'ab \' cd'
10/11
-----
subst.c,bashjmp.h
- no_longjmp_on_fatal_error: now global so other parts of the shell can
use it
arrayfunc.c
- expand_array_index: if no_longjmp_on_fatal_error is non-zero, don't
longjmp to top_level, just return 0. Fixes bug reported by
isabella parakiss <izaberina@gmail.com>
subst.c
- CQ_RETURN: restore old value of no_longjmp_on_fatal_error (oldjmp);
make sure all callers (skip_matched_pair, skip_to_delim,
char_is_quoted) save no_longjmp_on_fatal_error to oldjmp before
setting it to 1
expr.c
- expr_streval: if longjmping after an unbound variable error, jump
back to expr toplevel (evalbuf) if no_longjmp_on_fatal_error is set
in an interactive shell
variables.c
- push_func_var: if pushing an array variable, such as when a variable
in the temporary environment is promoted to an array by mapfile when
the shell is in posix mode (so variable assignments preceding special
builtins or shell functions persist in the shell environment after
the builtin returns), make sure to copy the array or hash table so
the variable is duplicated correctly. Fixes seg fault reported by
Linda Walsh <bash@tlinx.org>
10/13
-----
variables.c
- initialize_shell_variables: add call to sv_shcompat, so BASH_COMPAT
can be set in the initial environment
execute_cmd.c
- execute_function: set loop_level to 0 only if shell_compatibility_level
is greater than bash-4.3; this was kind of an incompatible change.
Report from Carlos Pita <carolosjosepita@gmail.com>
COMPAT,doc/{bash.1,bashref.texi}
- compat43: added loop_level changes to description
10/15
-----
lib/sh/casemod.c,lib/readline/display.c
- make sure mb_cur_max variable is defined outside of HANDLE_MULTIBYTE
if it's used outside HANDLE_MULTIBYTE. Fixes from Greg Wooledge
<wooledg@eeg.ccf.org>
support/Makefile.in
- bash.pc: remove as part of distclean, not clean. Report from Andreas
Schwab <schwab@linux-m68k.org>
10/17
-----
subst.c
- array_var_assignment: make sure to call quote_string or quote_escapes
on the assignment string, so spaces in the assignment survive word
splitting. Fixes bug reported by isabella parakiss
<izaberina@gmail.com>
10/20
-----
doc/{bash.1,bashref.texi}
- word splitting: make sure that newline is listed as one of the IFS
whitespace characters. Fixes omission reported by ziyunfei
<446240525@qq.com>
lib/readline/histfile.c
- history_do_write: make sure that we only create and use the tempfile
if the history file exists and is a regular file. Reported several
times, most recent check the result of a report from
<marko.teiste@gmail.com>
10/22
-----
jobs.c
- delete_all_jobs: if running_only == 0, we are eventually going to
clear the bgpids list, so don't bother to add pids to it in
delete_job (call with DEL_NOBGPID flag if running_only == 0)
10/24
-----
jobs.[ch]
- bgpids: new implementation from a patch from John Fremlin
<john@fb.com>, uses an array for the list of the last CHILD_MAX
terminated background pids, and a separate hash table to search it.
The storage can be freed as a unit, and the size of the hash table
(currently 4096) is independent of the size of the bgpids table
subst.c
- inherit_errexit: new variable to control whether or not command
substitution inherits the -e (errexit) option. Disabled by default
general.c
- posix_initialize: set inherit_errexit = 1 when Posix mode is enabled
builtins/shopt.def
- inherit_errexit: new shell option, tracks value of inherit_errexit,
allows command substitution to inherit the setting of errexit without
posix mode. From a request and patch submitted by Christoph Gysin
<christoph.gysin@gmail.com>
{version,version2}.c
- use #if HAVE_SNPRINTF instead of #if defined in case configure
decides to #define it to 0. Fixes problem reported by Klaus Ziegler
<klausz@haus-gisela.de>
configure.ac
- when checking for sys/resource.h, make sure to include <sys/time.h>
for the benefit of both old systems that require it and new versions
of autoconf that require a header file to compile to report its
presence. Reported by Klaus Ziegler <klausz@haus-gisela.de>
10/26
-----
subst.h
- SD_ARITHEXP: new flag value for skip_to_delim, supports parsing
arithmetic expressions in parameter expansions
subst.c
- skip_to_delim: handle SD_ARITHEXP flag by skipping parentheses for
subexpressions and allowing ?: expression to not terminate an
arithmetic expression delimited by `:'
- skiparith: just call skip_to_delim with the SD_ARITHEXP option and
the right delimiter string and return the right result. Fixes bug
reported by <grishalevit@gmail.com>
include/shmbchar.h
- strip out everything except what is needed to support is_basic and
similar functions, since the mbchar_t typedef apparently conflicts
with some AIX-specific type definition. Problem reported by
Michael Felt <aixtools@gmail.com>
10/27
-----
builtins/{set,ulimit}.def
- {set,ulimit}_builtin: make sure that --help is treated the same as
-? and prints a message and returns. Fixes bug reported by ziyunfei
<446240525@qq.com>
builtins/*.def
- make sure to consistently use builtin_help() instead of mix of that
function and builtin_usage()
10/29
-----
doc/{bash.1,bashref.texi}
- BASH_CMDS, BASH_ALIASES: note that removing elements from these
array variables is not currently reflected in the command hash
table and alias list, respectively. Reported by isabella parakiss
<izaberina@gmail.com>
10/30
-----
eval.c
- reader_loop: if PS0 is set in an interactive shell, expand and
display it after reading a (complete) command but before executing
it. This differs from the DEBUG trap because the DEBUG trap is
executed once for each simple command (and some others, like each
time through a for loop). From a patch submitted by Dan Stromberg
<dstromberglists@gmail.com>
parse.y
- prompt_again: set ps0_prompt from $PS0 in an interactive shell
doc/{bash.1,bashref.texi}
- PS0: document new prompt string
11/3
----
subst.c
- cond_expand_node: if special > 0, remove quoted nulls from the word
list, since no word splitting takes place. Fixes bug reported by
Corentin Peuvrel <cpeuvrel@pom-monitoring.com>
11/4
----
doc/{bash.1,builtins.texi}
- inherit_errexit: add to shopt description; modify Posix mode
description
11/9
----
lib/readline/util.c
- rl_tilde_expand: fix out-of-bounds read caused when this function
is invoked with rl_point == 0. Bug reported by Hanno Böck
<hanno@hboeck.de>
11/11
-----
{nojobs,jobs}.c
- get_original_tty_job_signals: force the original signal disposition
for SIGTSTP/SIGTTIN/SIGTTOU to SIG_DFL in interactive shells. This
will force child processes to get SIG_DFL even if the shell is
started with those signals ignored. From a bug report from
Keith Thompson <keithsthompson@gmail.com>
11/13
-----
make_cmd.c
- make_function_def: if a function is being defined without a source
file, and the shell has not been initialized, assume that the
function is being imported from the environment and set the
source_file struct member to "environment". Set to "main" if the
shell has been initialized. Fixes bug reported on savannah by
Arno-Can Uestuensoez
https://savannah.gnu.org/support/index.php?108903
subst.c
- skip_to_delim: if the shell is in posix mode (posixly_correct != 0)
and performing history expansion ((flags & SD_HISTEXP) != 0), allow
double quotes to quote the history expansion character. TENTATIVE
CHANGE, inspired by
https://savannah.gnu.org/support/index.php?108491
11/14
-----
jobs.c
- wait_for: modify change from 4/23 to only give the terminal to
shell_pgrp if not running in the background and subshell_environment
indicates we're not in a pipeline and not an async command. Fixes
bug reported by konsolebox <konsolebox@gmail.com>
11/16
-----
doc/{bash.1,bashref.texi}
- document new posix-mode behavior of not giving ! special meaning
within double quotes, even if histexpand is enabled
11/17
-----
builtins/evalfile.c
- fc_execute_file: pass FEVAL_BUILTIN flag to _evalfile so it returns
the value of parse_and_execute after executing the commands in the
file. Fixes bug reported by Chris Marusich <cmmarusich@gmail.com>
11/20
-----
subst.c
- process_substitute: don't unconditionally set pipeline_pgrp to
shell_pgrp; do that only if pipeline_pgrp == 0 (we haven't forked
yet) or if we know we haven't forked for a command, a pipeline,
or an async command. Fixes bug reported by
<gnu.20.drkshadow@spamgourmet.com>
as https://savannah.gnu.org/support/index.php?108593
11/24
-----
variables.c
- set_pwd: inherit the value of OLDPWD from the initial environment
if it names a directory. From a report from John Wiersba
<jrw32982@yahoo.com>
builtins/set.def
- -T: fix help text to note that the DEBUG and RETURN traps are both
inherited if this is set. Report from Grisha Levin
<grishalevit@gmail.com>
doc/{bash.1,bashref.texi}
- HISTIGNORE,GLOBIGNORE: note that the pattern matching is subject to
the setting of the `extglob' variable. Clarification raised by
Aharon Robbins <arnold@skeeve.com>
builtins/jobs.def,doc/{bash.1,bashref.texi}
- disown: add text to synopsis making it clear that disown takes a
pid argument. From a report from Matthew Stanfield
<matthew@i-dig.info>
findcmd.c,doc/{bash.1,bashref.texi}
- EXECIGNORE: change pattern matching to use FNMATCH_EXTFLAG like other
IGNORE variables. From a report from Aharon Robbins <arnold@skeeve.com>
trap.c
- _run_trap_internal: make sure to catch and use return values supplied
as arguments to `return'; instead of just catching return, make sure
we use return_catch_value as well. Fixes bug reported by
Grisha Levit <grishalevit@gmail.com>, affects RETURN, DEBUG, ERROR
traps
11/30
-----
lib/readline/display.c
- rl_redisplay: fix code that deals with prompts that contain
multibyte characters whose physical length is longer than the screen
width (so the prompt line wraps) to deal with invisible characters
in the prompt and set the inv_lbreaks offsets correctly and set
lpos appropriately
- _rl_move_cursor_relative: always called with either visible line or
invisible line. Decide whether we are being called with the invisible
line (or a portion thereof) as the DATA argument; make sure to account
for invisible characters in the last line of the prompt by offsetting
the desired buffer offset (NEW) by where DATA starts in invisible line
and checking whether that is past the last invisible character in
the prompt
- _rl_move_cursor_relative: do the same for the visible line by using
the visible line lbreaks array instead of _rl_screenwidth, since
that fails in the presence of multibyte characters (buffer offset
vs. physical screen position). These fix bug with prompts with
multibyte characters and invisible characters that are longer than
the screen width reported by Ryo Furue <ryofurue@gmail.com>
12/1
----
parse.y,make_cmd.c
- here_doc_first_line: new variable, set to non-zero to indicate the
first line of possibly multiple here documents associated with the
current command. Set in parse.y:gather_here_documents() before
reading any here documents, set to 0 after reading the first line
of any here document in make_cmd.c:make_here_document().
parse.y
- history_delimiting_chars: if parser_state indicates we are reading
a here document, don't use current_command_line_count to see whether
or not we're on the first line of a here document -- it can be fooled
by multi-line commands (or even backslash-escaped newlines). Use
here_doc_first_line to check that directly. Fixes bug reported by
Geoffrey Allott <geoffrey@allott.email>
shell.h,parse.y
- save and restore here_doc_first_line as part of the shell's parser
state
lib/sh/tmpfile.c
- use ANSI-C rand() interface if random() not available. Fixes problem
with linking on (ancient) Solaris 2.4 reported by Klaus Ziegler
<klausz@haus-gisela.de>
12/2
----
aclocal.m4
- RL_LIB_READLINE_VERSION: if cross-compiling, assume current version
of readline if cross-compiling bash while using an external readline
library. Fix from Barry Davis <barry_davis@stormagic.com>
execute_cmd.c
- execute_builtin: save and restore value of builtin_ignoring_errexit
instead of assuming we can set it back to 0 -- the ignore-errexit
cases might be nested
- execute_builtin: after a builtin executes and eval_unwind is set,
set exit_immediately_on_error to 0 if builtin_ignoring_errexit is
set, and back to the value of errexit otherwise, just like the
code that sets -e does. Fixes short-circuiting bug reported by
Marcin Swigon <swigon.mar@gmail.com>
12/5
----
builtins/setattr.def
- set_or_show_attributes: instead of using a fixed string for the
options argument to `declare', which results in export adding the
readonly attribute, build the option string dynamically like in
subst.c:shell_expand_word_list()
- set_or_show_attributes: don't add the -r option to declare if the
attribute passed as an argument doesn't include att_readonly; add
-x if the attribute includes att_exported
- set_or_show_attributes: add the -g option to declare so readonly
and export in functions that go through this code path don't create
local variables. Part of fix for bug reported by ziyunfei
<446240525@qq.com>
execute_cmd.c
- make_internal_declare: if we have an assignment builtin that isn't
supposed to create local variables (export/readonly), make sure to
add the W_ASSNGLOBAL flag to each assignment statement word.
Part of fix for bug reported by ziyunfei <446240525@qq.com> where
readonly can create local variables when invoked with a compound
array assignment as an argument within a shell function
subst.c
- make_internal_declare: added third argument: command name. Not used
in any useful way yet
- do_compound_assignment: handle attempted assignments to readonly
variables and print error messages, like bind_variable does and the
callers expect. This means that assignments to readonly array
variables can't go through a code path that allows them to fail
silently
doc/Makefile.in
- uninstall: run install-info --delete after removing the installed
info file to update the directory file
execute_cmd.c
- execute_disk_command: since we still (and have always) perform
redirections in child processes, we need to mark that state so
we know that we're in a child process. subshell_performing_redirections
is the new variable; non-zero when executing do_redirections()
subst.c
- process_substitute: if we are executing process substitution in a
redirection expansion context (expanding_redir == 1), the child
process should not have access to any temporary environment the
parent has. Call flush_tempenv() in the child process to get rid
of it. Fix for bug reported by Clint Hepner <clint.hepner@gmail.com>
12/9
----
jobs.c
- waitchld: if in posix mode and attempting to let SIGCHLD interrupt the
wait builtin, make sure wait_intr_flag is non-zero before trying to
longjmp to wait_intr_buf. Fixes bug reported by Aharon Robbins
<arnold@skeeve.com>
12/10
-----
lib/readline/display.c
- update_line: if a prompt containing invisible characters changes,
and the change is within the prompt string, we need to redraw the
entire prompt. After that redraw, if the cursor position is after
the first index where the old and new lines differ, we can short-
circuit the update if the line length stays the same
- update_line: if we redraw the entire prompt string because the prompt
contains invisible characters and the first difference is in the
middle of the prompt, we possibly need to adjust our idea of the
first differing character in the old and new lines. We punt and do
a dumb update in this case. Fixes bug with dynamic vi-mode mode
strings containing invisible characters reported by Dylan Cali
<calid1984@gmail.com>
12/11
-----
lib/readline/display.c
- update_line: if we move up to a new screen line, we need to recompute
the number of invisible characters on the new current line
(visible_wrap_offset). Fixes bug reported to bug-readline by
Per Bothner <per@bothner.com>
- update_line: update code that attempts to compute where we are in
the new line buffer. Fixes `vt100' bug reported to bug-readline by
Per Bothner <per@bothner.com>
12/18
-----
execute_cmd.c
- execute_function: unwind-protect and restore BASH_ARGC and BASH_ARGV
- restore_funcarray_state: now global
execute_cmd.h
- make func_array_state type global, add extern function declaration
for restore_funcarray_state
builtins/evalfile.c
- _evalfile: use restore_funcarray_state and pop_args as unwind-protects
to restore BASH_{SOURCE,LINENO,ARGC,ARGV} and FUNCNAME on interrupts.
Fixes bug reported back on 11/10 by Grisha Levit
<grishalevit@gmail.com>
12/20
-----
lib/readline/isearch.c
- _rl_isearch_dispatch: after removing the only character from the
search string with DEL, leaving the search string empty, don't match
the previous line if we didn't have a match before
12/22
-----
bashhist.c
- enable_history_list,remember_on_history: initialize to 0 instead of 1
shell.c
- init_interactive,init_interactive_script: set enable_history_list and
remember_on_history to 1 (defaults)
12/23
-----
variables.c
- initialize_shell_variables: don't inherit PS4 from the environment
if the shell is running with euid == 0; just reset it to `+ '. This
is a known potential vulnerability, since PS4 expansion performs
command substitution in the root shell's context before displaying
it. Discussion started by up201407890@alunos.dcc.fc.up.pt
bashhist.c
- bash_history_reinit: initialize remember_on_history to the value of
enable_history_list (set -o history). Fixes bug reported by
Stephane Chazelas <stephane.chazelas@gmail.com> with command-line
option `-o history' not having any effect
12/28
-----
lib/readline/{history.h,histfile.c}
- history_file_version: new int variable, reserved for future use
- history_multiline_entries: new int variable, can be set by the
calling application to enable reading multi-line history entries
from the history file (currently undocumented)
lib/readline/history.c
- _hs_append_history_line: new function, append a line passed as an
argument to a specified history entry, used to create multi-line
history entries
lib/readline/histfile.c
- read_history_range: implement a heuristic that temporarily sets the
history comment character if the first line read from the history
file looks like it has is a timestamp (#[:digit:]) so we can read
timestamps from the history file properly. Originally reported
back in March 2015 by Christoph Anton Mitterer <calestyo@gmail.com>
- read_history_range: make sure history_multiline_entries is non-zero
if the history file looks like it has timestamps
- read_history_range: if we think we have a history file with timestamps
and we read more than one non-timestamp consecutive history lines,
assume they are part of a single multi-line history entry and paste
them together using _hs_append_history_line. Feature most recently
requested by james harvey <jamespharvey20@gmail.com>, also suggested
by Christoph Anton Mitterer <calestyo@gmail.com>
examples/loadables/setpgid.c
- setpgid: new loadable builtin, originally contributed by Jason
Vas Dias <jason.vas.dias@gmail.com>
12/29
-----
bashhist.c
- bash_history_inhibit_expansion: fix cases where a history expansion
should be skipped because it's in a command or process substitution
but there is another history expansion preceding the substitution
on the command line. Don't let the previous history expansion fool
the function into saying the command substitution history expansion
should be performed
builtins/evalstring.c
- parse_prologue: always unwind-protect history_expansion_inhibited,
since history expansion can be enabled in non-interactive shells,
and calling eval once in a non-interactive shell inhibits history
expansion forever even if `set -o histexpand' was run before the
eval
builtins/common.h
- SEVAL_NOHISTEXP: new flag for parse_and_execute/parse_string; means
to not perform history expansion (decouple from SEVAL_NOHIST, which
now means to not remember commands on history); changed all callers
that had SEVAL_NOHIST to have SEVAL_NOHIST|SEVAL_NOHISTEXP
builtins/evalstring.c
- parse_prologue: instead of calling bash_history_disable, set
remember_on_history to 0 if SEVAL_NOHIST and history_expansion_inhibited
to 1 if SEVAL_NOHISTEXP
12/30
-----
subst.c
- skip_to_histexp: new function, a stripped-down version of skip_to_delim.
Used to skip to the next unquoted instance of the history expansion
character, handles peculiar quoting and command/process substitution
requirements. Better fix for bug reported by
Zigmund.Ozean@zig-home.localdomain back in January, prompted by report
from Keith Thompson <keithsthompson@gmail.com>
bashhist.c
- bash_history_inhibit_expansion: use skip_to_histexp instead of
skip_to_delim
subst.c
- parameter_brace_expand_rhs: if the rhs of an expansion is "$@" and
IFS is null, we need to separate the (quoted) positional parameters
in the returned word with a space, and mark the word as needing to
be split on spaces (W_SPLITSPACE). Fix for issues reported back in
October 2014 as the result of an austin-group discussion, and just
re-reported by Martijn Dekker <martijn@inlv.org>
1/4/2016
--------
execute_cmd.c
- execute_simple_command: if autocd is set, invoke a function named
`cd' if one exists, instead of the shell builtin. Feature requested
by transl8czech@gmail.com
builtins/mkbuiltins.c
- if a command's short description is the same as its name (e.g., `true'),
don't mark the short doc to be translated. Report and fix from
Benno Schulenberg <bensberg@justemail.net>
1/6
---
subst.c
- command_substitute,process_substitute: before replacing the file
descriptor underlying stdout (fd 1), make sure to purge any pending
stdio output that hasn't been written successfully, even after a
call to fflush(). Fixes bug reported by cks@cs.toronto.edu
1/7
---
builtins/{echo,printf}.def
- echo_builtin,printf_builtin: don't use terminate_immediately; use
calls to QUIT in the body of the print loop after writes and flushes.
Fixes problem with running the signal handler and exit trap in a
signal context and other bug reported by cks@cs.toronto.edu
builtins/common.c
- sh_chkwrite: put in calls to QUIT to catch signals that interrupt
writes
shell.c
- get_current_user_info: protect endpwent() with #ifdef HAVE_GETPWENT.
Fixes bug reported by pb <p-bauer-schriesheim@t-online.de>
1/8
---
lib/readline/bind.c
- _rl_init_file_error: now a varargs function so it can take format
strings and arguments and pass them to vfprintf
- rl_parse_and_bind: print a warning if we encounter a key binding
string with one or more hyphens but we don't find a valid modifier
(`control', `meta', etc.). Prompted by a report from Andrew Kurn
<kurn@sfu.ca>
- rl_parse_and_bind: improve several existing error messages now that
_rl_init_file_error takes a variable number of arguments
- rl_variable_bind: print error message upon encountering unknown
variable
1/10
----
lib/readline/bind.c
- rl_parse_and_bind: if a `bare' keybinding is supplied without any
terminating `:' or whitespace separating it from the command to be
bound, signal an error
1/11
----
subst.c
- process_substitute: when compiled without job control (JOB_CONTROL not
defined), make sure we call stop_making_children like we do in the job
control code branch, so already_making_children is reset to 0. This
is what command substitution does. Fixes bug reported by Alastair
Hughes <hobbitalastair@yandex.com>
1/12
----
execute_cmd.c
- execute_in_subshell: if a user subshell (`(command)') or other shell
compound command has an input pipe, note for later by setting
stdin_redir. This will inhibit the implicit redirection of standard
input from /dev/null for async commands executed as part of this
subshell. Fixes bug reported by Martin D Kealey <martin@kurahaupo.gen.nz>
- execute_simple_command: if the shell forks to execute this command
because it has an input pipe, set stdin_redir to inhibit later redirection
from /dev/null for async commands
1/13
----
execute_cmd.c
- HASH_BANG_BUFSIZE: use #define for size of buffer used in
READ_SAMPLE_BUF instead of straight constant 80
- HASH_BANG_BUFSIZ: increase to 128 because Linux allows 128 chars in
exec header. Reported by Ludovic Courtès <ludo@gnu.org>
configure.ac
- remove support for purify and purecoverage
- change release level to `rc1'
1/15
----
builtins/enable.def
- dyn_load_builtin: fix missing argument to builtin_error if load function
returns an error. Fix from Aharon Robbins <arnold@skeeve.com>
1/18
----
builtins/history.def
- histtime: display a better error message for invalid timestamps; use
existing `??' string for empty/missing timestamps or invalid history
entries. Suggestion from Reuben Thomas <rrt@sc3d.org>
1/21
----
lib/readline/text.c
- rl_insert: when trying to optimize typeahead, make sure to reset the
key sequence and key sequence length when we read a character that is
not bound to self-insert. Bug report from Geir Hauge
<geir.hauge@gmail.com>
1/25
----
doc/{bash.1,bashref.texi}
- word splitting: add example showing how -d'' is equivalent to -d
after word splitting and null argument removal
1/27
----
doc/{bash.1,bashref.texi}
- read: modify description to make it more clear that the line is split
using the same rules as word splitting, and use `delimiters' instead
of `separators', which people read the wrong way
2/2
---
variables.c
- initialize_shell_variables: allow FUNCNEST to set funcnest_max when
imported from the environment. Inspired by
https://bugzilla.redhat.com/show_bug.cgi?id=1274553
2/11
----
bashhist.c
- bash_history_inhibit_expansion: function should be compiled in only if
BANG_HISTORY is defined. Report from isabella parakiss
<izaberina@gmail.com>
[bash-4.4-rc1 frozen]
2/15
----
lib/readline/text.c
- rl_refresh_line: call rl_redraw_prompt_last_line instead of
rl_forced_update_display to avoid redrawing all lines of a multiline
prompt (overwriting the last line of the multiline prompt in the
process). Report from Hugh Davenport <hugh@davenport.net.nz>
2/18
----
subst.c
- parameter_brace_expand: when processing ${!name[@]}, make sure to
free `name' before returning the list of keys to avoid a memory leak.
Fixes bug reported by Emilio PastorMira <Emilio.PastorMira@utimaco.com>
2/19
----
trap.c
- free_trap_strings: when freeing the `special' traps (NSIG to BASH_NSIG),
check whether or not the `signal' is trapped, as it would be if the
subshell inherited it (errtrace) and don't free the trap string in that
case. Fixes bug reported by Jan Klötzke <jan@kloetzke.net>
2/21
----
lib/sh/netconn.c
- isnetconn: return false if getpeername fails with errno == EBADF.
Bug and fix from Andrew Gregory <andrew.gregory.8@gmail.com>
builtins/shopt.def
- parse_bashopts: when reading BASHOPTS from the environment, make
sure to call any set functions associated with a variable, instead
of just setting the value to 1. Report and fix from
Vehlow, Jörg <Joerg.Vehlow@kratzer-automation.com>
2/22
----
lib/readline/complete.c
- rl_display_match_list: don't bother calling strrchr to check the
return value from printable_part() if rl_filename_completion_desired
is non-zero, since in that case printable_part just returns its
argument. Fixes git completion issue reported by
Dilyan Palauzov <dilyan.palauzov@aegee.org>
- _rl_colored_completion_prefix: default is now 0, testing is complete
2/23
----
variables.c
- assign_hashcmd: if the shell is restricted, reject attempts to add
pathnames containing slashes to the hash table, as the hash builtin
does. Fixes bug reported to savannah by Sylvain Beucler as
https://savannah.gnu.org/support/?108969
2/24
----
subst.c
- NEED_FPURGE_DECL: need it before externs.h included, since fpurge
is now used in this file. Fixes warning reported by Mike
Frysinger <vapier@gentoo.org>
- skip_double_quoted: add missing argument to declaration
parse.y
- shell_getc: in call to internal_warning, use %lu to print an argument
cast explicitly to unsigned long. Fixes warning reported by Mike
Frysinger <vapier@gentoo.org>
2/27
----
parse.y
- decode_prompt_string: quote result of \s expansion in case shell has
been invoked with a pathname like '$(id)'. Inspired by report from
Travis Garrell <travis.garrell@oracle.com>
- decode_prompt_string: quote result of \h and \H expansions in the
(unlikely) case that the hostname has been changed to something
malicious including a command substitution. From report from
Travis Garrell <travis.garrell@oracle.com>
builtins/getopts.def
- getopts_unbind_variable: new static function, just calls unbind_variable
for now. Placeholder for any future work to do something special if
OPTARG is readonly. Based on discussion started by Robert Elz
<kre@munnari.oz.au>
lib/readline/vi_mode.c
- rl_vi_unix_word_rubout: new function, implements ^W as Posix specifies
it for vi mode, using whitespace and punctuation characters as word
boundaries. Prompted by question from Carlos Pita
<carolosjosepita@gmail.com>
lib/readline/vi_keymap.c
- bind rl_vi_unix_word_rubout to ^W by default in both insert and
command mode
lib/readline/rltty.c
- _rl_bind_tty_special_chars: if in vi mode, bind the WERASE character
to rl_vi_unix_word_rubout
lib/readline/funmap.c
- vi-unix-word-rubout is new bindable name for rl_vi_unix_word_rubout
lib/readline/readline.h
- rl_vi_unix_word_rubout: new extern declaration
2/28
----
doc/bash.1
- document readline blink-matching-paren variable
- document readline completion-display-width variable
- document readline completion-map-case variable
- note that the default value of history-size depends on the value of
the HISTSIZE variable. All from a message from Branden Robinson
<g.branden.robinson@gmail.com>
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- convert-meta: modify the description to note that readline will turn
the default to off if the locale contains eight-bit characters
- input-meta: modify the description to note that readline will turn
the default to on if the locale contains eight-bit characters
- output-meta: modify the description to note that readline will turn
the default to on if the locale contains eight-bit characters. From
a message from Branden Robinson <g.branden.robinson@gmail.com>
3/6
---
examples/loadables/Makefile.in
- install-dev: make installdirs a prerequisite; don't rely on the
install-supported target to create it first. Bug with parallel
install (`make -j 4 install') reported by Chris Staub
<cstaub67@gmail.com>
3/12
----
lib/readline/display.c:
- rl_clear_visible_line: clear all screen lines occupied by the current
visible readline line. Inspired by report from Lauri Ranta
<lauri.ranta@gmail.com>
lib/readline/readline.h
- rl_clear_visible_line: extern declaration
lib/readline/doc/rltech.texi
- rl_clear_visible_line: add documentation
3/19
----
findcmd.c
- file_status: add inadvertently-dropped test for EXECIGNORE to the
`other' bits check. The check was in the original patch
- search_for_command: if the file should not be considered executable
because it's in the EXECIGNORE blacklist, don't set file_to_lose_on,
since the attempt to execute the last-ditch path will circumvent the
EXECIGNORE setting. Fixes bug reported by Dennis Williamson
<dennistwilliamson@gmail.com>
3/28
----
lib/readline/display.c
- rl_redisplay: when computing where the cursor should go (and the
physical cursor position) after displaying the prompt, don't adjust
the cursor position by wadjust if there are no multibyte chars in
the prompt. lpos is already a physical cursor position; _rl_screenwidth
is the physical screen width, and we're not calling _rl_col_width and
don't need to take invisible characters into account again. Fixes
bug reported by Andreas Schwab <schwab@linux-m68k.org>
4/1
---
parse.y
- parse_comsub: when we read `esac' followed by a break character,
turn on the LEX_RESWDOK flag because we can now read another case
statement or other compound command. Fixes bug reported by
Christian Franke <Christian.Franke@t-online.de>, original version
of patch from Piotr Grzybowski <narsil.pl@gmail.com>
- parse_comsub: leave the reserved-word-ok flag set for four-char
reserved words (then/else/elif/done/time) that can be followed by
reserved words; set lex_rwlen to 0 so we know to start reading a
new one
4/7
---
builtins/{alias,complete,jobs}.def
- {alias,compopt,disown}: add missing `CASE_HELPOPT;' so --help option
prints help longdoc instead of builtin_usage()
4/8
---
arrayfunc.c
- assign_array_var_from_word_list: use bind_array_var_internal instead
of inline code, so value conversions happen on assignment (case
modification, arithmetic evaluation, etc). Fixes bug reported by
Geir Hauge <geir.hauge@gmail.com>
4/9
---
shell.c
- main: change the logic that determines whether or not bash is running
under an emacs terminal emulator so it works with future versions of
emacs, which will change to use only $INSIDE_EMACS. Report and fix
from Paul Eggert <eggert@cs.ucla.edu>
lib/glob/sm_loop.c
- EXT: if we see ?(pat), we can match 0 or 1 times, so if we don't
match, we should consume the extglob pattern and go on to attempt
to match the rest of the pattern against the string. Fixes bug
reported by Isabella Parakiss <izaberina@gmail.com>
- GMATCH: in case `*', don't short-circuit and match anything if the
* is the last character in the pattern until after we check the
special cases for matching a `.'. Fixes bugs reported back on 3/23
by Isabella Parakiss <izaberina@gmail.com>
4/13
----
bashhist.c
- hc_erasedups: fix memory leak by freeing history entry returned by
remove_history. Bug and fix from Seiichi Ishitsuka
<ishitsuka.sc@ncos.nec.co.jp>
4/19
----
config-top.h
- CD_COMPLAINS: now settable in config-top.h; enables (fatal) error
messages if cd is given multiple directory arguments
4/20
----
execute_cmd.c
- coproc_setvars: refuse to create variables with names that are not
valid identifiers. Suggestion from Piotr Grzybowski
<narsil.pl@gmail.com>
rltty.c
- rl_tty_set_echoing: interface to set _rl_echoing_p, returning old
value. Inspired by gdb use of _rl_echoing_p when switching
between terminal and curses modes described by Doug Evans
<dje@google.com>
bashline.c
- bash_execute_unix_command: use rl_clear_visible_line instead of
erasing current line on the screen, inspired by same report from
3/12. Still tentative change
configure.ac
- update release status to rc2, may skip this and go directly to
release
4/21
----
arrayfunc.c
- convert_var_to_array: make sure that the newly-converted array
variable is not marked as being an associative array. Fixes bug
reported by Grisha Levit <grishalevit@gmail.com>
- convert_var_to_assoc: make sure that the newly-converted associative
array variable is not marked as being an indexed array
4/22
----
builtins/evalstring.c
- should_suppress_fork: don't suppress the fork if there are any traps
set, since that requires that we hang around to react to a signal or
collect the command's exit status and run something. Fixes bug
reported by Brian Vandenberg <phantall@gmail.com>
histexpand.c
- history_tokenize_word: handle >| as a single token. Fix from
Piotr Grzybowski <narsil.pl@gmail.com> from a report from
idallen@idallen-fibe.dyndns.org
4/24
----
execute_cmd.
- coproc_setvars: don't overwrite readonly variables used as coproc
names. From a report from Grisha Levit <grishalevit@gmail.com>
histexpand.c
- history_tokenize_word: handle strings of digits before redirections
beginning with `<' or `>' as part of the redirection word; handle
strings of digits following `<&' or `>&' as part of the redirection
word. Inspired by patch from Piotr Grzybowski <narsil.pl@gmail.com>
from a report from idallen@idallen-fibe.dyndns.org
lib/readline/complete.c
- rl_display_match_list: if the common prefix is longer than any of
the possible matches, set the length of the common prefix to 0 so
the entire match gets printed for each match
- rl_display_match_list: make sure to output at least one space
between each displayed match, even if the displayed length is
longer than our computed max
- fnprint: if the length of the prefix (prefix_bytes) is greater than
or equal to the length of the string to be printed (print_len), make
sure to set the prefix length to 0 so the entire string is printed.
From a report from Grisha Levit <grishalevit@gmail.com>
4/25
----
subst.c
- command_substitute: update the conditions under which we give the
terminal to pipeline_pgrp with give_terminal_to to the same ones
where wait_for uses to decide whether to give the terminal back to
shell_pgrp. This code exists to undo the work wait_for does; it
has to give the terminal back to pipeline_pgrp only under those
conditions when wait_for gives it back to the shell pgrp. Fix for
bug reported by Paulo Bardes <bardes0022@gmail.com>
4/26
----
bashline.c
- bash_filename_stat_hook: temporarily disable the `nounset' shell
option around calls to expand_prompt_string so we don't get error
messages during completion. Fixes issue reported by Eric Pruitt
<eric.pruitt@gmail.com>
4/27
----
doc/{bash.1,bashref.texi}
- extdebug: clarify that having this option enabled at shell startup
acts identically to --debugger. From a report from Grisha Levit
<grishalevit@gmail.com>
jobs.[ch]
- wait_for_single_pid: now takes additional `int flags' argument
{jobs,execute_cmd}.c,builtins/wait.def
- wait_for_single_pid: changed callers to add extra argument
jobs.c
- wait_for_single_pid: if (flags & 1) == 0, don't print the error
message if PID isn't found; changed execute_pipeline call when
lastpipe is set
4/28
----
general.c
- bash_tilde_expand: try not setting interrupt_immediately or
terminate_immediately; see what happens with networked password
databases
4/29
----
subst.c
- parameter_brace_expand, parameter_brace_expand_rhs: now take an
additional `pflags' argument from its caller so we can pass
state
- parameter_brace_expand_rhs: if expand_string_for_rhs returns a
quoted null, but l_hasdollat is set to 1, meaning we saw a quoted
"$@" of some form, we need to turn off special handling of "$@"
so something like "${@-${@-$@}}" expands to an empty string like
Posix says it should. Fixes bug reported by Grisha Levit
<grishalevit@gmail.com>
5/1
---
variables.c
- bind_variable_internal: if we have a nameref variable with a valid
array reference that is invalid for assignment (e.g., a[*]), and
assign_array_element returns NULL, short-circuit and return NULL.
Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
general.[ch]
- valid_nameref_value: new function, return 1 if passed argument is
a valid variable name argument for a nameref variable: a valid
identifier, a valid array reference, or a valid positional
parameter. Second argument indicates whether the value is to be
used for an assignment; in this case, return an error if the name
consists of all digits
builtins/declare.def
- declare_internal: disallow values for nameref variables that don't
pass the tests in valid_nameref_value. Part of fix for bug
reported by Grisha Levit <grishalevit@gmail.com>
variables.c
- bind_variable_internal: if trying to assign a value to a nameref
variable, throw an error if valid_nameref_value fails (with a second
argument of 1). More fixes for bug reported by Grisha Levit
<grishalevit@gmail.com>
5/2
---
builtins/declare.def
- declare_internal: don't allow nameref attribute to be applied to an
existing readonly variable; it can be used to circumvent readonly
value. Fix for bug reported by Grisha Levit <grishalevit@gmail.com>
variables.[ch]
- find_variable_last_nameref, find_global_variable_last_nameref: takes
a new flags argument. If flags is non-zero, and we find a nameref
variable that is unset (has no value), return that variable instead
of NULL.
{variables,execute_cmd,arrayfunc,subst}.c,builtins/{declare,set}.def
- find_variable_last_nameref, find_global_variable_last_nameref: change
callers to add flags argument (initially 0)
5/3
---
variables.c
- bind_variable_internal: make sure we run the value of a namref
variable through valid_nameref_value before doing the assignment.
This can go away if we stop allowing namerefs to refer to positional
parameters
execute_cmd.c
- execute_select_command: if bind_variable returns NULL, handle it as
an error, as if attempting assignment to a readonly variable
- execute_for_command: use 1 as second argument to
find_variable_last_nameref, so it will return an invisible nameref
to assign for each variable in the list
- execute_for_command: if the current word in the list is an invalid
identifier and the loop variable is a nameref, handle it as an error,
as if attempting assignment to a readonly variable
5/4
---
variables.c
- bind_int_variable: add warning if assigning an int to a nameref
variable
- assign_in_env: if assigning a variable in the temporary environment
that is a namref, throw an error if trying to assign an invalid
value
- bind_variable_value: use valid_nameref_value instead of calls to
legal_identifier and valid_array_reference
execute_cmd.c
- coproc_setvars: if we have a nameref variable as the coproc name, but
it can't be assigned to for some reason, remove the nameref attribute
and issue a warning that we are doing so
- coproc_setvars: don't allow assignment to a nameref variable with an
invalid variable name, using same code as find_or_make_array_variable
general.c
- valid_nameref_value: disallow values consisting solely of digits,
like the positional parameters
builtins/declare.def
- declare_internal: don't call valid_nameref_value on the existing value
of a variable that's being converted to a nameref -- that value is
going to be thrown away and we've already checked the new value
- declare_internal: call bind_variable_value with the ASS_NAMEREF flag
if we're assigning to an existing nameref variable (for instance,
`declare -n x ; declare x=42')
5/5
---
variables.c
- make_local_variable: if we are being asked to create a local copy of
a nameref variable from a prior scope (checked by looking up
using find_variable_noref), use the nameref variable, not the variable
it references (which we find using find_variable). Bug report from
Grisha Levit <grishalevit@gmail.com> ; fix by Piotr Grzybowski
<narsil.pl@gmail.com>
builtins/declare.def
- declare_internal: if asked to do the same thing as above (difference
is declare -n r=foo in previous case; declare -n r in this one),
don't follow reference var from a previous context. Create a new
local variable (using make_local_variable) and inherit attributes
from previous scope's nameref as above
5/6
---
builtins/declare.def
- declare_internal: if we are assigning a value to an existing
invisible nameref variable, validate value early so we don't end up
removing the variable after the assignment fails
builtins/shopt.def
- toggle_shopts: don't call set_bashopts here unless $BASHOPTS exists,
since we don't want to set it up before it gets read from the
environment. Keeping BASHOPTS read-only should keep users from
unsetting it. Fix from Grisha Levit <grishalevit@gmail.com>
- shopt_set_debug_mode: make sure error_trace_mode reflects the setting
of extdebug. This one is tentative. Fix from Grisha Levit
<grishalevit@gmail.com>
- shopt_set_debug_mode: call set_shellopts after setting error_trace_mode
or function_trace_mode. Fix from Grisha Levit <grishalevit@gmail.com>
shell.c
- start_debugger: make sure that function_trace_mode and error_trace_mode
reflect the value of debugging_mode, so they are both disabled if we
disable debugging mode because we can't find the debugger start file.
Fix from Grisha Levit <grishalevit@gmail.com>
- start_debugger: set $SHELLOPTS and $BASHOPTS to the option values are
reflected if we change or set them here. Fix from Grisha Levit
<grishalevit@gmail.com>
builtins/set.def
- reset_shell_options: add reset values for: posix, nolog, pipefail.
Fix from Grisha Levit <grishalevit@gmail.com>
builtins/shopt.def
- reset_shopt_options: add reset values for: autocd, checkjobs,
complete_fullquote, dirspell, failglob, globstar, gnu_errfmt,
huponexit, inherit_errexit, interactive_comments, lastpipe,
no_empty_cmd_completion, progcomp. Fix from Grisha Levit
<grishalevit@gmail.com>
- reset_shopt_options: make sure the following options have the right
defaults based on #defines: checkjobs, checkwinsize, direxpand,
extglob, globasciiranges. Fix from Grisha Levit
<grishalevit@gmail.com>
flags.c
- reset_shell_flags: add missing flags, re-initialize history_expansion
based on STRICT_POSIX
5/8
---
lib/readline/histexpand.c
- history_expand: if any expansion returns 1 from history_expand_internal,
indicating that :p was supplied, make it apply to the entire line
like tcsh and csh. Fixes bug reported by Dean Stanton
<dstanton@tintri.com>
variables.[ch]
- ifsname: move define to variables.h
execute_cmd.c
- execute_for_command: check whether or not the word in the for command
is IFS; call setifs every time the variable is assigned a value.
Fixes bug report from Grisha Levit <grishalevit@gmail.com>
5/16
----
general.c
- valid_nameref_value: explicitly handle name == 0 and *name == 0 right
away to save calls to legal_identifier
builtins/declare.def
- declare_internal: if trying to set nameref attribute on a variable
with a null value, flag as invalid assignment, just as if running
`declare -n r=""'. Fixes bug report from Grisha Levit
<grishalevit@gmail.com>
- declare_internal: when creating a variable with a temporary value
(""), use ASS_FORCE in the assignment flags to bypass name validity
checks on nameref variable names
variables.c
- bind_variable_internal: don't call valid_nameref_value if we're
forcing assignment with (flags & ASS_FORCE)
builtins/read.def
- read_builtin: handle bind_variable returning NULL when setting REPLY.
Report and fix from Grisha Levit <grishalevit@gmail.com>
builtins/setattr.def
- set_var_attribute: handle bind_variable returning NULL
lib/sh/tmpfile.c
- sh_seedrand(): call srandom() to seed the random number generator
- sh_mktmpname, sh_mktmpfd: if we have random(), assume we have
srandom() and seed the random number generator. Still looking for
better value to see random number generator with
variables.c
- check_unbind_variable: use internal_error instead of builtin_error
{execute_cmd,variables}.c
- fix some places where bind_variable could return NULL and it was not
checked. Fix from Piotr Grzybowski <narsil.pl@gmail.com>
5/17
----
arrayfunc.c
- convert_var_to_{array,assoc}: make sure to turn off nameref attribute,
since namerefs can't be arrays
execute_cmd.c
- coproc_setvars: if the coproc name names a nameref, resolve the
nameref and use it as the name of the coproc. Suggested by Grisha
Levit <grishalevit@gmail.com>
subst.c
- command_substitute: don't bother calling QUIT after calling
reset_signal_handlers in the child, kill the child with SIGINT in
case we just reset the signal handler to SIG_DFL and we should just
exit instead of throwing to top level. Fixes bug reported by
Grisha Levit <grishalevit@gmail.com>
5/18
----
variables.c
- find_variable_nameref_for_create: find a nameref variable whose value
doesn't resolve to an existing variable and see whether or not that
value is appropriate for a new variable to be created
- find_variable_nameref_for_assignment: find a nameref variable whose
value doesn't resolve to an existing variable and see whether or not
that value is appropriate for a new variable to be created.
Difference between _assignment and _create is that _assignment
allows the nameref value to be a subscripted array reference
builtins/setattr.def
- set_var_attribute: if variable lookup doesn't return anything, check
for a nameref and make sure that any reference value is something we
should be working on here, using find_variable_nameref_for_create().
If it fails, error out and return, otherwise it's probably a reference
to a variable that hasn't been set yet, so let bind_variable take care
of that. Report from Grisha Levit <grishalevit@gmail.com>
arrayfunc.c
- bind_array_variable: if find_shell_variable returns NULL, check for a
nameref using find_variable_nameref_for_create and create a new array
variable with the value if it returns a valid nameref variable.
Makes `unset var; declare -n ref=var ; ref[0]=foo' work right.
Report from Grisha Levit <grishalevit@gmail.com>
5/19
----
variables.[ch]
- unbind_variable_noref: unset a variable NAME without following any
nameref chain. If the first instance of the variable with that name
is a nameref, just unset that nameref variable.
builtins/getopts.def
- getopts_unbind_variable: if OPTARG is going to be unbound, use
unbind_variable_noref to unbind that name even if it is a nameref
variable. Issue raised by Grisha Levit <grishalevit@gmail.com>
execute_cmd.c
- coproc_unsetvars: use unbind_variable_noref in case someone sets the
coproc _PID variable as a nameref pointing to something read-only or
strange. Issue raised by Grisha Levit <grishalevit@gmail.com>
builtins/set.def
- set_ignoreeof: use unbind_variable_noref to unset "IGNOREEOF" and
"ignoreeof"
- set_posix_mode: use unbind_variable_noref to unset "POSIXLY_CORRECT"
variables.c
- make_vers_array: use unbind_variable_noref to unset "BASH_VERSINFO"
lib/sh/shmatch.c
- sh_regmatch: use unbind_variable_noref to unset "BASH_REMATCH"
bashline.c
- bash_execute_unix_command: use check_unbind_variable to unset
READLINE_LINE and READLINE_POINT
pcomplete.c
- unbind_compfunc_variables: use unbind_variable_noref to unset
COMP_LINE, COMP_POINT, COMP_WORDS, COMP_CWORD, COMP_TYPE, COMP_KEY
- gen_shell_function_matches: use unbind_variable_noref to unset
COMPREPLY
config-top.h
- USE_MKTEMP/USE_MKSTEMP: define by default to use libc version of
mktemp and mkstemp in lib/sh/tmpfile.c. Recommended by Mike
Frysinger <vapier@gentoo.org> to fix a FreeBSD problem
configure.ac,config.h.in
- mkstemp: check for mkstemp, define HAVE_MKSTEMP if available
config-bot.h
- USE_MKSTEMP: #undef if HAVE_MKSTEMP not defined
5/22
----
variables.c
- assign_in_env: if appending to a variable's value, make sure we call
make_variable_value with the empty string if expand_assignment_string_to_string
returns NULL, as do_assignment_internal does. Fixes bug with
`str=''; val=foo ; val+=str printenv val' reported by Grisha Levit
<grishalevit@gmail.com>
- assign_in_env: if assigning to a nameref variable in the temporary
environment, and the nameref has a valid value for assignment (even
if the target variable is not set), resolve the nameref and create
a variable in the temporary environment named by the nameref's value.
If the nameref variable is invisible or isn't set to a valid value
for assignment, just create a regular temporary variable with the
nameref's name. This provides a degree of ksh93 compatibility.
Suggested by Grisha Levit <grishalevit@gmail.com>
- find_variable_nameref_context,find_variable_last_nameref_context:
instead of returning NULL when detecting a loop, return a
distinguished value: &nameref_maxloop_value
- bind_variable: catch nameref_maxloop_value so we can do different
things based on whether or not we get it. Right now we don't do
anything different, but we could
5/24
----
lib/readline/display.c
- update_line,_rl_move_cursor_relative: save value of MB_CUR_MAX in a
variable and use it throughout the functions instead of recomputing it
every time (which possibly costs a function call)
5/25
----
builtins/declare.def
- declare_internal: only check whether the value being assigned to a
nameref variable is a valid identifier if we're not appending to an
existing value. Suggested by Grisha Levit <grishalevit@gmail.com>
- declare_internal: add a couple of more checks on nameref names:
o make sure `declare -n x[3]=y' is an error
o nameref variable self-references now produce a warning when
in function scope
o nameref variable self-references using subscripted arrays
(a=a[0]) now produce warnings at function scope and errors at
global scope
5/29
----
builtins/declare.def
- declare_internal: use name of readonly variable when calling sh_readonly
instead of name passed as argument to declare in case we've followed
a nameref chain
- declare_internal: when turning off attributes on a nameref variable
after following the nameref chain and turning them off on the target
variable, don't allow the readonly attribute to be removed. This is
primarily intended to turn off the nameref attribute. Issue pointed
out by Grisha Levit <grishalevit@gmail.com>
- declare_internal: if we are attempting to modify an existing global
nameref variable, and the -n option is supplied, operate on the
nameref variable itself, not the variable it references
doc/{bash.1,bashref.texi}
- change the descriptions of namerefs and declare -n slightly to note
that using the -n option to declare will operate on the nameref
variable itself rather than the variable it references
variables.c
- bind_variable_internal: if trying to assign to a read-only variable,
print the error message using the variable's name instead of the
name passed to bind_variable in case we followed a nameref
builtins/declare.def
- declare_internal: when we're creating a (possibly invisible) variable
as part of another operation, assigning NULL, make sure to use
ASS_FORCE to avoid warning messages from any existing nameref
variables we follow
- declare_internal: allow the nameref attribute to be removed from a
readonly nameref variable without a value but do not allow it to be
removed from a readonly nameref variable that has a value, even if it
doesn't reference an existing variable. This distinction is for ksh93
compatibility. Pointed out by Grisha Levit <grishalevit@gmail.com>
5/31
----
builtins/declare.def
- declare_internal: if the call to bind_variable_value fails for some
reason, make sure to restore the nameref attribute to flags_on and
flags_off before calling NEXT_VARIABLE
subst.c
- make_internal_declare: handle += append op
- shell_expand_word_list: when transforming assignment statement
arguments to `declare', make sure to handle += append op to avoid
passing invalid identifiers to declare. Report by Grisha Levit
<grishalevit@gmail.com>
6/1
---
builtins/declare.def
- declare_internal: if a nameref assignment fails, only call delete_var
to delete the variable if we created it in declare_internal in the
first place
general.c
- check_selfref: new function, checks a NAME against a VALUE for nameref
self-reference
general.h
- check_selfref: extern declaration
builtins/declare.def
- declare_internal: call check_selfref to determine whether a given NAME
and VALUE constitute an invalid nameref variable self-reference
variables.c
- bind_variable_internal: call check_selfref to determine whether a
given NAME and VALUE constitute an invalid nameref variable self-
reference
6/2
---
parse.y
- clear_shell_input_line: new function, clears contents of shell_input_line
and sets index to 0, but doesn't free it
externs.h
- clear_shell_input_line: extern declaration
builtins/evalstring.c
- parse_and_execute: call clear_shell_input_line after setting input to
string to be executed. Fixes problem with command substitution and
multi-line aliases reported by Grisha Levit <grishalevit@gmail.com>
eval.c
- parse_command: only execute PROMPT_COMMAND if the shell is not
currently expanding an alias; use the same tests as parse.y:SHOULD_PROMPT
and parse.y:prompt_again() use to decide whether or not to print a
prompt. Fixes problems with PROMPT_COMMAND and multi-line aliases
reported by Grisha Levit <grishalevit@gmail.com>
builtins/set.def
- unset_builtin: changes to fix three problems reported by Grisha
Levit <grishalevit@gmail.com>:
o if -n is supplied, we should not try to unset a function if
a variable isn't found
o unsetting namerefs whose values are array references does
not work
o unset -n n[0], where n is a nameref, would unset the
referenced variable instead of `n'
redir.c
- redir_varvalue: handle case where nameref var points to subscripted
array reference. Reported by Grisha Levit <grishalevit@gmail.com>
variables.c
- bind_variable_value: make sure to call check_selfref only if aflags
includes ASS_NAMEREF and not ASS_FORCE. Reported by Grisha Levit
<grishalevit@gmail.com>
general.c
- valid_nameref_value: now understands a FLAGS value of 2 to mean that
the name will be used to create a variable, so only legal_identifier
matters
arrayfunc.c
- find_or_make_array_variable: call valid_nameref_value with FLAGS value
of 2 to indicate we will be creating a variable. Fixes mapfile issue
reported by Grisha Levit <grishalevit@gmail.com>
6/5
---
builtins/declare.def
- declare_internal: only pass ASS_FORCE as part of assignment flags to
assignments concerning arrays
- declare_internal: when at the global scope, if we resolve a nameref
and commit to using the new name, go back to to the beginning of the
loop and use the new name in the checks and variable references.
Make sure we construct the new name as a straight substitution of
the nameref value into the old name, including array subscripts and
rebuilding the correct values for `offset' and `value', since they
are relative to the original value of name.
Fixes several issues with checking use of subscripted array variables
as nameref values
- declare_internal: when calling assign_array_element, make sure to
pass ASS_APPEND if aflags includes it, so things like
declare -a var; var[1]=1; declare var[1]+=4
append to the value appropriately and var[1] ends up being `14'
arrayfunc.c
- valid_array_reference: make sure the array reference is properly
terminated after the first subscript; return invalid if there is
anything following the closing `]'
6/12
----
variables.c
- bind_variable_internal: if asked to perform an array subscript
assignment on a nameref variable, display a warning and remove the
nameref attribute (as bash-4.3 did). Reported by Dan Douglas
<ormaaj@gmail.com>
6/14
----
test.c
- posixtest: handle four-argument case where argv[1] == '(' and
argv[4] == ')' by performing two-argument test on $2 and $3.
Reported by Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>
6/15
----
variables.c
- sv_ignoreeof: make sure ignoreeof is set only if IGNOREEOF is set and
has a value (no `local IGNOREEOF'). Reported by Grisha Levit
<grishalevit@gmail.com>
- sv_strict_posix: make sure posixly_correct is set only if
POSIXLY_CORRECT is set and has a value. Reported by Grisha Levit
<grishalevit@gmail.com>
6/16
----
builtins/declare.def
- declare_internal: analogous to 6/12 change; when performing an array
subscript assignment on a nameref, display a warning, remove the
nameref attribute, and go on
6/21
----
execute_cmd.c
- shell_execve: make sure errno is (re)set appropriately before
returning error value on exec format error
6/23
----
subst.c
- param_expand: when expanding $* in a context where splitting is not
desired (pflags & PF_ASSIGNRHS), make sure to quote the word and the
included separators. Reported by Dan Douglas <ormaaj@gmail.com>
6/30
----
configure.ac
- release version is now `beta2'
execute_cmd.c
- execute_simple_command: even if already_making_children is non-zero,
don't call wait_for if last_made_pid == NO_PID. Indirectly inspired
by report from Nicolas Vivet <nicolas@nzx.io>
7/2
---
subst.c
- expand_word_internal: when adding an IFS character to the accumulated
string, don't quote it if word expansion is not going to be
performed ((word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0) in the
default case. This was already the case everwhere else, when we did
`goto add_ifs_character;'. Fixes bug reported by Ibrahim M. Ghazal
<imgx64@gmail.com>
subst.[ch],arrayfunc.c
- string_list_dollar_at: now takes a new third argument, currently
reserved for future use; changed callers and declaration
7/7
---
[bash-4.4-beta2 frozen]
7/9
---
bashline.c
- check_redir: make sure that index is > 0 before checking previous
char; fixes out of bounds read reported by Hanno Böck
<hanno@hboeck.de>
7/16
----
subst.c
- parameter_brace_expand: if ${array[@]} or ${array[*]} is supplied
with an unset (or empty) array, and -u is enabled, don't make it
an unbound variable error, like $@ or $* when there are no
positional parameters. Based on report from Ian Allen
<idallen@idallen-fibe.dyndns.org>
lib/readline/signals.c
- rl_pending_signal(): return the number of any signal readline has
caught but is waiting to handle
lib/readline/callback.c
- rl_persistent_signal_handlers: new variable, restores readline-6.2
signal handler semantics: installed at rl_callback_handler_install
time and removed with rl_clear_signals when a complete line has
been read
- _rl_callback_newline: call rl_set_signals if rl_persistent_signal_handlers
is non-zero
- rl_callback_read_char: install signal handlers with rl_set_signals
if rl_persistent_signal_handlers is 0 (the default)
- CALLBACK_READ_RETURN: uninstall signal handlers with rl_clear_signals
only if rl_persistent_signal_handlers is 0 (the default)
lib/readline/readline.h
- rl_pending_signal: new extern declaration
- rl_persistent_signal_handlers: new extern declaration
7/19
----
execute_cmd.c
- execute_while_or_until: make sure we decrement `continuing' the way
we decrement `breaking' if the loop test indicates we will be
breaking out of the loop. That keeps `until continue' from
keeping `continuing' set to 1. Reported by Dan Douglas
<ormaaj@gmail.com>
7/20
----
trap.c
- run_pending_traps,_run_trap_internal: save and restore temporary_env,
set temporary_env to 0 before trap runs so traps don't inherit a
command's temporary env. Fixes bug with IFS assignment in tempenv
and trap reported by Andriy Martynets <martynets@volia.ua>
jobs.c
- run_sigchld_trap: save and restore temporary_env, set temporary_env
to 0 before trap runs so traps don't inherit a command's temporary
env (see above)
7/21
----
execute_cmd.c
- execute_function: unwind-protect function_line_number, in case we
are executing a function inside another function. Reported by
Grisha Levit <grishalevit@gmail.com> in context of evaled functions
and DEBUG traps
- execute_arith_for_command,execute_arith_command,execute_simple_command,
execute_cond_command: make sure line_number doesn't go < 0 when
adjusting it by function_line_number
7/23
----
subst.c,command.h
- move the PF_ constants to command.h so other files can see them, now
that PF_ASSIGNRHS has meaning to string_list_dollar_at
arrayfunc.h
- AV_ASSIGNRHS: new flag, indicate that ${a[@]} is being expanded on
the RHS of an assignment statement
arrayfunc.c
- array_value_internal: if AV_ASSIGNRHS passed for ${a[@]}, pass
PF_ASSIGNRHS to string_list_dollar_at to support args separated by
spaces even if $IFS does not have the default value. Reported by
Dan Douglas <ormaaj@gmail.com>
subst.c
- string_list_dollar_at: if FLAGS argument includes PF_ASSIGNRHS, obey
rules for $@ on the RHS of an assignment statement: expand to
postitional parameters separated by spaces no matter what the first
character of $IFS is. Reported by Dan Douglas <ormaaj@gmail.com>
- parameter_brace_expand_word: pass AV_ASSIGNRHS as flags value to
array_value if PF_ASSIGNRHS is set and we are expanding an array
variable subscripted by @ or *
- param_expand: pass pflags to string_list_dollar_at in case it contains
PF_ASSIGNRHS
- expand_word_internal: if we have an assignment statement argument to
a declaration builtin (W_ASSIGNARG), turn on W_ASSIGNRHS when we see
the `=' to enable special $@ behavior
- expand_word_internal: if W_ASSIGNARG enabled in word flags, pass that
flag and W_ASSIGNRHS to recursive call to expand_word_internal when
expanding double-quoted string; handles "$@" when IFS is not the
default value and word splitting will not be performed
subst.c
- expand_word_internal: change case that handles '' (single-quoted
empty string) to only discard it if we will not be performing word
splitting (W_NOSPLIT|W_NOSPLIT2), since we need to add a quoted null
argument if the subsequent characters will cause word splitting.
This is how "" (double-quoted empty string) is handled after a bug
fix back in August 2010. Reported by Grisha Levit
<grishalevit@gmail.com>, fix for Posix interp 888
7/27
----
subst.c
- param_expand: change fix from 6/23 (expanding $* in a context where
word splitting is not performed) to make sure that $* expands to
something before trying to quote the string. Bug and fix from
Andreas Schwab <schwab@suse.de>
lib/readline/bind.c
- _rl_get_string_variable_value: fix a cut-and-paste error that caused
the emacs mode string to be displayed for both vi insert and command
mode strings. Report and fix from Steve Jones <sjml@slohj.org>
7/28
----
lib/readline/display.c
- update_line: we can't use PROMPT_ENDING_INDEX unless we're testing
against _rl_last_c_pos; if we are testing buffer indices, we need to
use prompt_last_invisible directly. Fixes mode string redisplay issue
with short prompt strings reported by Steve Jones <sjml@slohj.org>
8/4
---
nojobs.c
- without_job_control: new function, resets child state that's
eventually used to decide whether or not to wait_for children
execute_cmd.c
- initialize_subshell: call without_job_control in both the
JOB_CONTROL and no job control paths so we can reset the state in
subshells that will not cause them to wait_for children
inappropriately. Fixes bug reported by Dan Cross <crossd@gmail.com>
8/5
---
configure.ac
- release version is now `rc2'
bashline.c
- command_word_completion_function: if direxpand is set, make sure to
run hint_text through bash_directory_completion_hook, since
readline will do that and we want to be able to match the results
readline returns. Fixes bug reported by Pat Somaru
<tuf18542@temple.edu>
command.h
- W_COMPLETE: new flag word value
- PF_COMPLETE: new flags value for param_expand
subst.h
- SX_STRIPDQ: new flag, used for string_extract_double_quoted
bashline.c
- bash_filename_stat_hook,bash_directory_completion_hook: pass W_COMPLETE
flag to expand_prompt_string
subst.c
- expand_word_internal: if W_COMPLETE in word->flags, pass PF_COMPLETE
to param_expand
- param_expand: if PF_COMPLETE in pflags, pass SX_COMPLETE to
extract_command_subst. This allows `"$(echo ~/' to perform
completion successfully
- string_extract_double_quoted: turn third argument into a flags arg,
old STRIPDQ is now set if flags&SX_STRIPDQ
- string_extract_double_quoted: changed callers, if third argument was
1, pass SX_STRIPDQ instead
- expand_word_internal: if W_COMPLETE in word->flags, pass SX_COMPLETE
in flags to string_extract_double_quoted for case '"'
- string_extract_double_quoted: if SX_COMPLETE in flags, pass it to
extract_command_subst
- expand_word_internal: if W_COMPLETE in word->flags, make sure W_COMPLETE
is in temp word passed to recursive call to expand_word_internal to
expand double-quoted string. Fixes bug reported by John Passaro
<john.a.passaro@gmail.com>
8/9
---
[bash-4.4-rc2 frozen]
8/10
----
subst.c
- sub_append_string: use size_t variable to store string length to
avoid integer overflow. Report from Siteshwar Vashisht
<svashisht@redhat.com>
- sub_append_string: `size' argument is now pointer to size_t; changed
istring_index in expand_word_internal to accommodate change
lib/sh/ufuncs.c
- include "posixselect.h" if HAVE_SELECT is defined, make sure that
fd_set and the rest are defined
8/11
----
lib/readline/histexpand.c
- history_tokenize_word: use ISDIGIT instead of isdigit for more
argument checking
- "chardefs.h": include for ISDIGIT define and <ctype.h>. Fix from
Mike Frysinger <vapier@gentoo.org>
lib/sh/eaccess.c,externs.h
- sh_eaccess: first argument now const char *
- sh_stataccess,sh_euidaccess: first argument now const char *, since
sh_stat and sh_eaccess call them.
Fix from Mike Frysinger <vapier@gentoo.org>
lib/glob/glob.c
- sh_eaccess: change local prototype
general.[ch]
- all_digits,legal_identifier,valid_nameref_value,importable_function_name,
exportable_function_name,check_binary_file,file_exists,file_isdir,
file_iswdir,same_file,make_absolute,valid_nameref_value: first
argument (always identifier or filename) is now a `const char *';
some second filename arguments now `const char *'.
Fix from Mike Frysinger <vapier@gentoo.org>
configure.ac,config.h.in
- uintptr_t: make sure it's defined to an integer type wide enough to
hold a pointer
lib/sh/tmpfile.c
- sh_seedrand: use `uintptr_t' to cast pointer value to int value,
instead of allowing truncation to take place, since srandom takes
an `unsigned int'.
Fix from Mike Frysinger <vapier@gentoo.org>
arrayfunc.[ch]
- valid_array_reference,array_variable_name,array_variable_part,
array_value_internal,array_value,get_array_value: first argument
(always variable name) now a `const char *'
Fix from Mike Frysinger <vapier@gentoo.org>
8/19
----
print_cmd.c
- xtrace_print_word_list: if (xtflags & 2), don't try to quote the
words in the LIST argument. Intended to be used in places where
the list has not yet been expanded
- xtrace_print_for_command_head: call xtrace_print_word_list with
flags argument of 2. Fixes issue reported by Aharon Robbins
<arnold@skeeve.com>
- xtrace_print_select_command_head: call xtrace_print_word_list with
flags argument of 2
8/21
----
lib/sh/netopen.c
- netopen: fix memory leak by freeing allocated path before error
return. Fix from Dmitry Goncharov <dgoncharov@users.sf.net>
doc/{bash.1,bashref.texi}
- change conditional commands description to make it clearer that
bash doesn't emulate /dev/fd if the OS provides it
8/22
----
braces.c
- expand_amble: free partial and tem on failure to allocate memory
for merged partial+result strvec. Fix from Dmitry Goncharov
<dgoncharov@users.sf.net>
8/23
----
jobs.c
- wait_for: don't call get_tty_state when a job finishes if we're
running it as part of programmable completion. We test
rl_readline_state. Fixes bug reported by Jaro Punta
<silly8888@gmail.com>
8/24
----
subst.c
- pat_subst: fix memory leak (mstr). Fix from Dmitry Goncharov
<dgoncharov@users.sf.net>
- split_at_delims: fix memory leak (d2). Fix from Dmitry Goncharov
<dgoncharov@users.sf.net>
8/26
----
subst.c
- match_upattern,match_wpattern: make sure that a trailing `*' is
not escaped (preceded by an odd number of backslashes) before we
append a `*' when checking whether a pattern matches anywhere in
the string
lib/readline/{input,signals}.c
- protect instances of SIGQUIT with #ifdef SIGQUIT; apparently
MinGW doesn't define it
- protect instances of SIGHUP with #ifdef SIGHUP; apparently
MinGW doesn't define it. From a report from Simon Sobisch
<simonsobisch@gnu.org>
xmalloc.o
- allocerr: only try to find the break and report it if we're using
the bash malloc; there's no guarantee that any other malloc is
using sbrk()
doc/{bash.1,bashref.texi}
- quote removal: add paragraph mentioning quote removal to beginning
of expansions section, referencing later paragraph. Report from
Michel Lanne <michel.lanne@gmail.com>
8/30/2016
---------
lib/readline/input.c
- protect instances of SIGALRM and SIGWINCH with #ifdef; apparently
MinGW doesn't define them. From a report from Simon Sobisch
<simonsobisch@gnu.org>
subst.c
- SPECIAL_VAR: make sure name is not the empty string before going on,
empty strings can result in unitialized reads
- CHECK_STRING_OVERRUN: semi-general macro to use in *extract* and
similar functions to to check whether a function called to parse an
embedded construct (like a backquoted command substitution) doesn't
consume the entire string because it's unterminated
- skip_double_quoted: make sure other extraction functions don't
consume the entire string (which they can if the construct is
unterminated) before incrementing the index and going on. Uses
CHECK_STRING_OVERRUN
- extract_dollar_brace_string: check for unterminated embedded
constructs consuming the entire string with CHECK_STRING_OVERRUN ('`')
- skip_matched_pair: use CHECK_STRING_OVERRUN to make sure unterminated
embedded "`", $(, ${ don't cause out-of-bounds reads
parse.y
- parse_comsub: when parsing a here-document delimiter, make sure we
don't try to use `nestret' after freeing it. Fixes bug reported by
Franco Costantini <franco.costantini.20@gmail.com>
[bash-4.4 frozen]
9/10
----
trap.c
- run_debug_trap: only give the terminal to pipeline_pgrp if
subshell_environment doesn't include SUBSHELL_ASYNC|SUBSHELL_PIPE.
Fixes bug reported by Matthew Giassa <matthew@giassa.net>
execute_cmd.c
- execute_simple_command: if user_subshell is set, check and set
SUBSHELL_ASYNC if asynchronous is set as well as setting
SUBSHELL_PAREN
|