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
|
12/6/2020
---------
[bash-5.1 released]
12/7
----
Makefile.in
- bashline.o: add dependency on ${DEFDIR}/builtext.h. Report from
Fazal Majid <fazal@majid.org>
12/11
-----
builtins/wait.def
- wait_builtin: don't assign the variable given with -p if there are no
jobs to wait for. Report and fix from Ouz <oguzismailuysal@gmail.com>
arrayfunc.c
- kvpair_assignment_p: return non-zero if argument L appears to be a
key-value pair associative array compound assignment
- expand_and_quote_kvpair_word: run a single word in a key-value pair
associative array compound assignment through the appropriate
expansions and single-quote the result
arrayfunc.h
- kvpair_assignment_p, expand_and_quote_kvpair_word: extern declarations
subst.c
- expand_oneword: detect whether VALUE appears to be a key-value
pair compound assignment and call the appropriate function to expand
each word in the resulting list. Fixes inconsistency reported by
oguzismailuysal@gmail.com
12/12
-----
subst.c
- command_substitute: don't reset pipeline_pgrp to shell_pgrp if we
are already forked to run a command (SUBSHELL_FORK). Fixes SIGINT
in command substitution in here-document in forked child issue
reported by oguzismailuysal@gmail.com
12/18
-----
execute_cmd.c
- execute_pipeline: execute the lastpipe code even if prev == 0. It
can only be 0 here if stdin was closed when this function was
executed
- execute_pipeline: if prev == 0, set lstdin to a sentinel (-1) that
means to close fd 0 after executing the command, and call close(prev)
before restoring stdin. restore_stdin now understands -1, and closes
fd 0. Fixes issue reported by Tomas Janousek <tomi@nomi.cz>
12/21
-----
doc/bashref.texi
- PROMPT_COMMANDS: clean up a couple of remaining instances of this
name. Report from Eli Schwartz <eschwartz@archlinux.org>
12/26
-----
subst.c
- command_substitute: make sure that the child process always has
pipeline_pgrp == shell_pgrp: if pipeline_pgrp is non-zero when we
get to the child, meaning that we're part of an already-forked
child that is, for instance, running redirections, we need to reset
shell_pgrp to it to preserve the invariant. Fixes bug with terminal
being set to the incorrect pgrp reported by oguzismailuysal@gmail.com
12/29
-----
configure.ac,builtins/shobj-conf,m4/threadlib.m4
- midnightbsd: update auto-configuration to treat MidnightBSD like
FreeBSD. From https://savannah.gnu.org/patch/?10006
12/30
-----
examples/loadables/stat.c
- stattime: use strftime with a default format or the format supplied
with the -F option to format the file time information
- stat_builtin: now takes a -F fmt option for a strftime format string;
change to function calling sequences to pass the format down to
stattime
examples/loadables/Makefile.in
- stat: now built and installed by default
12/31
-----
command.h
- SUBSHELL_IGNTRAP: new flag value
jobs.c
- make_child: set SUBSHELL_IGNTRAP in subshell_environment in the
child process, meaning that we should not execute trap handlers for
trapped signals
execute_cmd.c
- execute_in_subshell, execute_simple_command, execute_disk_command:
make sure to unset SUBSHELL_IGNTRAP after a child process restores
the original signal dispositions
- execute_simple_command: make sure to set SUBSHELL_IGNTRAP after
make_child returns and we're setting subshell_environment directly
subst.c
- command_substitute,process_substitute: unset SUBSHELL_IGNTRAP after
the child process has reset the trapped signal dispositions
trap.c
- trap_handler: if we get a signal for which we have set a trap, but
SUBSHELL_IGNTRAP is set in subshell_environmnent, make sure we
restore the original signal disposition and resend the signal to
ourselves. Fixes issue reported by Nikolay Borisov <nborisov@suse.com>
(or at least makes the race window much smaller)
sig.c
- initialize_terminating_signal: set the original signal handler from
the return value from sigaction; a minor optimization that saves a
system call or two
1/5/2021
--------
builtins/declare.def
- declare_internal: make some option combinations that don't make
sense errors (e.g., -f and -a/-A/-i/-n)
- declare_internal: if we build a new variable name by expanding the
value of a nameref variable, make sure to chop the `+' in a `+='
off before going on
1/7
---
doc/{bash.1,bashref.texi}
- bind: add an example to the synopsis making it clear that you can
use any readline command line as a non-option argument, as it says
in the text. From a report from Dan Jacobson <jidanni@jidanni.org>
1/12
----
locale.c
- local_shiftstates -> locale_shiftsates in the non-multibyte code
branch. Reported by Henry Bent <henry.r.bent@gmail.com>
subst.c
- expand_compound_assignment_word: make sure to call dispose_words on
the WORD_LIST * returned from expand_oneword after turning it back
into a string. Fixes memory leak reported by Alexander Mescheryakov
<alexander.s.m@gmail.com>
1/13
----
variables.c
- bind_variable_internal: when performing an assignment to a subscripted
array variable that was the value of a nameref (used in the original
assignment), don't call make_variable_value on the value, since that
messes up +=. Just call assign_array_element and let that take care
of calling make_variable_value appropriately. Fixes bug reported by
Oguz <oguzismailuysal@gmail.com>
1/14
----
findcmd.c
- search_for_command: if `checkhash' is set, don't add non-executable
files to the command hash table, since we will just remove them
later
lib/sh/winsize.c
- get_new_window_size: set *rp and *cp even if READLINE is not defined
1/15
----
lib/sh/winsize.c
- get_new_window_size: call rl_set_window_size only if we can determine
we're using readline: an interactive shell without no-line-editing,
or if we've already initialized readline, presumably in a non-
interactive shell
support/Makefile.in
- man2html: add LDFLAGS_FOR_BUILD to the recipe. Report from
Jeffrey Walton <noloader@gmail.com>
1/17
----
lib/readline/misc.c
- rl_operate_and_get_next: fix old K&R function declaration. Report
from Tom Tromey <tom@tromey.com>
lib/readline/readline.c
- _rl_internal_char_cleanup: move code that cleans up the active region
and deactivates the mark inside this function so callback mode
applications get the intended functionality. Report and fix from
sparrowhawk996@gmail.com
lib/readline/bind.c
- rl_parse_and_bind: when using the arithmetic comparison operators on
the version, make sure to invert the tests so that we stop parsing
if the test fails. Report and fix from Tom Tromey <tom@tromey.com>
1/19
----
Makefile.in
- pipesize.h: add dependency on ${BUILTINS_LIBRARY} to avoid parallel
makes trying to create it twice. Report and fix from
Richard Purdie <richard.purdie@linuxfoundation.org>
1/21
----
subst.c
- param_expand: if a nameref expands to array[@] or array[*], make sure
to call chk_atstar so the right variables are set to split the
result. Report from Oguz <oguzismailuysal@gmail.com>
1/22
----
builtins/declare.def
- Rewrote to reduce complexity. Still needs some work.
lib/readline/*.h, lib/tilde/tilde.h
- PARAMS: remove, rely on compilers understanding function prototypes
lib/readline/{undo.c,histlib.h}
- _hs_replace_history_data: move extern declaration to histlib.h
lib/readline/readline.c
- _rl_parse_colors: instead of an extern declaration for this, include
"parse-colors.h" for it
lib/readline/{histfile.c,histlib.h}
- _hs_append_history_line: move extern declaration to histlib.h
lib/readline/history.h
- HS_HISTORY_VERSION: define to 0x0801 (current library version) if
it's not already defined. We conditionally define it in case an
application has (unwisely) chosen to use it, since the history
library doesn't do anything with it yet
lib/readine/{rlprivate.h,{search,misc,readline}.c}
- _rl_free_history_entry: add extern declaration to rlprivate.h, remove
extern declaration from c source files. Use HS_HISTORY_VERSION as a
sentinel that it's ok to use HIST_ENTRY in rlprivate.h
lib/readline/{rlprivate.h,{isearch,search,undo}.c}
- _rl_saved_line_for_history: add extern declaration to rlprivate.h,
remove extern declaration from c source files, using HS_HISTORY_VERSION
in the same way
1/24
----
lib/readline/signals.c
- _rl_handle_signal: make sure that all sigprocmask calls are protected
by HAVE_POSIX_SIGNALS. Report and fix from Tom Tromey <tom@tromey.com>
1/26
----
lib/readline/callback.c
- rl_callback_read_char: make sure rl_linefunc is non-NULL before
calling through the pointer. The line function could have been
removed by the application before readline processes any typeahead
input. Bug reported by Matthias Klose <doko@debian.org>, pointer
to root cause from Koichi Murase <myoga.murase@gmail.com>
lib/glob/glob.c
- skipname,wskipname: put in some additional checks for `.' to ensure
that we don't get false positives (or incomplete tests) that can
affect the results of extglob patterns. Reported by
gregrwm <rhn-users@greatlakedata.com>
1/27
----
lib/glob/glob.c
- extglob_skipname,wextglob_skipname: fixed an off-by-one error (SE
was being set to one character before the end of the pattern string,
not the null character at the end of the pattern string like other
callers of glob_patscan) that caused the last character of the last
subpattern to be cut off when calling skipname
- extglob_skipname,wextglob_skipname: some cleanups so the code is
closer to identical for the single-byte and wide character versions
2/1
---
execute_cmd.c
- execute_simple_command: in posix mode, if we have a variable
assignment error while assigning into the temporary environment (e.g.,
assigning to a readonly variable), a non-interactive shell running a
special builtin exits; a non-interactive shell running anything else
jumps back to the top level. A shell compiled with -DSTRICT_POSIX
exits unconditionally.
- execute_simple_command: make sure posix mode sets $? to non-zero
if a variable assignment error occurs preceding a non-special builtin
subst.c
- do_assignment_statements: take the code from expand_word_list_internal
that performs assignment statements, either standalone or preceding
simple command names, and factor it out into this function
- expand_word_list_internal: call do_assignment_statements where
appropriate
2/2
---
lib/glob/glob.c
- dequote_pathname: fix function definition for non-multibyte systems.
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
Makefile.in,doc/Makefile.in
- for certain targets, remove files before creating them to deal with
symlinked build trees.
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
examples/loadables/accept.c
- include limits.h before typemax.h
Report and fix from Marc Aurèle La France <tsi@tuyoix.net>
builtins/gen-helpfiles.c
- if USING_BASH_MALLOC is defined, make sure to undefine malloc as well
as free. Fixes bug reported by George R Goffe <grgoffe@yahoo.com>
builtins/Makefile.in
- install-help: now depends on $(HELPFILES_TARGET) so we make sure the
separate helpfiles are created before we try to install them if we
don't go through the `all' makefile target
configure.ac
- HELPDIR: now ${datadir}/bash/helpfiles
2/3
---
parse.y
- parse_string_to_word_list: before expanding a compound assignment
statement body, make sure to save any alias that's currently being
expanded. Restore the alias after the compound assignment is parsed.
Reported back in 11/2020 by Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
2/4
---
lib/readline/histexpand.c
- history_expand_internal: when calling the history_inhibit_expansion
function, make sure to call it using the string as we've expanded it
to that point (RESULT), adding the expansion and next characters
temporarily, since we make expansion decisions based on what we've
accumulated, not what we started with. This makes things like
echo abc!$!$ work, where before the second `!' inhibited expansion
because bash_history_inhibit_expansion mistakenly took it as the
second character in a `$!' word expansion. Fixes bug reported back
in 10/2020 by Paul Fox <paul.d.fox@gmail.com>
array.h
- array_pop: instead of calling array_dispose_element from this macro,
just call array_shift with the AS_DISPOSE flag
2/5
---
bashhist.c
- shell_comment: move condition to return 0 if the delimiter stack is
not empty or the shell is parsing a here document into the function
itself, don't have the callers check so the check is in one place.
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
array.h,variables.c
- ARRAY_ELEMENT_REPLACE: convenience define for modifying an array
element's value
variables.c
- pop_args: a couple of code simplifications
2/7
---
lib/malloc/malloc.c
- pagesz: at least MALLOC_PAGESIZE_MIN (4096) bytes
- union mhead: now 16-byte aligned on all systems, 32-bit and 64-bit
pointers
- binsizes: since the smallest allocation overhead is now 16 bytes,
redo the buckets so binsizes[0] == 32; adjust the thresholds for
split/coalesce/prepopulate/mmap (NBUCKETS = 28; STARTBUCK = 0).
Sizes stay pretty much the same; indices change
- consistently use MALLOC_SIZE_T instead of long/unsigned int/int
- use MAGIC8_NUMBYTES as the length of the mh_magic8 buffer, in case
it changes later for alignment
- internal_remap: new function, calls mremap to reallocate a chunk of
memory allocated using mmap(); called from internal_realloc if the
old size and new size are both bigger than the mmap threshold
- internal_realloc: call internal_remap if the old size and new size
are both above the threshold where we use mmap for allocation
2/10
----
include/timer.h
- new file, declaration for a timer struct to be used by a set of
functions to implement timers using SIGALRM or select/pselect
lib/sh/timers.c
- new file, set of functions to manipulate timer objects and timeouts
using SIGALRM or select/pselect. Inspired by a patch from
Koichi Murase <myoga.murase@gmail.com>. Not used yet
2/11
----
builtins/read.def
- read_builtin: if there is a timeout set, block SIGCHLD around calls
to zread and its siblings, or calls to readline for `read -e', so
SIGCHLD (and the consequent waitpid) doesn't interrupt the read.
Fixes bug reported by Koichi Murase <myoga.murase@gmail.com>, but
there may be a different fix coming
Makefile.in,builtins/Makefile.in
- fix up dependencies, especially on builtins.h and builtext.h
2/12
----
lib/readline/input.c
- rl_read_key: if we set rl_done == 1, set RL_STATE_DONE as well
Reported by Koichi Murase <myoga.murase@gmail.com>
lib/readline/isearch.c
- _rl_search_getchar: only call _rl_read_mbstring if rl_read_key returns
>= 0, avoid some work
lib/readline/vi_mode.c
- _rl_vi_callback_change_char,_rl_vi_change_char: don't overwrite the
last replacement string if _rl_vi_callback_getchar returns -1.
It will likely make no difference, since the next read will return
an error or EOF, but being careful
- rl_vi_overstrike: if _rl_overwrite_char doesn't return 0, break out
of the loop
lib/readline/text.c
- _rl_overwrite_char: return 1 if _rl_read_mbstring returns < 0 so
we don't try to insert garbage
bashline.c
- posix_edit_macros: handle rl_read_key() returning <= 0
2/15
----
parse.y
- read_comsub: make sure to turn on the LEX_RESWDOK flag if we are in
a case statement and read a `)', since we can get a valid `esac'.
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
- read_comsub: if we're in a case statement, recognize `}' as a
reserved word and set the LEX_RESWDOK flag for the next word, since
we can get an esac (or another reserved word) after it
2/16
----
parse.y
- reserved_word_acceptable: add ARITH_CMD and COND_END to the list of
tokens that can precede a reserved word, so you can use reserved
words after ((...)) and [[...]].
Reported by Koichi Murase <myoga.murase@gmail.com>
2/17
----
parse.y
- parse_comsub: use new LEX_CASEWD flag to track when we are reading
the WORD in `case WORD in' and turn on the LEX_RESWDOK flag when
that word ends. This allows $(case x in esac), which no one uses.
- parse_comsub: use LEX_PATLIST flag to track when we are reading a
case pattern list so `|' doesn't turn on the LES_RESWDOK flag
- parse_comsub: case_level: simple counter to count the number of esacs
we need to see before we're no longer in a case statement; analog of
esacs_needed_count from the lexer
2/19
----
parse.y
- CHECK_FOR_RESERVED_WORD: don't return ESAC if we read `esac' after a
left paren in a case pattern list. From an austingroup-bugs discussion
about https://www.austingroupbugs.net/view.php?id=1454
- parse_comsub: if we read a `(' while looking for a case pattern list
and LEX_CKESAC is set, we have a leading left paren in the pattern
list and should turn off LEX_CKESAC so (esac) doesn't prematurely
terminate the case command. From an austingroup-bugs discussion
about https://www.austingroupbugs.net/view.php?id=1454
2/26
----
builtins/history.def
- history_builtin: when checking negative offsets to -d, which are
supposed to count back from the end of the history list, check the
range against 0 instead of history_base, because the calculation is
done against history_length, which is independent of history_base.
Report and fix from Christopher Gurnee <chris@gurneeconsulting.net>
2/28
----
doc/bashref.texi
- replaced a number of uses of @var with a mixture of @env and @dfn
to better match up with the texinfo standards
doc/{bash.1,bashref.texi}
- clarify some aspects of the coproc description, especially the
use of NAME and when it's optional
3/1
---
subst.c
- read_comsub: fix off-by-one error in mbrtowc that causes a read one
character past the end of buf. Report and fix from
Platon Pronko <platon7pronko@gmail.com> in
https://savannah.gnu.org/patch/?10035
3/3
---
builtins/ulimit.def
- ulimit_builtin: Posix compatibility: if the last command specified
by an option does not have an option argument, but there is an
operand remaining after all the options are parsed, treat the
operand as an argument to that last command. From an austin-group
discussion and a Geoff Clare suggestion back in November, 2020.
Austin Group interpretation 1418
examples/shellmath
- a package of shell functions to perform floating-point math entirely
in bash. Contributed by Michael Wood <mawood20@gmail.com>. Available
at https://github.com/clarity20/shellmath
3/4
---
support/shobj-conf
- darwin: take out the -arch-only option in SHOBJ_XLDFLAGS and
SHOBJ_ARCHFLAGS; no longer needed
doc/{bash.1,bashref.texi}
- coprocesses: suggested changes from rms@gnu.org; recommend the
`coproc NAME { commands; }' form as the simplest and most flexible
3/5
---
builtins/exec.def
- exec_builtin: set last_command_exit_value before calling exit_shell
so any exit trap gets the right value for $?. From Matthew Bauer
<mjbauer95@gmail.com> via https://savannah.gnu.org/patch/?10039
3/8
---
include/timer.h
- SHTIMER_ALRMSET: new flag, indicates that there is an active alarm
associated with this timer (falarm() was called)
lib/sh/timers.c
- shtimer_set: set the SHTIMER_ALRMSET flag after calling falarm
- shtimer_unset: don't call falarm(0,0) unless the SHTIMER_ALRMSET flag
is set
3/9
---
include/posixtime.h
- added some BSD convenience defines if they are not present
parse.y,shell.h
- {save,restore}_parser_state: save and restore shell_eof_token and
pushed_string_list; change callers (e.g., xparse_dolparen) so they
don't have to manage them
3/10
----
builtins/common.h
- extern declarations for moving to timers (sh_timer) for read builtin
timeouts
quit.h
- CHECK_ALRM: remove, no longer used
trap.c
- check_signals: call check_read_timeout instead of CHECK_ALRM
bashline.c
- bash_event_hook: use read_timeout instead of checking `sigalrm_seen';
that no longer exists
- bash_event_hook: accommodate readline timing out (not used yet)
lib/sh/zread.c
- zread: call read_builtin_timeout() to check for a timeout before
calling a blocking read()
builtins/read.def
- sigalrm,reset_timeout,check_read_timeout,read_builtin_timeout: new
and modified functions to use sh_timers for timeouts instead of
SIGALRM. Based on work contributed by Koichi Murase
<myoga.murase@gmail.com>
- read_builtin: use sh_timers for read timeouts (-t N) instead of
using SIGALRM
- edit_line: simulate receiving SIGALRM if readline times out (not
used yet)
3/11
----
lib/readline/readline.c
- rl_initialize: call _rl_timeout_init to set things up for any timeout
that was set with rl_set_timeout
- readline_internal_charloop: if we longjmped because of a timeout,
make sure to set rl_done/RL_STATE_DONE and return; we are
abandoning this call to readline(). The readline timeout changes
were based on work contributed by Koichi Murase
<myoga.murase@gmail.com>
lib/readline/readline.h
- extern declarations for new timeout functions and hook
- rl_clear_timeout: new define
lib/readline/callback.c
- rl_callback_read_char: if we longjmped because of a timeout,
make sure to set rl_done/RL_STATE_DONE and return; we are
abandoning this call to readline()
lib/readline/util.c
- _rl_abort_internal: if we time out, don't ring the bell; let the
caller handle it
lib/readline/input.c
- extern declarations for public and readline-library-private functions
and hooks to implement timeouts
- rl_set_timeout,rl_timeout_remaining: new public functions
- _rl_timeout_select: new function, uses select/pselect to implement
read timeouts that take timeouts set with rl_set_timeout into account;
calling hook function if a timeout occurs
- rl_gather_tyi, _rl_input_available: use _rl_timeout_select, taking
any existing timeout into consideration if it expires before the
timeout passed as an argument
- rl_getc: use _rl_timeout_select and handle any timeouts by calling
_rl_timehout_handle
- set_alarm,reset_alarm: new functions to implement timeouts using
SIGALRM for systems that lack a working select/pselect
- _rl_timeout_init: new function, sets things up for reading input
with a specified timeout
- _rl_timeout_handle: a timeout handler; calls any event hook and
sets up to abort the current readline() call
- _rl_timeout_handle_sigalrm: a timeout handler for systems using
SIGALRM to implement timeouts
lib/readline/parens.c
- rl_insert_close: use _rl_timeout_select to take timeouts into account
lib/readline/rlprivate.h
- extern declarations for readline-library-private timeout functions
lib/readline/rltty.c
- rl_deprep_terminal: don't print a newline after the bracketed paste
disable sequence if we timed out
lib/readline/signals.c
- _rl_handle_signal: if sig is SIGALRM, call _rl_timeout_handle_sigalrm()
lib/readline/doc/rltech.texi
- rl_set_timeout,rl_timeout_remaining: document new public functions
- RL_STATE_TIMEOUT: document new possible state value for rl_readline_state
- rl_timeout_event_hook: document new hook function, called when
readline times out
builtins/read.def
- read_builtin: changes to use the readline timeout functions to
implement timeouts with `read -e'; these use rl_set_timeout and
sh_timer structs together
3/12
----
subst.c
- expand_string_dollar_quote: new function, expands $'...' and $"..."
in a string for those code paths that don't expand it themselves
subst.h
- expand_string_dollar_quote: extern declaration
parse.y
- read_secondary_line: if $'...' or $"..." appears in the line, call
expand_string_dollar_quote to expand them. This now returns new
memory, need to change callers
make_cmd.c
- make_here_document: account for read_secondary_line returning newly
allocated memory, free `full_line' appropriately
bashline.c
- shell_expand_line,history_and_alias_expand_line: expand $'...' and
$"..." in the line by calling expand_string_dollar_quote, since
that happens after history expansion and before alias expansion in
normal processing
3/15
----
subst.c
- expand_string_dollar_quote: fix out-of-order initialization
Makefile.in
- {TAGS,tags}: add ETAGS/ETAGSFLAGS/CTAGS/CTAGS flags; make sure to
cd to the source directory before running them to get source files
that don't have absolute paths. Fix from Mike Jonkmans
<bashbug@jonkmans.nl>
parse.y
- xparse_dolparen: don't longjmp if FLAGS includes SX_NOLONGJMP. From
a report by Xu Lu <oliver_lew@outlook.com>
3/16
----
subst.c
- process_substitute: set startup_state and parse_and_execute_level
to see if we can avoid a fork()
bashline.c
- bash_spell_correct_word: bindable command (spell-correct-word) to
perform spelling correction on the current `shellword', using the
same code as the `cdspell' option and directory spelling correction
during completion. Feature suggested by in 10/2020 by
Karl Kleinpaste <karl@kleinpaste.org>
- bash_spell_correct_word: bound to "C-x s" by default in emacs mode
lib/readline/display.c
- rl_redisplay: fix redisplay problem that occurs when switching from
the rl-digit-argument prompt "(arg: N)" back to the regular prompt,
and the regular prompt contains invisible characters
doc/bash.1,lib/readline/doc/rluser.texi
- spell-correct-word: document new function and its default binding
3/17
----
doc/{bash.1,bashref.texi}
- cd: slight changes to specify that it sets PWD and OLDPWD
- {pushd,popd}: make it clear that these builtins use cd to change
the current working directory; change wording to simplify the
description and clarify the exit status
3/18
----
execute_cmd.c
- execute_disk_command: after performing redirections, call
unlink_all_fifos() to remove the FIFOs created as part of
expanding redirections. They should have been opened by then, and
we're going to call shell_execve right away anyway, so we won't be
around to remove the FIFOs. From a report from
Michael Felt <aixtools@gmail.com>
3/22
----
parse.y
- alias_expand_token: slight tweak to check for alias expansion: perform
expansion unconditionally if PST_ALEXPNEXT is set, and disable it
in case statement pattern lists if the previous token indicates a
command name is acceptable.
From a report by Oguz <oguzismailuysal@gmail.com>
config-bot.h
- HAVE_MKDTEMP: fix typo
3/25
----
lib/readline/terminal.c
- look in terminfo for key sequences for page up (kP) and page down
(kN) and bind them to history-search-{backward,forward},
respectively. From a patch from Xose Vazquez Perez
<xose.vazquez@gmail.com>
3/30
----
doc/bashref.texi
- expand the node describing $"..." string translation with additional
details and examples
3/31
----
misc.c
- rl_fetch_history: moved here from vi_mode.c
- rl_fetch_history: negative arguments count back from the end of
the history, instead of taking you to the beginning of the history
list
- rl_fetch_history: in vi mode, an out-of-range argument rings the
bell and doesn't change the line
vi_mode.c
- rl_vi_fetch_history: call rl_fetch_history
readline.h
- rl_fetch_history: new extern declaration
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- rl_fetch_history: add description
builtins/setattr.def
- show_var_attributes: if a variable's value indicates that it should
be ANSI-C quoted, use ansic_quote instead of sh_double_quote to
format the value string. From proposal by Greg Wooledge
<greg@wooledge.org>
4/5
---
arrayfunc.c
- unbind_array_element: if FLAGS includes VA_ONEWORD, don't use
skipsubscript to parse the subscript, just assume the entire SUB is
the subcript and that it contains the closing `]', so we just want
everything in SUB except the last character.
parse.y:
- select_command: use compound_list instead of list, like for_command.
Report by Greywolf <greywolf@starwolf.com>
- list: move this into compound_list (replacing the instance of `list'
in the compound_list production), remove from the grammar
4/6
---
arrayfunc.c
- unbind_array_element: use VA_NOEXPAND instead of literal 1
4/7
---
lib/readline/funmap.c
- default_funmap: add missing `vi-undo' to the list of vi-mode bindable
functions. Reported by Xirui Zhao <quinean@icloud.com>
4/8
---
config-top.h
- DEFAULT_LOADABLE_BUILTINS_PATH: default value for BASH_LOADABLES_PATH
doc/{bash.1,bashref.texi}
- enable: note that it uses $BASH_LOADABLES_PATH, and that the default
is system-dependent
variables.c
- initialize_shell_variables: initialize BASH_LOADABLES_PATH to the
default given in DEFAULT_LOADABLE_BUILTINS_PATH
4/12
----
doc/{bash.1,bashref.texi}
- add link to git master tar file as a place to get the current version
4/14
----
bashline.c
- attempt_shell_completion: use -1 as a sentinel value for
in_command_position indicating that we cannot be in a command position
(e.g., because we're the target of a redirection) and should not
check for a programmable command completion or tell the programmable
completion code to use command completion. Report and fix from
Marc Aurèle La France <tsi@tuyoix.net>
4/16
----
builtins/bind.def
- bind_builtin: reverse sense of strvec_search return value when
deciding whether or not to remove a unix-command binding from the
cmd keymap. Bug report by Dale Sedivec <dale@codefu.org>
lib/readline/doc/rltech.texi
- RL_PROMPT_{START,END}_IGNORE: document current values of \001 and
\002. Report from Mingye Wang <arthur200126@gmail.com>
4/19
----
arrayfunc.c
- assign_assoc_from_kvlist: fix memory leak reported by konsolebox
<konsolebox@gmail.com>
4/20
----
command.h,subst.c
- W_ITILDE: remove, replace with a variable since it's only used inside
a single call to expand_word_internal
4/21
----
{subst.c,make_cmd.c,parse.y}
- W_DQUOTE: no longer used, use W_NOPROCSUB and W_NOTILDE directly
(for arithmetic commands and words in arithmetic for commands)
4/24
----
bashline.c
- executable_completion: since this function gets an unquoted filename
from rl_filename_completion_function, we need to quote special
characters before passing it to bash_directory_completion_hook.
Report from Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
4/26
----
lib/readline/search.c
- _rl_nsearch_abort: move function calls around so _rl_restore_prompt
happens before rl_clear_message, like when aborting an incremental
search. Suggested by sparrowhawk996@gmail.com
subst.h
- ASS_ALLOWALLSUB: new assignment flag value, means to allow @ and * as
valid array subscripts when assigning to existing associative arrays
arrayfunc.c
- assign_array_element: allow assignment of key `@' to an existing
associative array if the caller passes ASS_ALLOWALLSUB
- assign_compound_array_list: allow ( [@]=value ) to an existing
associative array
builtins/declare.def
- declare_internal: allow assignment of key `@' to an existing
associative array by passing ASS_ALLOWALLSUB to assign_array_element
as part of local_aflags. This affects declare, local, and typeset
subst.c
- do_assignment_internal: allow a[@]=value to an existing associative
array by passing ASS_ALLOWALLSUB to assign_array_element
4/27
----
builtins/common.[ch]
- builtin_bind_var_to_int: wrapper for bind_var_to_int to be used by
builtin commands; placeholder for future work
builtins/wait.def
- builtin_bind_var_to_int: use instead of bind_var_to_int
builtins/common.c
- builtin_bind_variable: allow assignment of key `@' to an existing
associative array by passing ASS_ALLOWALLSUB to assign_array_element.
This affects printf and read
builtins/variables.[ch]
- bind_var_to_int: add third `flags' argument to pass to bind_variable
instead of always passing 0
redir.c,builtins/common.c,builtins/printf.def
- bind_var_to_int: change callers, add third flags argument
builtins/common.c
- builtin_bind_var_to_int: pass ASS_ALLOWALLSUB to bind_var_to_int so
builtins like wait can assign to assoc[@] and assoc[*]
4/28
----
bashline.c
- command_word_completion_function: make sure to initialize
old_glob_ignore_case before trying to restore from it
- command_word_completion_function: if we are completing a glob
pattern, make sure to set rl_filename_completion_desired, so we get
quoting and appending -- we are completing a filename, after all.
From a report from Manuel Boni <ziosombrero@gmail.com>
lib/readline/bind.c
- enable-active-region: separate control of the active region and
bracketed paste. Still set to the same default value as bracketed
paste, and enabling bracketed paste enables the active region.
Now you can enable bracketed paste and then turn off the active
region.
doc/bash.1,lib/readline/doc/{readline.3,rltech.texi}
- enable-active-region: document new bindable readline variable and
its effects
4/30
----
command.h
- W_ARRAYREF: new flag, meaning the word is a valid array reference
with subscript, replaces W_DOLLARSTAR, which was unused
subst.c
- expand_subscript_string,expand_array_subscript: new functions to
parse and expand-and-quote array subscripts. For future use
5/3
---
builtins/mapfile.def
- mapfile: if the delimiter is a newline, set unbuffered_read = 1
for any file descriptor that isn't seekable and lseek sets errno
to ESPIPE (pipes, FIFOs, maybe terminal devices). If it's not a
newline, only allow buffered reads if the file descriptor is a
regular file. Report from Koichi Murase <myoga.murase@gmail.com>
builtins/read.def
- read_builtin: only set unbuffered_read = 1 if the input is coming
from a pipe (which we can't seek on) or the input is a terminal and
we want to read a specified number of characters or we're using a
non-standard delimiter
5/4
---
builtins/mapfile.def
- mapfile: call zsyncfd before calling the callback. Suggested by
Koichi Murase <myoga.murase@gmail.com>; we'll see how it goes
5/5
---
subst.h
- expand_subscript_string: extern declaration
{arrayfunc,subst}.c
- expand_subscript_string: replace expand_assignment_string_to_string
with calls to this when expanding array subscripts
subst.c
- cond_expand_word: call expand_word_internal with Q_ARITH if `special'
says we should quote for an arithmetic expression context
- expand_word_internal: call expand_array_subscript when we see `[' in
arithmetic or array subscript contexts, make conditional on the
compatibility level later
- expand_word_internal: make sure W_ARRAYREF makes it through this
function and into the returned word
5/6
---
arrayfunc.c
- array_expand_index: call evalexp with a flag of 0 since we call
expand_arith_string with Q_ARITH and we want evalexp to remove
the quotes
execute_cmd.c
- eval_arith_for_expr,execute_arith_command: now that Q_ARITH has an
effect on array subscripts (it quotes the special expansion
characters), call evalexp with 0 as the flags arg so quote removal
is performed on this quoted argument. Make this conditional on the
shell compatibility level later
- execute_cond_command: make sure to expand the argument to -v by
calling cond_expand_node with Q_ARITH, and correspondingly turn off
assoc_expand_once when calling unary_test with that argument, since
we want it to be expanded again to remove the quotes
- execute_cond_command: expand the arguments to the arithmetic operators
with Q_ARITH and pass TEST_ARITHEXP to binary_test to ensure that
it lets evalexp expand the arguments to remove the quoting
test.c
- arithcomp: if TEST_ARITHEXP is in FLAGS, call evalexp with a flag
if 0 to force evalexp to expand the arguments to remove the quoting
subst.c
- param_expand: since we call expand_arith_string with Q_ARITH, we need
to call evalexp with 0 instead of EXP_EXPANDED for $((...)) expansion
- expand_word_internal: if we recursively call expand_word_internal to
expand the contents of a double-quoted string, make sure we pass
through Q_ARITH if it appears in QUOTED
- verify_substring_values: call expand_arith_string with Q_ARITH and
correspondingly call evalexp with 0 instead of EXP_EXPANDED
execute_cmd.c
- execute_cond_node: if -v is the operator, and the operand is a valid
array reference, pass TEST_ARRAYEXP flag to unary_test
5/7
---
builtins/common.[ch]
- set_expand_once: set array_expand_once to the value passed as the
first argument, returning the original value
builtins.h
- ARRAYREF_BUILTIN: new flag for shell builtins, means that the builtin
can take array references, with subscripts, as arguments
builtins/mkbuiltins.c
- set ARRAYREF_BUILTIN flag on builtins given in the arrayvar_builtins
array
execute_cmd.c
- execute_cond_node: use set_expand_once to set array_expand_once to 0
before calling unary_test with -v (see change from 5/6)
arrayfunc.c
- unbind_array_element: allow the caller to choose whether or not a
subscript of `*' or `@' unsets the entire array by passing
VA_ALLOWALL in FLAGS. Right now, since the unset builtin doesn't
pass VA_ALLOWALL, those subscripts unset individual elements for
associative arrays. We preserve the old behavior of unsetting
indexed arrays for the time being with new indexed-array-specific
code
5/9
---
builtins/shopt.def
- expand_once_flag: "assoc_expand_once" option now sets this flag,
calls set_assoc_expand on change
- set_assoc_expand: sets assoc_expand_once to mirror expand_once_flag;
placeholder for future changes
builtins/common.h
- expand_once_flag: extern declaration
5/10
----
doc/{bash.1,bashref.texi}
- note that case patterns undergo quote removal. Reported by
AlvinSeville7cf <alvinseville7cf@gmail.com>
5/11
----
builtins/bashgetopt.c
- list_optflags: flags associated with the word corresponding to
list_optarg, assuming list_optarg is a separate argument
builtins/bashgetopt.h
- list_optflags: extern declaration
builtins/set.def
- unset_builtin: set VFLAGS each time through the loop, since we take
whether or not the word has W_ARRAYREF set into account
- unset_builtin: don't pass VA_ALLOWALL to unbind_array_element for
now
test.c
- unary_test: in the -v case, use assoc_expand_once in the first call
to valid_array_reference ()
builtins/printf.def
- printf_builtin: only set VA_ONEWORD if the option argument to -v has
W_ARRAYREF set (look at list_optflags)
5/12
----
subst.c
- expand_array_subscript: don't quote @ or * in the expanded subscript
at all, even when they are the only character in the subscript. See
how this works out -- it might uncover places where we need to allow
`*' and `@' as subscripts where they are not allowed now
expr.c
- expr_bind_variable: pass ASS_ALLOWALLSUB to bind_int_variable so we
can allow (( A[@]=value )) when A is an existing associative array
arrayfunc.h
- AV_ATSTARKEYS: new flag value, means to accept a[@] and a[*] but
treat them as keys/expressions and not special values
arrayfunc.c
- array_value_internal: check AV_ATSTARKEYS and don't treat them as
ALL_ELEMENT_SUB values; they fall through to use as keys/indices
test.c
- unary_test: if -v is passed an array reference, add AV_ATSTARKEYS to
the flags passed to array_value so we treat @ and * as keys for an
existing associative array
5/13
----
subst.c
- expand_cond_word: if SPECIAL == 3 (arithmetic expression), dequote the
resulting WORD_LIST * as if special == 0, because we don't want to
quote the list for pattern matching. Report from
Adjudicator Darren <adjudicatordarren@protonmail.com>
5/14
----
subst.c
- expand_array_subscript: add double quote (") to the list of characters
that are backslash-quoted in subscripts after word expansion.
skipsubscript treats them specially, so you have to quote them to
do things like `key='"' ; array[$key]=1 ; [[ -v array[$key] ]]'
5/16
----
builtins/wait.def
- wait_builtin: if we longjmp to wait_intr_buf, call unset_waitlist if
we have called set_waitlist (wflags & JWAIT_WAITING). Fixes bug with
wait -n interrupted by a trapped signal (not SIGINT) reported by
Jonas Alfredsson <jonas.alfredsson@protonmail.com>
jobs.c
- wait_sigint_cleanup: restore the old sigint handler before we longjmp
out by calling restore_sigint_handler()
5/17
----
builtins/read.def
- bind_read_variable: now takes an additional argument, flags to pass
to builtin_bind_variable; change callers
- SET_VFLAGS: set vflags and bindflags
- read_builtin: call SET_VFLAGS to set vflags and bindflags from each
word before calling valid_array_reference and bind_read_variable
builtins/common.c
- builtin_bind_variable: set vflags (for valid_array_reference) and
bindflags (for bind_variable/assign_array_element) separately for
clarity
arrayfunc.c
- assign_array_element: sanity check: make sure that the subscript
returned by array_variable_name consumes the entire NAME, otherwise
flag it as a subscript error. This keeps things like
`KEY=' ]'; read assoc[$KEY] <<< hello' from assigning to incomplete
subscripts
builtins/printf.def
- printf_builtin: if LIST_OPTFLAGS includes W_ARRAYREF, set VA_NOEXPAND
in VFLAGS
5/17
----
lib/readline/complete.c
- compute_lcd_of_matches: move a couple of strlen calls out of a loop
in calls to mbrtowc; performance improvement only. Report and fix
from sparrowhawk996@gmail.com
lib/readline/bind.c
- rl_trim_arg_from_keyseq: take a key sequence and its length and
return the index into the key sequence following any initial numeric
argument. Return -1 if there is no numeric argument (the caller is
expected to make sure) or if the key sequence consists *only* of
the numeric argument. The caller should use the remainder of the
key sequence to look up the desired key binding.
lib/readline/readline.h
- rl_trim_arg_from_keyseq: extern declaration
bashline.c
- bash_execute_unix_command: if the argument count is > 1 or we have
an explicit argument, call rl_trim_arg_from_keyseq to get past the
numeric argument and deal with the rest of the key sequence. We still
need a way to pass it to the invoked program or function. From
a report from Jesper Nygards <jesper.nygards@gmail.com>
5/18
----
bashline.c
- bash_execute_unix_command: if the user supplied a numeric argument
when invoking bash_execute_unix_command, pass it to the command in
the READLINE_ARGUMENT variable
lib/readline/readline.[ch]
- _rl_del_executing_keyseq: convenience function to `delete' the last
character added to the executing key sequence. Intended to be used
before calling rl_execute_next or similar functions that push input
back to be re-read
doc/{bash.1,bashref.texi}
- READLINE_ARGUMENT: documented new variable available for commands
defined using `bind -x' keybindings
lib/readline/doc/rltech.texi
- rl_trim_arg_from_keyseq: documented new function
5/19
----
builtins/evalstring.c
- should_suppress_fork: suppress the fork if we're in a process
substitution subshell, in addition to being a simple command
without redirections. From a report back in 10/2020 from
Hyunho Cho <mug896@gmail.com>
bashline.c
- command_word_completion_function: if we're trying to complete an
absolute program (one containing a slash), don't run strcmp or
strcasecmp on the return value from rl_filename_completion_function,
since that duplicates work the filename completion function already
does. From a report back in 1/2021 by awa54@cdak.net
5/22
----
parse.y
- CHECK_FOR_RESERVED_WORD: if we are returning an ESAC and unsetting
PST_CASESTMT, decrement esacs_needed_count
parse.y,shell.h
- sh_parser_state_t: save and restore esacs_needed_count and
expecting_in_token in the shell parser state struct and
save_parser_state/restore_parser_state
print_cmd.c
- print_simple_command: don't bother to call command_print_word_list
with an empty list
- print_simple_command: don't print a space before a redirection list
if there weren't any command words to print
5/24
----
lib/sh/input_avail.c
- nchars_avail: make sure SET and OSET are declared on systems with
select(2). Reported by Larkin Nickle <me@larbob.org>
parse.y
- cond_term: if we read a `!' toggle CMD_INVERT_RETURN instead of
setting it unconditionally. Report and patch from
Vincent Menegaux <vincent.menegaux@gmail.com> via
https://savannah.gnu.org/patch/?10070
5/25
----
doc/{bash.1,bashref.texi}
- test: add the ( $2 $3 ) case to the description of the four-argument
behavior. Inspired by a discussion with Christoph Anton Mitterer
<calestyo@scientia.net>
5/27
----
doc/bashref.texi
- replace most of the GNU parallel section with a reference to the
tutorial on gnu.org
lib/glob/glob.h
- GX_NEGATE: new flag; indicates whether the pattern is being negated
as part of an extglob pattern. Not used yet
lib/glob/glob.c
- extglob_skipname,wextglob_skipname: pass GX_NEGATE to the skipname
functions if the pattern is being negated. Not checked yet
5/28
----
doc/{bash.1,bashref.texi}
- dotglob: add text to clarify that `.' and `..' have to be matched by
a pattern beginning with `.' or -- and this is the sketchy part --
that a pattern beginning with `.' has to be one of the patterns in
an extended glob expression
lib/glob/glob.c
- skipname,wskipname: perform the special checks for `.' only if the
pattern is not being negated
6/3
---
parse.y,shell.h
- eol_ungetc_lookahead: save and restore as part of the parser state
included in {save,restore}_parser_state
6/7
---
lib/readline/display.c
- puts_face: make sure to cast each member of STR to unsigned char, so
it's not misinterpreted as EOF, which putc_face does not display.
Report and fix from Volodymyr Prodan <vovcat@gmail.com> in
https://savannah.gnu.org/patch/?10076
examples/shobj-conf
- aix*gcc: change SHOBJ_LD to ${CC}, prefix the SHOBJ_LDFLAGS flags
with -Wl, so gcc will pass them to the linker. Report from
lehel@maxer.hu in https://savannah.gnu.org/support/?110505
6/11
----
doc/{bash.1,bashref.texi}
- cd: additional arguments are not ignored; they raise an error.
Report from Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
lib/glob/strmatch.h
- FNM_DOTDOT: enable special handling for `.' and `..': if FNM_PERIOD
is not set, `.' and `..' at the start of a string or as a pathname
component need to be matched by a `.' in the pattern and cannot be
matched by `?', `*', or a bracket expression
lib/glob/glob.c
- glob_vector: pass FNM_DOTDOT to strmatch() if noglob_dot_filenames
is not set to enable special handling of `.' and `..'. Prompted by a
discussion with Nora Platiel <nplatiel@gmx.us>
- skipname,wskipname: remove special checks for `.' and (disabled)
checks for `..'
lib/glob/sm_loop.c
- GMATCH: implement special handling for FNM_DOTDOT and `.' and `..':
make sure they can't be matched by any special glob characters at
the start of the string or as a pathname component (if FNM_PATHNAME
is set). This also means that !(pattern) won't return `.' or `..'
if dotglob is set
- GMATCH,EXTMATCH: don't pass FNM_DOTDOT down to recursive calls, like
FNM_PERIOD, once we process the first character in the string or
pathname component
lib/glob/smatch.c
- ISDIRSEP,PATHSEP,SDOT_OR_DOTDOT,PDOT_OR_DOTDOT: provide definitions
for single-byte or wide character strings for sm_loop.c to use
6/16
----
doc/{bash.1,bashref.texi},lib/readline/doc/{rluser,rltech}.texi
- slight wording changes to rewrite gender-specific language. From a
report by Vipul Kumar <kumar+bug-bash@onenetbeyond.org>, suggested
language from G. Branden Robinson <g.branden.robinson@gmail.com>,
Lawrence Velázquez <vq@larryv.me>,
and Andrew Church <achurch+bash@achurch.org>
builtins/fc.def
- fc_builtin: make sure an entry in the history list is non-null
before trying to write it to stdout or the temporary file. From a
report from Sibo Dong <sibo.dong@outlook.com>
builtins/common.[ch]
- builtin_arrayref_flags: given a WORD_DESC * (which includes flags)
and a base set of flags, return a set of flags to pass to
valid_array_reference and similar functions
builtins/set.def
- unset_builtin: call builtin_arrayref_flags to set vflags
6/19
----
parse.y
- parse_comsub: rewrite to recursively call the parser (yyparse()) and
return a string constructed from the resulting parse tree. Probably
will only work with bison. Error reporting is more accurate about
line numbers and invalid tokens, and command substitution errors
are caught earlier, before expansion
- DOLPAREN: new token, never created by yylex; only ever set by
parse_comsub and xparse_dolparen to indicate we're recursively
calling the parser for a command substitution
- comsub: new grammar production that's triggered by DOLPAREN and
parses a command substitution, returning a <command>. It's one of
the possible end states for the top-level parser
- grammar: only call rewind_input_string if the shell's input is
coming from a string
- shell_ungets: push a string back onto the shell input; only used by
make_here_document for backwards compatibility -- allowing a here-
document to be terminated by a token at the end of a command
substitution
- yylex: don't need any more special handling when returning
shell_eof_token, but we keep the clause for future work
- read_token_word: don't handle backslashes (leave them in the input
stream) if we are reading a command substitution (PST_NOEXPAND)
- reserved_word_acceptable: allow reserved words after DOLPAREN
- report_syntax_error: better error handling if we hit EOF while
looking for the ending right paren in a command substitution
- parse_string_to_word_list,parse_compound_assignment: make sure to
turn off parse_comsub sentinel temporarily
make_cmd.c
- make_here_document: backwards compatibility: if we end a here
document on the same line as the end of a command substitution,
allow the token to terminate the here document (without requiring
a newline) and push the remainder of the line back for the parser
to consume and terminate the command substitution
builtins/evalstring.c
- parse_string: if we read shell_eof_token and use it to terminate a
command, rewind the input string here before returning, instead of
guessing where to rewind it in the caller
6/22
----
redir.c
- do_redirection_internal: if VARASSIGN_REDIR_AUTOCLOSE is non-zero,
add a redirect to automatically close {var}<fn and other styles of
varassign redirection. It's zero by default
builtins/shopt.def
- varredir_close: new shell option, mirrors the value of
varassign_redir_autoclose. Suggested multiple times by multiple
people
doc/{bash.1,bashref.texi}
- varredir_close: document new shell option (the name is tentative)
6/24
----
parse.y
- yylex: if read_token returns a value < 0, return YYerror to the
parser
- parse_comsub: if the current_token is not shell_eof_token when
yyparse returns, return an error to read_token_word instead of
trying to keep parsing. Fixes interactive-only (?) bug reported by
Koichi Murase <myoga.murase@gmail.com>
parser.h
- PST_NOERROR: don't print error messages in yyerror(), just reset
the parser and return
parse.y
- yyerror: if parser_state & PST_NOERROR, don't print an error message
- xparse_dolparen: if the flags includes SX_COMPLETE, add PST_NOERROR
to parser_state, to inhibit error messages. Fixes bug with adding
lines with incomplete command substitutions to the history list
reported by Koichi Murase <myoga.murase@gmail.com>
subst.c
- skip_matched_pair: make sure to pass the SX_COMPLETE flag to
extract_delimited_string
6/28
----
lib/readline/bind.c
- rl_trim_arg_from_keyseq: handle rl_vi_arg_digit if VI_MODE is
defined. Report and fix from Koichi Murase <myoga.murase@gmail.com>
- rl_trim_arg_from_keyseq: rework to handle case where the digit
argument is given as a discrete sequence of multiple rl_digit_argument
commands (e.g, "M-1 M-2" instead of "M-1 2"). Report and fix from
Koichi Murase <myoga.murase@gmail.com>
subst.c
- pat_subst: avoid calling RESIZE_MALLOCED_BUFFER with STRLEN(s) as an
argument, since it ends up going into a loop. Report and fix from
Koichi Murase <myoga.murase@gmail.com>
lib/sh/casemod.c
- cval: take the string length as an argument, to avoid having to call
strlen every time (in HANDLE_MULTIBYTE mode). The caller already has
this info. Report and fix from Koichi Murase <myoga.murase@gmail.com>
builtins/complete.def
- print_cmd_name: single-quote the command name if it contains any
shell metacharacters
- print_one_completion: call print_arg with a second arg of 1 if the
function name contains shell metacharacters. Report and fix from
Koichi Murase <myoga.murase@gmail.com>
6/30
----
configure.ac
- substitute BASE_CFLAGS_FOR_BUILD and STYLE_CFLAGS into Makefile
targets
- take STYLE_CFLAGS out of the CFLAGS_FOR_BUILD variable that gets
substituted
- remove STYLE_CFLAGS from CFLAGS
- use `:+' expansion to set variables based on whether $GCC is set
or null, since configure can do GCC=
support/Makefile.in
- man2html: remove CCFLAGS_FOR_BUILD from the recipe, leaving only
LDFLAGS_FOR_BUILD. Report from Jay K <jayk123@hotmail.com>
- gen-helpfiles: remove CCFLAGS_FOR_BUILD from the recipe, leaving
only LDFLAGS_FOR_BUILD
- man2html: use $(STYLE_CFLAGS) in BASE_CCFLAGS variable for C file
compilation options
{,builtins}/Makefile.in, lib/{sh,readline,malloc,glob}/Makefile.in
- use STYLE_CFLAGS so specifying CFLAGS=-g to make doesn't clutter the
output with warnings about parens and format strings
7/9
---
lib/readline/search.c
- make_history_line_current: call _rl_free_saved_history_line to clean
up _rl_saved_line_from_history and get all the code that frees it
into one place
lib/readline/misc.c
- _rl_free_saved_history_line: if rl_undo_list points to the data
member of _rl_saved_line_from_history, set it to NULL to avoid having
it point to freed memory, since the next thing we do now is to free
the undo list the data member points to
- _rl_start_using_history: call _rl_free_saved_history_line instead of
calling _rl_free_history_entry directly. Fixes memory leak reported
by Trung Dam <trungdam@yahoo.com>
7/12
----
lib/readline/search.c
- make_history_line_current: free rl_undo_list before replacing the
current line with the line from history, since it is a private
undo list from reading the search string
lib/readline/rlmbutil.h
- Since wchar_t/mbrtowc/wcrtomb are limited to 16 bits on Windows
with MSVC, start abstracting the differences using WCHAR_T/
MBRTOWC/WCRTOMB
7/13
----
lib/readline/{complete,display,input,text,util,vi_mode}.c
- use WCHAR_T/MBRTOWC/WCRTOMB. Part of a set of Windows MSVC fixes
from sparrowhawk996@gmail.com
builtins/{enable,hash,help}.def
- enable_builtin: use sh_chkwrite after output to check for write errors
7/16
----
arrayfunc.c
- quote_compound_array_word: free SUB and VALUE after assigning from
sh_single_quote(). From a coverity report from
Siteshwar Vashisht <svashisht@redhat.com>
bashhist.c
- bash_remove_history_range: free DISCARD_LIST after freeing its
elements
bashline.c
- bash_directory_expansion: add code to free D as a separate branch,
though it's never hit in practice
builtins/trap.def
- showtrap: free T even if show_default == 1 if it's a non-default
trap string
7/17
----
execute_cmd.c
- execute_coproc: free NAME on invalid identifier error
lib/glob/glob.c
- glob_vector: make sure NEXTLINK is allocated using malloc before
passing it to free()
- glob_filename: free RESULT before returning glob_error_return when
there is only a filename
print_cmd.c
- indirection_level_string: make sure we free PS4 after calling
decode_prompt_string if *ps4 == 0
subst.c
- parameter_brace_transform: if vtype == VT_VARIABLE, we need to free
a non-null VAL
variables.c
- assign_in_env: if NAME is not a valid shell identifier, free it
after printing the error message and before returning. These are
the rest of the fixes from Siteshwar Vashisht <svashisht@redhat.com>
7/22
----
shell.c
- main: set dollar_vars[0] to shell_script_filename before calling
run_startup_files() in the non-interactive case. Restore it after
run_startup_files returns so we can get better error messages if
we can't open a script file. Suggested by several people, originally
by Marc Aurèle La France <tsi@tuyoix.net> back in 2/2021 (in a
different form) and most recently by Tapani Tarvainen
<bash@tapanitarvainen.fi>
7/28
----
trap.c
- any_signals_trapped: return that a signal is trapped only if it's
not ignored. This is an additional opportunity for optimization,
reported in https://bugzilla.redhat.com/show_bug.cgi?id=1981926
7/30
----
examples/loadables/sleep.c
- main: if the uconvert conversion fails, but the argument appears to
contain a GNU-like interval specifier like "1m30s", return
EX_DISKFALLBACK so the execute_builtin code tries to run the
external version
builtins/enable.def
- enable_shell_builtin: if the builtin isn't found, return EX_NOTFOUND
to allow the caller (enable_builtin) to react differently if it
wants to
- dyn_load_builtin: if the shared object isn't found, return EX_NOTFOUND,
change enable_builtin to deal with it
- enable_builtin: if there are no supplied options, and we attempt to
enable a non-existent builtin, try modifying `enable name' to the
equivalent of `enable -f name name' and return success if we
successfully load a builtin from a shared object. Proposed several
times, most recently by Robert Elz <kre@munnari.OZ.AU>
doc/{bash.1,bashref.texi}
- enable: document new behavior of `enable NAME' when NAME is not a
current shell builtin
8/3
---
lib/glob/sm_loop.c
- GMATCH: check for interrupts or terminating signals each time through
the loop and return FNM_NOMATCH immediately if received. Let the
higher layers deal with interrupting the match and jumping out.
Inspired by a report from andrej@podzimek.org
8/6
---
subst.c
- {parameter_brace_remove_pattern,parameter_brace_transform,
parameter_brace_substring,parameter_brace_casemod,
parameter_brace_patsub}: make sure the IND argument is of type
arrayind_t to handle the full range of subscripts. Reported by
felix@f-hauri.ch
builtins/printf.def
- printf_builtin: take new format specifier: %Q. This acts like %q
but applies any supplied precision to the original unquoted
argument, then quotes that result and outputs the entire quoted
string, preserving the original field width. Originally suggested
back in 4/2020 by Sam Liddicott <sam@liddicott.com>
subst.c
- char_is_quoted: check whether or not we are on the second or later
line of a command with an unclosed quoted string from a previous
line. If we are, see if it's closed before the character we're
checking, so we don't interpret a closing quote as starting a new
quoted string. Reported several times, most recently by
Phi Debian <phi.debian@gmail.com> in 6/2021.
8/9
---
parse.y,subst.c
- locale_expand: if the variable SINGLEQUOTE_TRANSLATIONS is non-zero,
single-quote the translated result of $"..." (if it's different from
the untranslated string)
builtins/shopt.def
- noexpand_translation: new option to expose the value of
SINGLEQUOTE_TRANSLATIONS
8/10
----
doc/{bash.1,bashref.texi}
- noexpand_translation: add description of new option
8/16
----
builtins/printf.def
- printf_builtin: initialize retval after parsing arguments, since we
use it for the `v' option. Bug report from Keith Thompson
<Keith.S.Thompson@gmail.com>
lib/sh/unicode.c
- u32tocesc: fix typo that returned \uXXXXXXXX instead of \UXXXXXXXX.
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992257 by
<nabijaczleweli@nabijaczleweli.xyz>
8/17
----
siglist.c
- include command.h before general.h for PARAMS and prototypes. Report
from Osipov, Michael (LDA IT PLM) <michael.osipov@siemens.com>
8/18
----
lib/readline/colors.c
- S_ISBLK: make sure it's defined before we use it, like in complete.c
lib/readline/complete.c,{bashline,variables}.c
- minor changes to prep for making rl_completer_word_break_characters
`const'
subst.[ch],pcomplete.c
- split_at_delims: the DELIMS argument is now `const'; change callers
lib/readline/rlmbutil.h
- _rl_wcwidth: add function prototype for inline function declaration
lib/readline/bind.c
- _rl_get_keyname: print keys greater than 160 (which are valid UTF-8)
as octal escape sequences
lib/readline/text.c
- do_lowercase_version: return 99999 to prevent the linker from
combining it with _rl_null_function and optimizing away the separate
copy. That messes with function pointer comparisons. Part of this
batch of fixes from sparrowhawk996@gmail.com
8/19
----
complete.c,readline.c,readline.h
- rl_completer_word_break_characters: now const char * like
rl_basic_word_break_characters; element of readline state struct
used to save it also const. THIS IS AN API CHANGE
bashline.c
- orig_rl_completer_word_break_characters: now const char * like
rl_completer_word_break_characters
8/20
----
bashline.c
- bash_directory_completion_hook: if direxpand and dirspell are both
set while trying to complete an absolute pathname as a command, don't
take a spell-corrected directory name that is shorter than the
original hint. https://bugzilla.redhat.com/show_bug.cgi?id=1782809
builtins/common.[ch]
- sh_noassign: convenience function to print an error message when a
user attempts an assignment to a "noassign" variable. Not used yet
assoc.[ch]
- assoc_to_kvpair_list: new function, returns a WORD_LIST containing
key-value pairs as separate words
array.[ch]
- array_to_kvpair_list: new function, returns a WORD_LIST containing
index-value pairs as separate words
subst.c
- string_transform: handle '@k' transform like '@K'
- valid_parameter_transform: 'k' is a valid transform operator
- array_transform: handle '@k' transformation by calling one of
array_to_kvpair_list or assoc_to_kvpair_list and treating the
result as if expanding the array depending on whether the index is
`@' or `*' with the usual meanings
doc/{bash.1,bashref.texi}
- document new '@k' parameter transformation operator
8/27
----
lib/readline/kill.c
- rl_unix_filename_rubout: handle pathnames that consist only of one
or more slashes. The old code went too far and deleted the previous
word as well. From dabe@dabe.com
8/31
----
parse.y
- STRING_SAVER: now save and restore shell_input_line_len; not sure
why it wasn't done before; fix push_string and pop_string accordingly
- prompt_again: now takes a parameter FORCE; not used yet (every
caller passes 0), needs more thought
builtins/evalstring.h
- open_redir_file: broke code that expands the redirection and opens
the resultant filename into a new function, called from cat_file
redir.h
- open_redir_file: extern declaration here for now
builtins/evalstring.c
- parse_string: takes a new argument: COMMAND **cmdp; if non-null, saves
the parsed command to *cmdp and lets the caller manage it itself.
global_command is still not modified. Changed callers in parse.y
9/1
---
parse.y
- parse_string_to_command: stripped-down version of xparse_dolparen
that takes a string, runs it through the parser, and returns the
resultant COMMAND *; uses parse_string with the new argument
externs.h
- parse_string_to_command: extern declaration
builtins/evalstring.c
- can_optimize_cat_file: new function, takes a COMMAND * argument and
returns true if the command can be optimized like $(<file); changed
parse_and_execute to call it
subst.c
- optimize_cat_file: new function, optimizes $(<file) without creating
a new process. Uses redir_open to open the redirection file, after
expansion, and calls read_comsub to read from it directly
- read_comsub: now reads into a 4096 byte buffer (COMSUB_PIPEBUF)
- command_substitute: if the string begins with a `<' and isn't followed
by any of "<>&", see if we can optimize the command and call
optimize_cat_file to do it if we can.
9/2
---
configure.ac,config.h.in,lib/sh/setlinebuf.c
- SETVBUF_REVERSED: remove all references
configure.ac,aclocal.m4
- AC_OUTPUT: move created files and commands to AC_CONFIG_FILES and
AC_CONFIG_COMMANDS; call AC_OUTPUT without any arguments
- require autoconf version 2.63
- AC_HELP_STRING -> AS_HELP_STRING
- replace references to $ac_cv_prog_gcc with $GCC
- AC_C_LONG_DOUBLE -> AC_TYPE_LONG_DOUBLE
- enable-alt-array-implementation: new configure option, placeholder
for later
unwind_prot.c
- stddef.h: include if HAVE_STDDEF_H is defined, not STDC_HEADERS
bashansi.h
- memory.h: don't include any more; assume <string.h> has all the
necessary defines
aclocal.m4
- AC_HEADER_STDC: remove AC_REQUIRE calls to this; change tests to use
appropriate checks instead of STDC_HEADERS
9/3
---
configure.ac,config.h.in
- AC_TYPE_SIGNAL,BASH_TYPE_SIGHANDLER: remove calls, remove mention of
RETSIGTYPE and VOID_SIGHANDLER
- AC_USE_SYSTEM_EXTENSIONS: use this instead of AC_ISC_POSIX (which is
well and truly obsolete) and AC_MINIX (which just calls it anyway).
All the right defines are already present
- AC_HEADER_TIME: removed
- AC_HEADER_STDC: removed
- AC_DECL_SYS_SIGLIST: replaced with BASH_DECL_SYS_SIGLIST
- BASH_FUNC_CTYPE_NONASCII: removed
sig.h,lib/readline/signals.c
- RETSIGTYPE -> void, SIGHANDLER_RETURN -> return
include/posixtime.h
- don't bother with TIME_WITH_SYS_TIME, just include <sys/times.h> if
we have it and include <time.h> unconditionally
include/chartypes.h,lib/readline/chardefs.h
- IN_CTYPE_DOMAIN: no longer uses STDC_HEADERS define, checks against
CHAR_MAX for non-C89 systems, still a no-op on C89 systems
lib/readline/chardefs.h
- memory.h: don't include, no need for STDC_HEADERS; assume the mem*
functions are defined in <string.h> as in C89
- now that we assume IN_CTYPE_DOMAIN bounds its argument to unsigned
chars, we don't need NON_NEGATIVE checks at all
lib/readline/chardefs.h,util.c
- ALPHABETIC -> _rl_alphabetic_p
9/8
---
lib/sh/strftime.c
- include <posixtime.h> after reworking above; include <sys/types.h>
unconditionally in case it defines time_t. From a report by
Ori Sky Farrell <bash@ori.mx>
9/9
---
lib/readline/search.c
- rl_history_search_internal: set rl_undo_list to NULL after calling
rl_maybe_save_line, since it will be restored one way or another
after the search completes, and we don't want it to be freed twice
- rl_history_search_internal: leave the current history offset at the
position of the last matching history entry. This means that things
like ^P will start back from that history entry, ^N will move
forward from there, and operate-and-get-next will work like it does
with incremental searches. Reported by Vandrus Zoltán
<vandrus.zoltan@gmail.com>
9/10
----
aclocal.m4
- BASH_C_LONG_LONG: removed
- BASH_TYPE_LONG_DOUBLE: removed
- BASH_TYPE_LONG_LONG,BASH_TYPE_UNSIGNED_LONG_LONG: removed
- BASH_FUNC_CTYPE_NONASCII: removed
- BASH_SYS_SIGNAL_VINTAGE,BASH_SYS_REINSTALL_SIGHANDLERS: don't
require AC_TYPE_SIGNAL, use void instead of RETSIGTYPE
- BASH_TYPE_SIGHANDLER: removed
configure.ac,aclocal.m4,config.h.in
- BASH_TYPE_LONG_LONG: removed, call AC_TYPE_LONG_LONG_INT directly,
change #define to HAVE_LONG_LONG_INT
- BASH_TYPE_UNSIGNED_LONG_LONG: removed, call AC_TYPE_UNSIGNED_LONG_LONG_INT
directly, change #define to HAVE_UNSIGNED_LONG_LONG_INT
externs.h,include/typemax.h,lib/sh/{fmtullong,snprintf,strtoimax,strtoll,
strtoull,strtoumax}.c
- HAVE_LONG_LONG -> HAVE_LONG_LONG_INT
- HAVE_UNSIGNED_LONG_LONG -> HAVE_UNSIGNED_LONG_LONG_INT
configure.ac
- AC_TRY_COMPILE -> AC_COMPILE_IFELSE
- BASH_CHECK_TYPE (intmax_t) -> AC_TYPE_INTMAX_T
- BASH_CHECK_TYPE (uintmax_t) -> AC_TYPE_UINTMAX_T
- BASH_CHECK_TYPE (sig_atomic_t): removed
aclocal.m4
- BASH_FUNC_STRSIGNAL: changed to use AC_LINK_IFELSE
- BASH_FUNC_LSTAT: changed to use AC_LINK_IFELSE
- BASH_FUNC_SBRK: changed to use AC_LINK_IFELSE and AC_RUN_IFELSE,
fixed typo
- BASH_CHECK_SPEED_T: changed to use AC_COMPILE_IFELSE
- BASH_TYPE_SIG_ATOMIC_T: use BASH_CHECK_TYPE instead of AC_CHECK_TYPE
- BASH_STRUCT_DIRENT: new macro, like _AC_STRUCT_DIRENT but public and
sets a different bash-specific shell variable
- BASH_STRUCT_DIRENT_D_{INO,FILENO,NAMLEN}: call BASH_STRUCT_DIRENT
with a different first argument instead of using inline code and
AC_TRY_COMPILE
9/11
----
[prayers for the victims of 9/11/2001]
aclocal.m4
- BASH_CHECK_DECL: just call AC_CHECK_DECLS and use the default
includes, which includes the files we used to specify
- BASH_FUNC_INET_ATON: changed to use AC_LINK_IFELSE
- BASH_STRUCT_WEXITSTATUS_OFFSET: changed to use AC_RUN_IFELSE
- BASH_FUNC_OPENDIR_CHECK: changed to use AC_RUN_IFELSE
- BASH_FUNC_ULIMIT_MAXFDS: changed to use AC_RUN_IFELSE
- BASH_UNDER_SYS_SIGLIST: changed to use AC_RUN_IFELSE
- BASH_SYS_SIGLIST: changed to use AC_RUN_IFELSE
- BASH_FUNC_DUP2_CLOEXEC_CHECK: changed to use AC_RUN_IFELSE
- BASH_FUNC_GETENV: changed to use AC_RUN_IFELSE
- BASH_FUNC_GETCWD: changed to use AC_RUN_IFELSE
- BASH_FUNC_FNMATCH_EXTMATCH: changed to use AC_RUN_IFELSE
- BASH_FUNC_POSIX_SETJMP: changed to use AC_RUN_IFELSE
- BASH_FUNC_STRCOLL: changed to use AC_RUN_IFELSE
- BASH_FUNC_PRINTF_A_FORMAT: changed to use AC_RUN_IFELSE
- BASH_SYS_PGRP_SYNC: changed to use AC_RUN_IFELSE
- BASH_SYS_SIGNAL_VINTAGE: changed to use AC_RUN_IFELSE
- BASH_SYS_NAMED_PIPES: changed to use AC_RUN_IFELSE
- BASH_CHECK_RTSIGS: changed to use AC_RUN_IFELSE
- BASH_CHECK_MULTIBYTE: changed to use AC_RUN_IFELSE
- RL_LIB_READLINE_VERSION: changed to use AC_RUN_IFELSE
- BASH_CHECK_WCONTINUED: changed to use AC_RUN_IFELSE
- BASH_FUNC_SNPRINTF: changed to use AC_RUN_IFELSE
- BASH_FUNC_VSNPRINTF: changed to use AC_RUN_IFELSE
- BASH_FUNC_FNMATCH_EQUIV_FALLBACK: changed to use AC_RUN_IFELSE
- BASH_DECL_PRINTF: changed to use AC_RUN_IFELSE
- BASH_TYPE_RLIMIT: rewrote to avoid quad_t, now uses AC_COMPILE_IFELSE
to determine whether rlim_t is available, otherwise determines the
value of RLIMTYPE based on sizeof(rlim.rlim_cur): int, long, or
long long
- BASH_SIZEOF_RLIMIT,BASH_SIZEOF_QUAD_T: helper macros for
BASH_TYPE_RLIMIT in the case that rlim_t is not present
configure.ac
- BASH_CHECK_DECL -> AC_CHECK_DECLS
- quad_t: use AC_CHECK_TYPE (new style) instead of BASH_CHECK_TYPE
9/14
----
execute_cmd.c
- time_command: if we longjmp back to the top_level we saved, make sure
we're in the same subshell environment before printing the timing
stats. We could have longjmped back from a child process of the
command or pipeline we want to time. From a report by
Sergej Alikov <sergej@alikov.com>
- time_command: restore command->flags even if we longjmp back
general.c
- check_binary_file: if the first line of the ENOEXEC file starts with
a `#!', check the rest of the buffer for NULs to determine whether
this is a binary file. Since we only check the first line, a #! line
followed by binary data could be confused for a shell script
9/16
----
bashjmp.h
- EXITBLTIN: new longjmp `code' value: used by the exit builtin
{execute_cmd,shell,subst,trap}.c,builtins/evalstring.c
- treat EXITBLTIN exactly the same as EXITPROG (for now)
builtins/exit.def
- exit_builtin: jump_to_top_level with value EXITBLTIN
builtins/evalstring.c
- parse_and_execute: EXITBLTIN has its own case, with the same contents
as EXITPROG
9/17
----
builtins/evalstring.c
- parse_and_execute: change EXITBLTIN case to avoid running the
unwind-protect stack to the `pe_dispose' tag (which has the effect
of running all the unwind-protects installed by the commands in
the string) if we're executing in a function and EXIT is trapped.
This has the effect of running the EXIT trap in the function context,
which is what we do when we're not in parse_and_execute (eval,
bash -c, command substitution, etc.)
9/18
----
arrayfunc.c
- expand_and_quote_kvpair_word,quote_compound_array_word,
expand_and_quote_assoc_word,quote_compound_array_list: make sure
the value has CTLESC characters doubled even when being single-
quoted, since that's what the parser does with standalone assignment
statements. From https://savannah.gnu.org/support/?110538
9/19
----
aclocal.m4
- AC_TRY_COMPILE -> AC_COMPILE_IFELSE (AC_TRY_LINK calls left to
modify to avoid obsolete warnings)
- BASH_STRUCT_WINSIZE: broke out checks for separate headers into new
macros, call them and work with the results; needed to avoid two
calls to AC_TRY_COMPILE
- BASH_CHECK_KERNEL_RLIMIT: avoid multiple calls to AC_TRY_COMPILE by
breaking basic test for RLIMIT_ defines into a separate test and
calling the HPUX-specific _KERNEL test only if that fails
m4/gettext.m4,configure.ac
- AM_GNU_GETTEXT -> BASH_GNU_GETTEXT: remove deprecation warning, since
[no-libtool] is how we use this; rename to avoid someone's local
copy from overriding ours
9/20
----
aclocal.m4
- BASH_CHECK_MULTIBYTE: take out code that checks for nl_langinfo(CODESET)
since that's already provided by AM_LANGINFO_CODESET, which is
called by BASH_GNU_GETTEXT. We AC_REQUIRE it here, though, to avoid
problems from future changes
- BASH_SYS_SIGNAL_VINTAGE: broke the code that checks for the different
signal vintages into different AC_DEFUNed macros, changed
BASH_SYS_SIGNAL_VINTAGE to stitch them together with shell code
testing the cached variables
- AC_TRY_LINK -> AC_LINK_IFELSE: there are no more autoconf warnings
9/21
----
array.[ch]
- array_from_argv: new convenience function
array.h
- num_elements: now an arrayind_t, since that's the type of indices, it
makes sense to allow that many elements
9/22
----
lib/readline/terminal.c
- rl_term_kP: fix typo. Fix from Koichi Murase <myoga.murase@gmail.com>
9/25
----
lib/readline/display.c
- rl_clear_visible_line: call _rl_clear_to_eol with _rl_screenwidth as
the argument so we clear out the entire line even if the terminal
doesn't have a clear-to-eol sequence; make sure to add a call to
rl_cr after that so we know we're always in column 0
- _rl_redisplay_after_sigwinch: just call rl_clear_visible_line instead
of erasing the last line of the display
- _rl_redisplay_after_sigwinch: if the prompt is longer than the screen
width, make sure to call _rl_reset_prompt to recalculate the
local_prompt_newlines array. Should fix issue from
https://savannah.gnu.org/support/index.php?110543
redir.c
- do_redirection_internal: if given [N]<&WORD- or [N]>&WORD- and WORD
expands to null, make it identical to <&- or >&- and close file
descriptor N (default 0). From a discussion back in 5/2021
9/27
----
arrayfunc.c
- expand_compound_array_assignment: since we run the string through
the parser to turn it into a list (so we can make sure all shell
metacharacters are properly quoted), we need to remove the CTLESC
the parser uses to quote CTLESC and CTLNUL in *unquoted* words.
The rest of the code assumes this has been done, and assumes that
any CTLESC characters passed to expansion are part of the original
word and should themselves be quoted, doubling the number of CTLESCs
9/28
----
arrayfunc.c
- expand_and_quote_kvpair_word,quote_compound_array_word,
expand_and_quote_assoc_word,quote_compound_array_list: if we are
single-quoting associative array subscripts and associative and
indexed array values, we need to quote CTLESC characters, because
that's how they come out of the parser and how the assignment
statement code expects to see them.
Fixes https://savannah.gnu.org/support/index.php?110538
9/29
----
subst.c
- parameter_brace_transform: invalid transformation operators are now
fatal errors in non-interactive shells, as with the other word
expansions. Reported by Martin Schulte <gnu@schrader-schulte.de> in
https://lists.gnu.org/archive/html/bug-bash/2020-10/msg00026.html
execute_cmd.c
- execute_disk_command: if we're optimizing out the fork (nofork) and
not directly in a pipeline (pipe_in == pipe_out == NO_PIPE), only
modify shell_level if subshell_environment says we're not already in
a pipeline. Reported by Paul Smith <psmith@gnu.org> 10/11/2020
against GNU make
evalstring.c
- should_suppress_fork: remove #if 1 for code that tries to suppress
the fork in a process substitution subshell
9/30
----
builtins/mapfile.def
- do_chop: make sure we're comparing unsigned chars when checking
whether the delim is the last character on the line. Reported by
Greg Wooledge <greg@wooledge.org>
10/1
----
lib/readline/rltty.c
- rl_deprep_terminal: if we're not echoing to the terminal
(_rl_echoing_p == 0), and we just output the bracketed paste end
sequence, output a newline to compensate for the \r at the end of
BRACK_PASTE_FINI, since redisplay didn't do it for us. Reported by
Siteshwar Vashisht <svashisht@redhat.com>
shell.h
- MATCH_EXPREP: new matching flag, understood only by pattern
substitution; means to expand unquoted `&' in the replacement
STRING to the match of PATTERN
subst.c
- shouldexp_replacement: uncommented
- pat_subst: we expand & in the replacement string if MATCH_EXPREP
appears in MFLAGS
- parameter_brace_patsub: push call to shouldexp_replacement out here,
after the replacement string is expanded; set MATCH_EXPREP if there
is an unquoted `&' (by backslash) in the expanded replacement
string
doc/{bash.1,bashref.texi}
- pattern substitution: overhauled the description, moved each of the
possible forms to be tags in the tagged paragraph. The description
now specifies the expansions that the replacement string undergoes
- pattern substitution: documented new behavior of unquoted & in the
replacement string
10/4
----
shell.c
- include <malloc/shmalloc.h> if we're debugging malloc (MALLOC_DEBUG)
so we can get an extern declaration of trace_malloc_stats
10/5
----
subst.c
- expand_subscript_string: allocate new memory for td.word, copying
STRING, in case it gets freed on error by expand_word_internal.
Report and fix from Koichi Murase <myoga.murase@gmail.com>
lib/malloc/malloc.c
- malloc_usable_size: return the allocated size instead of the chunk
size, since writing over the bounds checking will cause fatal errors.
Reported by Julien Moutinho <julm+bash@sourcephile.fr>, fix from
Dominique Martinet <asmadeus@codewreck.org>
arrayfunc.c
- unbind_array_elememnt: pass (flags&VA_NOEXPAND) to skipsubscript(),
instead of unconditionally passing 1 if we're operating on an
associative array. This is consistent with how valid_array_reference
determines the length of the subscript.
Report and fix from Koichi Murase <myoga.murase@gmail.com>
10/6
----
subst.c
- skip_to_delim: add a new value for FLAGS. If FLAGS&2, we assume that
START is one character after the opening OPEN. If not, we assume that
START is at OPEN, and needs to be incremented past it. Part of fix
from Koichi Murase <myoga.murase@gmail.com>
arrayfunc.c
- unbind_array_element: make sure to pass FLAGS to skipsubscript with
bit 2 set, since we are passed a SUB index that's one past the
opening bracket. Rest of fix from
Koichi Murase <myoga.murase@gmail.com>
- array_variable_name: make sure we pass (FLAGS&1) to skipsubscript, so
we don't inadvertently pass a value with bit 2 set, which would
cause an off-by-one error in subscript parsing
10/8
----
trap.c
- restore_traps: inverse of reset_signal_handlers. This understands
how reset_signal_handlers changes the signal disposition while
leaving the trap string in place, and knows how to restore flags
and state based on that preserved trap string and whether or not
the signal is "special" to the shell.
builtins/exec.def
- exec_builtin: instead of using restore_original_signals to completely
cancel the traps, call reset_signal_handlers so the trap strings are
preserved. Then if the exec fails (and we're not exiting) we can
look at the trap strings and see how to restore the trap state.
This calls restore_traps after reinitializing the shell signal
handlers, using the trap strings saved by reset_signal_handlers.
Fixes issue with not exiting after a failed exec clearing the EXIT
trap reported by Mark March <march@systempad.org>, using the
approach suggested by Robert Elz <kre@munnari.OZ.AU>
subst.c
- expand_declaration_argument: when parsing options that modify
attributes that affect how the value is handled (i, c, u, etc.),
make sure to create an option string and call make_internal_declare
with options that start with a `+' so the attribute is off when
the assignment is performed and changes how the value is expanded.
From a report by Léa Gris <lea.gris@noiraude.net>
lib/readline/complete.c
- rl_display_match_list: even if _rl_completion_prefix_display_length
is set to a non-zero value, pass the common prefix length to
fnprint if we've turned on colored completion prefixes; passes
through to fnprint via print_filename
- fnprint: add the ellipsis if prefix_bytes exceeds the
_rl_completion_prefix_display_length, add explicit check for
prefix_bytes being longer since print_filename passes it through
if colored-completion-prefix is set. This means that while
completion-prefix-display-length still has precedence over
colored-completion-prefix, it doesn't override it if both are set
and the common prefix length is shorter than
completion-prefix-display-length. From a report by
Christoph Anton Mitterer <calestyo@scientia.net>
10/10
-----
parse.y
- parse_dparen: if the last token is FOR, increment word_top and assign
word_lineno like for other for loops. Fixes bug with LINENO after
arithmetic for commands reported by
Tom Coleman <thomas.james.coleman@gmail.com>
10/11
-----
execute_cmd.c
- shell_execve: if execve fails with ENOENT, but executable_file()
succeeds, display a slightly more descriptive error message. Prompted
by a report from Andrea Monaco <andrea.monaco@autistici.org>
stringlib.c
- strcreplace: allow backslash to escape a backslash, since we allow it
to escape a `&'
10/14
-----
pcomplib.c
- COMPLETE_HASH_BUCKETS: double to 512
stringlib.c
- strcreplace: the last argument is now a flags argument. 1 has its
previous meaning (glob); 2 means to allow backslash to escape a
backslash (as added on 10/11)
subst.c
- pat_subst: call strcreplace with 2 as the flags value
10/15
-----
doc/bashref.texi
- updates to Installation section
doc/{mkposix,mkinst,mkrbash},doc/Makefile.in
- changes to allow scripts to be run outside the source directory
10/18
-----
subst.c
- patsub_replacement: controls whether pattern substitution expands `&'
in the replacement string. Initialized to 1 by default
10/19
-----
doc/{bash.1,bashref.texi}
- document bash's WCE SIGINT behavior when job control is not enabled
and the shell receives a SIGINT while waiting for the foreground
command to complete. Added at Red Hat's request. A complete
discussion is at https://www.cons.org/cracauer/sigint.html
10/25
-----
builtins/shopt.def
- patsub_replacement: new shell option, exposes patsub_replacement
variable controlling whether pattern substitution expands `&' in
the replacement string. Still enabled by default.
doc/{bash.1,bashref.texi}
- patsub_replacement: document new shopt option
10/26
-----
lib/readline/display.c
- expand_prompt: group runs of invisible characters at the right edge
of the screen with the previous physical characters when setting
local_prompt_newlines, since that's how update_line() expects to
get it. Fix from sparrowhawk996@gmail.com.
lib/readline/macro.c
- rl_end_kbd_macro: make sure current_macro_index is > 0 after
subtracting the key sequence length, clamp it to 0 before writing
the ending NULL. From a fuzzing report by
Tillmann Osswald <tosswald@ernw.de>
lib/readline/isearch.c
- _rl_isearch_dispatch: in the bracketed paste case, don't assume the
pasted text is null-terminated, so use memcpy instead of strcpy for
the length of the pasted text, then make sure the search string is
null-terminated. From a fuzzing report by
Tillmann Osswald <tosswald@ernw.de>
lib/readline/text.c
- rl_transpose_words: make sure to preserve the value of rl_end from
the beginning to the end of the function. From a fuzzing report by
Tillmann Osswald <tosswald@ernw.de>
lib/readline/vi_mode.c
- rl_vi_delete_to,rl_vi_change_to,rl_vi_yank_to: if we are redoing a
command (_rl_vi_redoing == 1), save the old _rl_vimvcxt, allocate a
new one, and restore the old one before returning. Prevents some
pointer aliasing problems. From a fuzzing report by
Tillmann Osswald <tosswald@ernw.de>
10/29
-----
arrayfunc.c
- tokenize_array_reference: take valid_array_reference and add a third
argument (char **SUBP), which, if non-NULL, gets the null-terminated
subscript parsed from the NAME argument. If it's NULL, the caller
gets the old valid_array_reference behavior. Fix from
Koichi Murase <myoga.murase@gmail.com>
- valid_array_reference: just call tokenize_array_reference with a
NULL third argument
- unbind_array_element: assume the caller (unset_builtin) passes a
null-terminated SUB that's already been validated by a call to
tokenize_array_reference so we don't need to call skipsubscript() or
check VA_ONEWORD. Fix from Koichi Murase <myoga.murase@gmail.com>
arrayfunc.h
- tokenize_array_reference: extern declaration
builtins/set.def
- unset_builtin: use tokenize_array_reference to figure out T and pass
that to unbind_array_element. Fix from
Koichi Murase <myoga.murase@gmail.com>
- unset_builtin: pass non-null argument to array_variable_part to get
the length of the subscript (T), then cut off any final `]' before
passing it to unbind_array_element, since that's what it now
expects
subst.c
- expand_string_for_rhs,expand_string_for_pat: assign td.word from
newly-allocated memory in case it gets freed on error during the
call to call_expand_word_internal(); free it manually when that
call returns
11/1
----
findcmd.c
- search_for_command: if FLAGS includes CMDSRCH_STDPATH, don't look in
the hash table for the command name. Prompted by a report from
Roger Morris <roger.morris@gmail.com>
aclocal.m4
- BASH_FUNC_POSIX_SETJMP: add a check by fetching the signal mask
after the siglongjmp and making sure that SIGINT is not blocked,
indicating we restored the original signal mask
11/2
----
subst.c
- expand_string_assignment: make sure to add W_TILDEEXP to the flags so
expand_word_internal performs the right tilde expansion on tildes
following an unquoted colon. Report from Anders Kaseorg
<andersk@mit.edu>
11/3
----
aclocal.m4
- BASH_FUNC_POSIX_SETJMP: if cross-compiling, default to `present' if
we've determined we have posix signal functions
11/4
----
execute_cmd.c
- SET_LINE_NUMBER: set line_number, but don't set line_number_for_err_trap
if we're already running the ERR trap
- GET_LINE_NUMBER: evaluates to line_number_for_err_trap if we're
running the ERR trap and executing_line_number() otherwise
- execute_function: use GET_LINE_NUMBER to push the value for the line
number into the BASH_LINENO array
- execute_command_internal,execute_arith_command,execute_cond_command:
use SET_LINE_NUMBER to avoid overwriting line_number_for_err trap
while executing the ERR trap. Tentative fix for `caller' problem
reported by Quinn Grier <quinn@quinngrier.com>
configure.ac,patchlevel.h
- set bash version to 5.2-devel, meaning shell_compatibility_level = 52,
which required updating tests (array.tests, array21.sub,
quotearray3.sub, new-exp10.sub, history2.sub). The first three are
because bash-5.2 flushes an indexed array but does not unset the
variable when given `unset a[@]' or `unset[*]' (that is, it acts
like `a=()' instead of `unset a'); the other two are because the
version number changed
11/8
----
doc/Makefile.in
- bash.info: use `makeinfo -o' instead of calling infopost.sh to edit
the filename, since the tags table includes absolute byte offsets to
nodes. From https://savannah.gnu.org/support/?110557
11/15
-----
examples/loadables/realpath.c
- add -a NAME argument to put canonicalized pathnames into an indexed
array instead of displaying them on stdout. Suggested by
felix@f-hauri.ch
lib/readline/colors.c
- _rl_custom_readline_prefix: new function, looks in $LS_COLORS for a
custom extension (*.readline-colored-completion-prefix) and uses that,
if found, as the default color for the common prefix displayed when
`colored-completion-prefix' is set. Suggested by
Christoph Anton Mitterer <calestyo@scientia.net>
- _rl_print_prefix_color: try the return value from _rl_custom_readline_prefix
before defaulting to the C_PREFIX (C_SOCK) color. Suggested by
Christoph Anton Mitterer <calestyo@scientia.net>
lib/readline/doc/{readline.3,rluser.texi},doc/bash.1
- readline-colored-completion-prefix: document new custom suffix for
readline's colored-completion-prefix color
11/16
-----
doc/{bash.1,bashref.texi},builtins/set.def
- set: modify usage synopsis slightly, based on
https://bugzilla.redhat.com/show_bug.cgi?id=2022324
builtins/set.def
- unset_builtin: add shell compatibility level check <= bash-5.1 to
force `unset a[@]' to unset array variable `a', like in previous
versions, instead of unsetting associative array element `@' or
removing all elements of an indexed array without unsetting the
variable itself
builtins/common.c
- set_expand_once: now a no-op if the shell compatibility level is
<= bash-5.1, preserving the previous versions' behavior for [[ -v
(dependent on assoc_expand_once instead of forcing it)
subst.c
- parameter_brace_expand_rhs: make sure that the final value assigned
is always returned from ${a:=b}, even when `a' has a variable
attribute that modifies the value on assignment. Reported back on
1/20/2021 by oguzismailuysal@gmail.com; bash-5.2 tag removed
11/22
-----
doc/{bashref.texi,bash.1}
- unset: change the description of `unset name[@]' (unset name[*])
to reflect the new behavior (unset associative array subscripts or
remove all elements from an indexed array) and the difference from
previous versions
- set: document -r for restricted shell mode
- restricted shell: change occurrences of `set +o restricted' to
`shopt -u restricted_shell'. From a report from
Jin Xiang <jxiang.sd@gmail.com>
- read: note that read -t0 may return 0 if a subsequent read will
return EOF. From a suggestion by Dale R. Worley
<worley@alum.mit.edu>
execute_cmd.c
- execute_arith_command,eval_arith_for_expr: don't pass EXP_EXPANDED
to evalexp if shell_compatibility_level > 5.1, assuming that the
expression has been quoted by Q_ARITH handling
test.c
- test_arithcomp: if we're being called by the conditional command
code and treating the arguments to the arithmetic operators as
expressions, don't pass EXP_EXPANDED to evalexp if the shell
compatibility level is > 5.1, assuming that the expression has been
quoted by Q_ARITH handling
11/29
-----
examples/loadables/getconf.[ch]
- getconf: new implementation of loadable builtin, based on glibc
getconf
examples/loadables/sleep.c
- parse_gnutimefmt: parse GNU interval format (2m30s), returning
seconds and microseconds like uconvert
- sleep: use parse_gnutimefmt if uconvert can't parse the format right
away and "dhms" appears in the format string. Don't return
EX_DISKFALLBACK under any circumstances
11/30
-----
builtins/wait.def
- wait_builtin: refer to unset_waitlist only if JOB_CONTROL is enabled.
Report from Joel Ebel <jbebel@google.com>
parse.y,builtins/set.def
- changes for minimal config restrictions
configure.ac,config.h.in
- --enable-translatable-strings: new configuration option to allow
$"..." support to be compiled in or out; not included in the minimal
shell configuration
shell.c
- main: don't include any of the dump-strings options if
TRANSLATABLE_STRINGS is not defined
lib/sh/shquote.c
- sh_backslash_quote_for_double_quotes: needed for translatable strings
parse.y
- support for translating $"..." strings now conditional on
TRANSLATABLE_STRINGS
locale.c
- locale_expand: now conditional on TRANSLATABLE_STRINGS
subst.c
- expand_string_dollar_quote: support for $"..." now conditional on
TRANSLATABLE_STRINGS
doc/bashref.texi
- --enable-translatable-strings: document new configuration option
12/2
----
subst.c
- verify_substring_values: now that the default compatibility level is
52, and the Q_ARITH code is enabled, make the EXP_EXPANDED flag for
evalexp() dependent on the compatibility level
- param_expand: arithmetic substitution: make EXP_EXPANDED flag
for evalexp() dependent on the compatibility level
- expand_word_internal: don't call expand_array_subscript if the
shell compatibility level is 51 or below (Q_ARITH)
test.c
- test_unop: if the shell compatibility level is > 51, using [@] with
an existing associative array will report on a key of `@'
arrayfunc.c
- array_expand_index: if the compatibility level is > 51, Q_ARITH is
used and we don't pass EXP_EXPANDED to evalexp()
COMPAT,doc/bashref.texi
- shell compatibility mode: document effects of setting the
compatibility mode to 51
12/3
----
lib/malloc/malloc.c
- mremap: only use if MREMAP_MAYMOVE is defined, since we use the Linux
version of the function signature
12/6
----
bashhist.c
- bash_add_history: if we're parsing a here-document (PST_HEREDOC), only
suppress adding the newline between lines if we're not at the first
line of the here-document (here_doc_first_line != 0). From a report
by S0AndS0 <strangerthanbland@gmail.com>
12/8
----
lib/readline/colors.c
- _rl_custom_readline_prefix: use STREQN to check for the extension
string in $LS_COLORS, since it's not necessarily null-terminated.
From https://savannah.gnu.org/patch/?10158
12/10
-----
variables.c
- set_int_value,set_string_value: broke common code for setting int
and string dynamic variable values out into separate functions;
changed all callers to use them where appropriate. set_int_value
takes a flags argument saying whether or not to force the integer
attribute on
- assign_random: store the value assigned as the variable value so
things like RANDOM=42; RANDOM+=7 generate consistent sequences
like in ksh93
- assign_seconds: store the value assigned as the variable value so
things like SECONDS=42 ; SECONDS+=7 generate what's expected
doc/Makefile.in
- changes to allow man pages that include others (.so FN) to be built
outside the source tree
12/13
-----
arrayfunc.c
- assign_array_element_internal: take an additional argument: char **NVALP.
If non-null, it gets the value eventually assigned to the array
element
- assign_array_element: take an additional NVALP argument; pass it to
assign_array_element_internal
arrayfunc.h
- assign_array_element: new extern function declaration
{subst,variables}.c,builtins/{common.c,declare.def}
- assign_array_element: change callers
subst.c
- parameter_brace_expand_rhs: for the ${param:=value}, use the value
returned by assign_array_element in NVALP as the return value, since
it's the value ultimately assigned to the variable after possible
modification (e.g., arithmetic evaluation). Reported by
oguzismailuysal@gmail.com after flawed fix applied 11/16
12/14
-----
arrayfunc.h
- array_eltstate_t: an object that encapsulates an array element's
state (type, index, key, value) whether it's an indexed or
associative array
arrayfunc.c
- {init,flush}_eltstate: new functions to initialize and flush any
allocated memory from array_eltstate_t objects. No allocation/
deallocation functions yet; the only use is with a static instance
- assign_array_element_internal: take an array_eltstate_t * instead of
a char ** as the final argument, so we can return keys/indices and
values depending on the type of array; populates it with the
appropriate values
- assign_array_element: take array_eltstate_t * as final argument
instead of a char **; pass it to assign_array_element_internal
{subst,variables}.c,builtins/{common.c,declare.def}
- assign_array_element: change callers to modify final argument
12/15
-----
arrayfunc.c
- array_value_internal: now takes an array_eltstate_t * as the final
argument; there is no more `rtype' argument in favor of the
`subtype' member; returns the appropriate values in its members
- array_value: changed to pass array_eltstate_t to array_value_internal,
saves and fetches its `ind' member into *indp; saves `subtype'
member into *rtype
- get_arrary_value: changed to take array_eltstate_t as third argument,
passes it to array_value_internal
{redir,expr}.c
- get_array_value: changed callers; initializing the array_eltstate_t
argument as necessary
test.c
- test_builtin: changed to use get_array_value, adding AV_ALLOWALL to
the flags, since it didn't use any QUOTED argument. Pass
array_eltstate_t * as final argument and get subtype from it (the
only thing we're interested in, to deallocate memory)
12/16
-----
arrayfunc.c
- array_value: now takes a final argument of array_eltstate_t *, which
it passes to array_value_internal; no more rtype and indp args.
Callers are responsible for marshalling values into estatep
arrayfunc.h
- array_value: changed function signature
subst.c
- get_var_and_type,parameter_brace_expand_word: changed calls to
array_value to use array_eltstate_t argument and initialize it
appropriately. Copy values back from it to the parameters we need
to modify
variables.c
- assign_lineno: call set_int_value to store the value, like with
RANDOM and SECONDS (from 12/10)
12/17
-----
{eval,execute_cmd}.c
- when bypassing a parsed command because read_but_dont_execute is
set, don't modify last_command_exit_value. From a report by
Robert Elz <kre@munnari.OZ.AU>
parse.y
- parse_comsub: make sure the first call to shell_getc to check whether
or not it's an arithmetic expansion skips a quoted newline. From a
report by Robert Elz <kre@munnari.OZ.AU>
12/21
-----
subst.c
- parameter_brace_remove_pattern,parameter_brace_patsub,parameter_brace_casemod,
parameter_brace_transform,parameter_brace_substring: now take an
array_eltstate_t * argument in place of the arrayind_t argument, pass
it to get_var_and_type; this generalizes the indexed array behavior
of expanding array subscripts once to associative arrays via an
eventual call to array_value_internal with a non-null KEY member
- get_var_and_type: now takes an array_eltstate_t * argument in place
of the arrayind_t argument; use it in calls to array_value so we
can only expand array subscripts once whether they are indexed or
associative arrays
- parameter_brace_expand_word: take an array_eltstate_t * argument in
place of the arrayind_t * argument; pass it to array_value; use a
static version (which we init and flush) if the argument passed is
NULL so we can get the right state passed back and forth
- parameter_brace_expand: pass a pointer to a static array_eltstate_t
to parameter_brace_expand_word, and use that in the various calls to
parameter_brace_XXX functions that perform specific expansions in
place of the old arrayind_t argument; make sure to flush it before
returning, even on errors
12/22
-----
{trap,variables}.c
- internal_warning: calls changed to use translatable strings
consistently
error.[ch]
- internal_debug: new function, prints a message like internal_warning,
no-op if DEBUG is not defined
- INTERNAL_DEBUG: macro that expands to internal_debug when DEBUG is
defined, and nothing otherwise
{jobs,trap}.c
- changed some internal_warning and internal_inform calls to use
internal_debug, since they were active only when DEBUG is defined
parse.y
- parse_comsub: add internal_debug call when a command substitution
ends with unterminated here-documents
builtins/common.c
- number_of_args: unconditionally return posparam_count
{jobs,execute_cmd,subst}.c,parse.y,builtins/{command.def,evalstring.c}
- INTERNAL_DEBUG: use instead of calls to itrace protected by #ifdef
DEBUG
12/26
-----
lib/glob/glob.c
- glob_always_skip_dot_and_dotdot: initialize to 1 (enabled)
builtins/shopt.def
- globskipdots: new shell option, exposes glob_always_skip_dot_and_dotdot
doc/{bash.1,bashref.texi}
- globskipdots: document new shell option
execute_cmd.c
- fix_arrayref_words: call valid_array_reference with 0 for third arg
because the words have not undergone any word expansions yet and
the quotes are still present. This makes things like
A=[\[]=set
unset A[\[]
work
subst.c
- word_list_split: if a word undergoes word splitting but is not
changed, preserve any W_ARRAYREF flag into the new word. This makes
things like
rkey=']'
unset A[$rkey]
work because the unset builtin sees the W_ARRAYREF flag on its
argument
12/29
-----
builtins/common.h
- SET_VFLAGS: take a set of word flags, and set flags for use with
valid_array_reference (vflags) and assign_array_element/bind_int_variable
(bindflags) based on those flags and the setting of assoc_expand_once
(moved from read.def and generalized)
arrayfunc.c
- array_variable_name: now exclusively takes AV_xxx flags; understands
how to translate AV_NOEXPAND to the right flag for skipsubscript;
understands AV_ONEWORD and AV_NOEXPAND
- array_variable_part: just passes the FLAGS arg to array_variable_name
- assign_array_element: translates ASS_ flags to AV_ flags for
array_variable_name
- array_value_internal: now just passes flags straight through to
array_variable_part (which sends them to array_variable_name)
builtins/common.[ch]
- builtin_bind_var_to_int: now takes a new FLAGS third argument; passes
it to bind_var_to_int
builtins/printf.def
- printf_builtin: use SET_VFLAGS to set flags for builtin_bind_variable
(bindflags); makes things like
declare -A A; key=']' ; printf -v A[$key] "foo"
work without a subscript error as long as assoc_expand_once is defined
builtins/read.def
- read_builtin: use new common version of SET_VFLAGS instead of
private version; changed to use new calling sequence; makes things like
declare -A A; key=']' ; read A[$key] <<<"foo"
work without a subscript error as long as assoc_expand_once is defined
builtins/wait.def
- wait_builtin: use SET_VFLAGS for variable name with -p option
- wait_builtin: call builtin_bind_var_to_int with new bindflags third
argument
expr.c
- expr_streval: just pass TFLAG (AV_xxx flags) straight through to
array_variable_part
variables.c
- bind_int_variable: translate the assignment flags (ASS_xxx) to
VA_xxx flags for valid_array_reference calls (ASS_ONEWORD); translate
assignment flags to AV_xxx flags for array_variable_part
12/30
-----
subst.c
- parameter_brace_expand: when expanding an indirect variable, extend
the special case for array[@] and array[*] (set -u/no positional
parameters, obeying the baroque quoting rules) to the value of the
indirection. Report and fix from konsolebox <konsolebox@gmail.com>
12/31
-----
parse.y
- compound_list: when parsing a compound_list production, collect any
pending here-documents after reading a newline, not after reading
any command terminator. Fixes interactive-only prompting bug
reported back in 8/2021 by Hyunho Cho <mug896@gmail.com>
1/1/2022
--------
bashline.c
- set_filename_quote_chars: break code that modifies
rl_filename_quote_characters based on whether DIRNAME needs to be
expanded from bash_directory_completion_hook into its own function
- bash_check_expchar: break code that checks whether DIRNAME will be
word expanded from bash_directory_completion_hook into its own
function
- bashline_reset,attempt_shell_completion: make sure complete_fullquote
is set to 1 (as it is by default) in case a completion modifies it
- bash_quote_filename: if we are completing (but not expanding --
direxpand is unset) and backslash-quoting a filename with expansion
characters as determined by bash_check_expchar, make sure
filename_bstab is set not to include the expansion char (and any
following char and closer) and set complete_fullquote to 0 so
sh_backslash_quote uses filename_bstab. Fixes the longstanding issue
of quoting a `$', for instance, if the rest of the filename contains
any characters that need quoting in filenames. This assumes that the
filename is unquoted (*QCP == 0) so the word will be expanded and is
not part of the filename (if needed, we can use file_exists to check
whether the expansion characters are actually part of the filename)
1/7
---
examples/loadables/accept.c
- new -b bindaddr option to bind to a specific IP address
- move setsockopt calls before bind() to avoid TIME_WAIT issues. Fixes
from Dzogovic Vehbo <dzove855@gmail.com>
1/10
----
configure.ac
- bumped version to 5.2-alpha.
1/16
----
tests/{unicode1,glob2,intl2}.sub, tests/run-intl
- minor changes to add warnings for missing locales that cause test
failures
1/17
----
parse.y
- history_delimiting_chars: if we have a blank line by the time we
hit the end of the tests, return a semicolon for the first blank
line to avoid running lines of a multi-line command together.
Fixes bug reported by Joakim Lindblad <joakim@cb.uu.se>
subst.c
- expand_string_for_patsub: expand the replacement string for pattern
substitution assuming that it will eventually be passed to
strcreplace to replace `&' with the matched portion of the string.
This calls expand_string_for_pat(), which leaves the string quoted
and does not perform word splitting, then calls
quote_string_for_repl to post-process the expanded string.
- quote_string_for_repl: perform quote removal on passed string while
replacing CTLESC escaping a `&' or a backslash with a backslash. The
result must be passed to strcreplace
- parameter_brace_patsub: call expand_string_for_patsub if
patsub_replacement is set to quote
1/18
----
subst.c
- read_comsub: make istring_index a size_t to avoid overflow with very
large values of istring_size.
From https://savannah.gnu.org/support/index.php?110596
- expand_word_internal: make istring_index a size_t
1/20
----
buitins/cd.def
- add a description of `cd -' to the help text. Suggested by
Rob Landley <rob@landley.net>
1/21
----
lib/glob/glob.c
- glob_vector: if we allocate NEXTLINK using malloc, and free it due to
some allocation failure, reset FIRSTMALLOC to avoid duplicate frees
later on
subst.[ch]
- sub_append_string: the INDX parameter is now a size_t to avoid
overflow
parse.y
- decode_prompt_string: RESULT_INDEX is now a size_t to pass to
sub_append_string
jobs.[ch],nojobs.c
- wait_for_background_pids: now returns the number of jobs/processes
reaped
builtins/wait.def
- wait_builtin: if -p pid supplied without -n, make sure we do something
useful if no job/pid arguments are supplied and there are no jobs.
Reported by Oguz <oguzismailuysal@gmail.com>
builtins/read.def
- read_builtin: if we have a timeout, use SIGALRM instead of select
when in posix mode, since we use read instead of zread. Fixes bug
reported by Andreas Schwab <schwab@linux-m68k.org>
subst.c
- expand_string_dollar_quote: handle single-quoted and double-quoted
strings that might include $' and $" without attempting translation;
do more error checking for unterminated $' and $" that leaves those
characters unmodified. This is for use by readline's various line
expansion functions (shell_expand_line)
1/23
----
parse.y,make_cmd.c
- revert change that unconditionally processes $'...' and $"..." in
here-document bodies; there are only a couple of cases where they
should be processed in a double-quote environment
1/24
----
subst.c
- extract_dollar_brace_string: if we see another `${' on the rhs of
the operator, reset the dolbrace_state to DOLBRACE_PARAM while we
read this new ${...} string
- extract_heredoc_dolbrace_string: new function, variant of
extract_dollar_brace_string, to process the WORD in ${PARAM OP WORD}
while expanding lines of here-document data. It's complicated by the
requirement to add to the result string as we go along, since we
need to change the contents of the input string with ansi expansion
or locale translation.
- string_extract_single_quoted: take a new third argument: ALLOWESC.
This allows backslash to escape an embedded single quote, needed by
extract_heredoc_dolbrace_string to process $'...'; changed callers
1/25
----
parse.y
- parse_matched_pair: ansi-expand $'...' in WORD for ${PARAM OP WORD}
and single-quote the result if dolbrace_state == DOLBRACE_QUOTE
(posix pattern removal operators) even if extended_quote == 0
subst.c
- extract_heredoc_dolbrace_string: add logic to align with parse.y:
parse_matched_pair and its $'...' expansion, including handling
extended_quote
1/27
----
builtins/evalstring.c
- should_optimize_fork: broke conditions for optimizing away the fork
for a simple command out of optimize_fork into new function, call
from should_suppress_fork and optimize_subshell_command. Call from
optimize_fork if (subshell_environment & SUBSHELL_PAREN), relying
on fact that CMD_TRY_OPTIMIZING is only set in a couple of specific
conditions
- optimize_fork: call should_suppress_fork only if startup_state == 2;
it does the extra checks for that specific case
- optimize_fork: call should_optimize_fork if we're in a (list)
subshell (subshell_environment & SUBSHELL_PAREN)
- optimize_subshell_command: set CMD_TRY_OPTIMIZING on the right side
of a `&&', `||', or `;' list as long as it's a simple command so
we can check with optimize_fork() when it's time to execute it
execute_cmd.c
- execute_in_subshell: call optimize_subshell_command for (list)
subshells to either set CMD_NO_FORK for simple commands or set
CMD_TRY_OPTIMIZING for likely candidates for later optimization
builtins/common.h,builtins/evalstring.c
- optimize_fork: renamed to optimize_connection_fork; changed callers
1/31
----
include/shmbutil.h
- COPY_CHAR_I,SCOPY_CHAR_I: add check for locale_utf8locale and
(c & 0x80) as in other macros
lib/sh/shquote.c
- sh_backslash_quote_for_double_quotes: rewrote to use array indexing
and COPY_CHAR_I to make it easier to drop in future calls to
charvis() to make `unsafe' characters visible if FLAGS == 1
2/1
---
parse.y
- parse_comsub: if we are currently expanding aliases, temporarily
turn off alias expansion if we are not in posix mode so we defer
alias expansion until command_substitute(). Fixes double-expansion
bug reported by Martijn Dekker <martijn@inlv.org> and aligns with
https://www.austingroupbugs.net/view.php?id=1342
- xparse_dolparen: turn off alias expansion entirely while running the
parser: either we do it in parse_comsub (posix mode) or in
command_substitute (default mode)
- parse_string_to_command: ditto
subst.c
- command_substitute: if we are expanding aliases, temporarily turn
off alias expansion if we are in posix mode, since we already
performed it in parse_comsub() and are using the command string
reconstituted from the parse result
doc/bashref.texi
- bash posix mode: add description of alias expansion and command
substitution parsing and execution
2/4
---
lib/readline/rltty.c
- rl_deprep_terminal: set _rl_last_c_pos to 0 after outputting
BRACK_PASTE_FINI, since the last character in that is \r. Partially
address issue raised by Markus Schwarzenberg <markus.schwarzenberg@freenet.de>
in https://lists.gnu.org/archive/html/bug-bash/2022-02/msg00056.html
2/5
---
doc/{bash.1,bashref.texi}
- minor typo fixes from Helge Kreutzmann <debian@helgefjell.de>
2/7
---
{arrayfunc,variables}.c
- ARRAY_EXPORT: changes to encode array and assoc variables using a
scheme similar to shell functions so we can export arrays and
differentiate them from scalar variables and differentiate array
and assoc variables. Still not enabled by default.
variables.c
- mk_env_string: third argument is now the variable's attributes or 0,
with all the attributes we can export arrays
lib/readline/bind.c
- active-region-start-color,active-region-end-color: new bindable
string variables, one to set the active region color (instead of
standout mode) and one to turn it off (instead of the "se" terminal
capability). They set _rl_active_region_start_color and
_rl_active_region_end_color variables via functions
lib/readline/display.c
- putc_face: if setting standout mode, check for both the start color
and end color variables and output the start color string. If turning
off standout mode (normal face), output the end color string. Both
variables must be set
lib/readline/{readline.c,rlprivate.h}
- declarations for _rl_active_region_start_color and
_rl_active_region_end_color
2/8
---
bashline.c
- initialize_readline: add bindable name `vi-edit-and-execute-command'
shell.c
- subshell_exit: make sure to set last_command_exit_value before
calling the exit trap. Fixes bug reported by Greg Edwards
<gedwards@ddn.com>
2/9
---
lib/readline/{terminal.c,rlprivate.h}
- _rl_region_color_on,_rl_region_color_off: functions to output the
_rl_active_region_start_color and _rl_active_region_end_color
- _rl_reset_region_color: function to encapsulate setting the region
color to an arbitrary string, including doing memory management
lib/readline/display.c
- putc_face: call _rl_region_color_on and _rl_region_color_off instead
of _rl_standout_on and _rl_standout_off
lib/readline/terminal.c
- _rl_init_terminal_io: initialize _rl_active_region_start_color and
_rl_active_region_end_color from _rl_term_so and _rl_term_se,
respectively; reset every time the terminal is changed
- _rl_init_terminal_io: turn off the active region for a dumb terminal
lib/readline/bind.c
- sv_region_{start,end}_color: call _rl_reset_region_color with the
appropriate value for WHICH
2/10
----
lib/readline/doc/{rluser.texi,readline.3},doc/bash.1
- active-region-start-color,active-region-end-color: documented new
bindable readline variables
- enable-active-region: document using active-region-start-color to
highlight the text in the region
2/11
----
parse.y
- read_token,read_token_word: make sure characters read by shell_getc
are protected by appropriate calls to MBTEST when testing for shell
metacharacters and operators
2/14
----
builtins/shopt.def
- set_compatibility_level: if the current compatibility level is outside
the range of the compatNN options, just leave it alone when
unsetting one of the options (which by definition was already
unset). Fixes issue reported by Mihai Moldovan <ionic@ionic.de>
2/16
----
lib/readline/search.c
- rl_history_search_{pos,len,flags}: rename to have a leading `_'
- _rl_history_search_pos: no longer static so other parts of readline
can see it
lib/readline/rlprivate.h
- _rl_history_search_pos: extern declaration
lib/readline/readline.c
- readline_internal_teardown: don't run the undo list against the
current history entry if the non-incremental search functions have
set _rl_history_search_pos to it, since it doesn't reflect the
current contents of the line buffer. Fixes issue reported by
Andreas Schwab <schwab@linux-m68k.org>
lib/readline/misc.c
- _rl_start_using_history: initialize _rl_history_search_pos to
something invalid so it doesn't match where_history()
2/17
----
lib/readline/callback.c
- rl_callback_read_char: make sure _rl_eof_found is set to the value
of eof before calling the deprep terminal function, so it can do
different things based on whether the input code read EOF (or the
user entered the EOF character). From a gdb discussion started by
Andrew Burgess <aburgess@redhat.com> (still more to do, since this
is not part of the public API)
2/18
----
lib/readline/readline.h
- RL_STATE_EOF: new readline state value; set when readline reads an
EOF character on an empty line or a read returns an error
- rl_eof_found: new public variable
lib/readline/rprivate.h
- _rl_eof_found: renamed to rl_eof_found, so not declared here
lib/readline/{callback,readline}.c
- RL_STATE_EOF: set appropriately when readline gets an EOF. Suggested
by Andrew Burgess <aburgess@redhat.com>
- RL_STATE_EOF: make sure it's not set when readline starts
- rl_eof_found: set appropriately when readline gets an EOF
lib/readline/{callback,readline,rltty}.c
- rl_eof_found: new name for _rl_eof_found
lib/readline/doc/rltech.texi
- RL_STATE_EOF: document
2/19
----
parse.y
- parse_comsub: turn off parser state flags we don't want to inherit
into this call to the parser (PST_REGEXP, PST_EXTPAT, PST_CONDCMD,
PST_CONDEXPR for now). Fixes bug reported by konsolebox
<konsolebox@gmail.com>
2/23
----
findcmd.c,builtins/hash.def
- replace calls to is_directory with file_isdir, which only performs a
stat and doesn't do the eaccess call to check for an executable file
findcmd.c
- find_in_path_element: takes a new RFLAGSP argument, an int * where
the status flags for the returned pathname are returned; saves
additional calls to stat/eaccess
- search_for_command: get the returned flags from
find_user_command_in_path so we don't need any additional calls to
file_status after we find the command in $PATH
2/24
----
doc/{bash.1,bashref.texi}
- FUNCTIONS: some small changes to the description of local variables
and dynamic scoping, with emphasis on how that affects `unset'
behavior. Inspired by a discussion with
Christoph Anton Mitterer <calestyo@scientia.net>
2/25
----
examples/loadables/realpath.c
- renamed -s option to -q to align with other versions
- perform array assignment for `-a varname' even if -q option supplied
- renamed -S option to -s for Linux compatibility
2/28
----
lib/readline/misc.c
- _rl_free_saved_history_line: call rl_free_undo_list, saving and
setting rl_undo_list to the saved history line's data, so the right
call to _hs_replace_history_data happens and we don't end up with
a pointer aliasing problem. Fixes core dump reported by
Andreas Schwab <schwab@linux-m68k.org>, but does not make his
scenario equivalent to incremental search
3/1
---
lib/readline/search.c
- make_history_line_current: save the current line before replacing it
with the found history entry using rl_maybe_save_line
- noninc_dosearch: we don't want the saved history line, so free it
after calling make_history_line_current
- _rl_history_search_internal: call rl_maybe_replace_line after making
changes to the line buffer with make_history_line_current so we can
save the undo list we constructed before we set the history position
3/2
---
lib/readline/display.c
- expand_prompt: add missing piece to patch from 10/26/2021: if we are
recalculating the number of invisible characters on the first line
of the prompt, we need to update INVFL, even if we already set it
when we hit the number of physical characters. This ends up being
assigned to prompt_invis_chars_first_line, and is used in several
subsequent calculations. Reported by
Andreas Schwab <schwab@linux-m68k.org>
lib/readline/doc/{readline.3,rluser.texi},doc/bash.1
- enable-bracketed-paste: add some language making it clearer that
bracketed paste prevents the pasted text from being interpreted as
editing commands. Suggested by Karl O. Pinc <kop@karlpinc.com>
3/4
---
make_cmd.c
- make_here_document: perform quote removal on the here-doc delimiter
only if it's marked as quoted, which prevents quotes from inside a
command substitution from being removed (they're supposed to begin a
new quoting context) when the word itself isn't flagged as quoted
(which means the body of the here-document gets expanded). You can't
perform quote removal *and* expand the here-document lines. From an
austin-group discussion back in early February
lib/sh/strvis.c
- charvis -> sh_charvis; change caller
- sh_charvis: now take an additional SLEN argument to avoid having to
compute the string length every time; change callers
- sh_charvis: add a utf-8 locale-specific check before calling
COPY_CHAR_I (in practice, doesn't make any real difference)
3/10
----
arrayfunc.c
- convert_var_to_array: if we're being asked to create an associative
array (flags & 2), and we have an existing variable that is not an
assoc array (and not an existing indexed array), call
convert_var_to_assoc to make it one
3/11
----
jobs.c
- wait_for: don't call get_tty_state() if readline is dispatching
(RL_STATE_DISPATCHING) with the terminal settings changed
(RL_STATE_TERMPREPPED), the same way we don't if we are running a
command for programmable completion. Fixes bug with SIGINT reverting
to the saved readline terminal settings reported by
Markus Napierkowski <markus.napierkowski@cyberus-technology.de>
parse.y
- decode_prompt_string: make sure the expansion of \w, \W, and \s
are all run through sh_strvis before calling
sh_backslash_quote_for_double_quotes or just through sh_strvis if
we're not running the prompt string through word expansions.
Fixes issue reported by Josh Harcome <joshharc@gmail.com> back
in mid-January
3/16
----
bashline.c
- bash_quote_filename: if we have a word to complete that contains
characters that introduce a word expansion, make sure the passed
string does *not* exist as a filename before removing those
characters from the set that must be backslash-quoted. See change
from 1/1/2022
3/18
----
lib/readline/search.c
- make_history_line_current: don't free rl_undo_list or
_rl_saved_line_for_history; don't unconditionally save the history
line. This reverts some of the changes to support setting the
history position in history-search-backward
- rl_history_search_internal: only free the saved history line if we
were the ones who created it
3/21
----
lib/readline/nls.c
- xmalloc.h: include for systems without setlocale(), so xfree has a
prototype. Report and fix from András Kucsma <r0maikx02b@gmail.com>
lib/readline/search.c
- _rl_history_search_internal: use previous-history/next-history to
move to the found history line instead of directly calling
history_set_pos. This makes the behavior more similar to incremental
search
- rl_history_search_internal: make sure to set rl_undo_list to the
current history undo list around the calls to rl_get_previous_history
or rl_get_next_history, in order to fool the call to
maybe_replace_line they make
lib/readline/readline.c
- _rl_executing_func: the currently-executing readline command function
lib/readline/rlprivate.h
- _rl_executing_func: extern declaration
lib/readline/search.c
- _rl_history_search_internal: removed (commented out) code that sets
the current history entry to the found history entry, too much
assumes that the current undo list should be applied to the current
history entry (where_history())
3/23
----
subst.c
- parameter_brace_expand_word: if we have double-quoted ${*} or ${@},
make sure we are setting W_HASQUOTEDNULL in the flags we return to
the caller if we are returning QUOTED_NULL(word)
- parameter_brace_expand_word: if we have a double-quoted associative
array reference using `*' or `@', make sure we are setting
W_HASQUOTEDNULL in the flags we return to the caller if we are
returning QUOTED_NULL(word)
- parameter_brace_expand: if we're using the `[:]+' word expansion
operator, we need to note a quoted null string and pass the
W_QUOTEDNULL flag back to the caller
- expand_word_internal: make sure to return a QUOTED_NULL
(word[0] == CTLNUL) back to the caller if HAD_QUOTED_NULL is set,
regardless of whether or not we see a quoted dollar at. Fix for bug
reported by Andreas Luik <andreas.luik@innovative-navigation.de>
arrayfunc.c
- array_value_internal: fix typo and set estatep->type to ARRAY_INDEXED
for indexed arrays
3/31
----
lib/readline/{history.c,histlib.h}
- _hs_at_end_of_history: convenience function to tell whether or not
the current history position is at the end of the history list
4/1
---
lib/readline/search.c
- make_history_line_current: don't free rl_undo_list if it is equal to
_rl_saved_line_for_history->data, since we will need to restore it
later if we got it from a history entry. Fixes issue dating back to
7/2021 and changes to _rl_free_saved_line_for_history, current issue
reported by Andreas Schwab <schwab@linux-m68k.org>
4/5
---
lib/readline/{complete,histfile,histsearch,isearch,terminal}.c
- xfree: use instead of free
4/7
---
configure.ac
- bumped version to bash-5.2-beta
[bash-5.2-beta frozen]
4/8
---
lib/readline/input.c
- _rl_orig_sigset: need extern declaration if HAVE_SELECT is defined.
From https://savannah.gnu.org/support/?110634
examples/loadables/seq.c
- PRIdMAX: redefine if PRI_MACROS_BROKEN is defined.
From https://savannah.gnu.org/support/index.php?110635
4/11
----
configure.ac
- BASH_FUNC_STRTOIMAX: replace strtoimax if the system doesn't provide
a declaration in a standard header file. Uses new m4/strtoimax.m4.
From https://savannah.gnu.org/support/index.php?110633
builtins/printf.def
- getdouble: new function, parses string into `double' using strtod
- printf_builtin: check for the `L' length modifier and use long
doubles for the floating point conversion specifiers. If it's not
supplied, use `double' when in posix mode (as posix specifies) and
long double (if it's available, double if not) in default mode.
From a report from Paul Eggert <eggert@cs.ucla.edu>
4/12
----
lib/sh/oslib.c
- bzero: update function signature to modern BSD version
4/14
----
lib/sh/oslib.c
- bcopy, gethostname, mkfifo: update function signatures to modern
versions
4/15
----
jobs.c,nojobs.c
- wait_for_single_pid: if the pid or job argument is invalid -- isn't
a child of this shell -- return 257, which is out of the range of
valid 8-bit status values
execute_cmd.c
- execute_pipeline: if wait_for_single_pid returns > 256, set it to
127 (invalid process)
jobs.c
- wait_for_background_pids: if wait_for_single_pid returns > 256, set
the status we return in PS to 127 (what it was before)
builtins/wait.def
- wait_builtin: if wait_for_single_pid returns > 256, treat it as an
error and set pstat.pid to NO_PID
- wait_builtin: if -p supplied, and we get to the end of the argument
list with PSTAT.PID != NO_PID (which we assume means that the return
value is set from PSTAT.STATUS), set the variable name to PSTAT.PID.
From a report by Robert Elz <kre@munnari.OZ.AU>
- wait_builtin: for compatibility with the netbsd sh, leave the variable
name specified with `-p' unset if there are no PID arguments.
From a report by Robert Elz <kre@munnari.OZ.AU>
4/17
----
parse.y
- xparse_dolparen: if (flags & SX_NOLONGJMP), don't call
jump_to_top_level() on errors
bashline.c
- bash_quote_filename: don't call quote_word_break_chars() unless we
have word break chars initialized. Fixes bug reported by
Sam James <sam@gentoo.org>
4/18
----
pcomplete.c
- gen_globpat_matches: call glob_filename with the GX_GLOBSTAR flag if
the `globstar' shell option is enabled. From a report by
Steve <bash@lonetwin.net>
lib/malloc/malloc.c
- internal_free: remove the GLIBC21 code (!)
- internal_free: make the code that tests against memtop and calls
lesscore depend on USE_LESSCORE being defined, which it is by
default
lib/malloc/imalloc.h
- USE_LESSCORE: define
parse.y,shell.h
- token_buffer_size and its corresponding saved value in the shell's
parser state are now size_t instead of int
stringlib.c
- strsub,strcreplace: use size_t instead of int for local length and
indexing variables
lib/sh/zmapfd.c
- zmapfd: use size_t instead of int for local length and indexing
variables
lib/sh/zgetline.c
- zgetline: use size_t instead of int for local length and indexing
variables
4/20
----
pcomplete.c
- init_itemlist_from_varlist: free VLIST after assigning it from
*SVFUNC and after we get the variable names and values out of it.
Report from Robert E. Griffith <bobg@junga.com>
4/25
----
redir.c
- here_document_to_fd: if the shell compatibility level is bash-5.0 or
earlier, use tempfiles for all here-documents and here-strings. From
a bug-bash discussion started by Sam Liddicott <sam@liddicott.com>
4/26
----
parse.y
- parse_comsub: non-interactive shells exit on a syntax error while
parsing the command substitution
- parse_comsub: unset additional PARSER_STATE flags before calling
yyparse(). Inspired by https://bugs.gentoo.org/837203; unsetting
PST_COMPASSIGN is the fix for that bug
- parse_string_to_word_list: use save_parser_state/restore_parser_state
instead of saving pieces of the shell state in individual variables
- parse_compound_assignment: use save_parser_state/restore_parser_state
instead of saving pieces of the shell state in individual variables
- parse_compound_assignment: unset additional PARSER_STATE flags before
calling read_token(); set esacs_needed_count and expecting_in_token
to 0 like in parse_comsub() since read_token can use them
4/27
----
lib/sh/strvis.c
- sh_charvis: changes to handle being compiled without multibyte support
4/29
----
lib/readline/callback.c
- rl_callback_read_char: don't set rl_eof_found unless eof is > 0,
since it can be -3 if we need to read more input in a multi-key
sequence. Report from Andrew Burgess <aburgess@redhat.com>
examples/loadables/Makefile.sample.in
- new file, containing the rules to build the example shared object
- includes Makefile.inc from wherever it's installed. Suggested by
Robert E. Griffith <bobg@junga.com>
examples/loadables/Makefile.inc.in
- remove rules that create the example shared object
4/30
----
builtins/evalstring.c
- parse_and_execute: check for terminating signals before returning,
after any longjmp, to improve responsiveness and fix the -c code
path before running any exit trap. Report from
Emanuele Torre <torreemanuele6@gmail.com>
5/17
----
builtins/suspend.def
- suspend_builtin: the -f option now forces a suspend even if job
control is not enabled. Inspired by a discussion with
Robert Elz <kre@munnari.OZ.AU>
doc/{bash.1,bashref.texi}
- suspend: updated description to include expanded -f behavior
5/25
----
builtins/mkbuiltins.c
- -includefile: new argument, specifies extern filename to insert
into the #include statement in the structfile (builtins.c) and
the filename in the comment in the extern file (builtext.h).
From Alexander Kanavin <alex.kanavin@gmail.com> via
https://savannah.gnu.org/patch/?10210
builtins/Makefile.in
- builtins.c: change call to mkbuiltins to add -includefile option
- builtins.c: change recipe to run all the commands in the same shell
invocation
- builtins.c: change recipe to specify new filenames in the call to
mkbuiltins and move them onto builtins.c/builtext.h if the new ones
are different; make the new filenames use the current make recipe
shell pid in the filename ($$RECPID).
Inspired by Alexander Kanavin <alex.kanavin@gmail.com> via
https://savannah.gnu.org/patch/?10210
6/2
---
builtins/common.c
- builtin_find_indexed_array: new function, factored common code out
of mapfile and read builtins to find an in-scope indexed array or
create one
builtins/common.h
- builtin_find_indexed_array: extern declaration
builtins/{mapfile,read}.def
- change callers to use builtin_find_indexed_array
variables.c
- unbind_global_variable, unbind_global_variable_noref: new functions
that remove variables from the global_variables table
lib/sh/shmatch.c
- sh_regmatch: use unbind_global_variable_noref to make sure we act on
the copy of BASH_REMATCH in the global scope all the time, ignoring
any local variables that might exist. Tentative fix for memory leak
report from Emanuele Torre <torreemanuele6@gmail.com>
doc/{bash.1,bashref.texi}
- BASH_REMATCH: add caveat about making it a local variable
6/6
---
print_cmd.c
- print_redirection: if the redirectee for r_duplicating_output_word
(r_duplicating_input_word) is 1 (0), don't print it; only print a
non-default file descriptor number
- print_redirection_list: remove the code that tries to temporarily
translate a >&word redirection to >&word now that we won't print a
non-default file descriptor number. Fixes issue with `declare -f' and
function export reported by Namikaze Minato <lloydsensei@gmail.com>
6/13
----
configure.ac
- bumped version to bash-5.2-rc1
[bash-5.2-rc1 released]
6/15
----
parse.y
- parse_string_to_word_list: save the parser state before any state-
changing functions like bash_history_disable(). Reported by
Clark Wang <dearvoid@gmail.com>
6/16
----
doc/bash.1
- play tricks with the value of the zZ number register to refer to
`bash(1)' instead of `above' or `below' when creating the builtins
man page
6/17
----
doc/{bash.1,bashref.texi}
- wait: note that wait will return > 128 if interrupted by a signal.
Reported by AA <aathan_github@memeplex.com>
execute_cmd.c
- {execute_cond_node,execute_arith_command,eval_arith_for_expr}: make
sure to reset this_command_name after running any DEBUG trap so the
DEBUG trap doesn't overwrite it.
Reported by Emanuele Torre <torreemanuele6@gmail.com>.
- execute_select_command: set this_command_name to NULL after running
any DEBUG trap like execute_for_command does
6/23
----
test.c
- three_arguments: when given [ ! ! arg ], make sure to advance POS
after calling two_arguments to avoid a `too many arguments' error.
Report from Steffen Nurpmeso <steffen@sdaoden.eu>
6/27
----
subst.c
- expand_word_internal: when expanding backquoted command substitution,
call string_extract with the SX_REQMATCH flag (closing backquote
required) only if the word flags don't contain W_COMPLETE,
indicating that we're doing this for completion, probably to
determine whether or not to append something to the word. Fixes bug
reported by Emanuele Torre <torreemanuele6@gmail.com>.
7/5
---
execute_cmd.c
- execute_connection: treat a connector of '\n' the same as ';'
print_cmd.c
- print_comsub: new function, sets flag noting we are printing a
command substitution and calls make_command_string
- make_command_string_internal: add '\n' to the ';' case; print command
list with newline connector appropriately
parse.y
- parse_comsub: call print_comsub instead of make_command_string
- list1 production (part of compound_list): if a list is separated by
newlines, and the parser is parsing a command substitution, make
the connection command with a '\n' connector. Makes the text
output of parse_comsub closer to the original source text. From a
report from Martijn Dekker <martijn@inlv.org>
7/6
---
doc/bash.1,lib/readline/doc/rluser.texi
- complete: add note about arguments passed to command specified by
`complete -C'; suggested by Mark Chandler <mcp@synq.so>
builtins/setattr.def
- show_local_var_attributes: special-case `local -', since there is
no `declare -' equivalent.
Reported by Emanuele Torre <torreemanuele6@gmail.com>.
- show_all_var_attributes: use `local -' when printing a variable named
`-' at the current non-zero variable context
parse.y
- shell_getc: if we are at the end of an alias, returning a space,
make sure we mark the previous character as single-byte by modifying
shell_input_line_property so the space we return is properly
recognized. This would fail before if the last character of the
alias was a multi-byte character. Reported by
Vangelis Natsios <vnatsios@gmail.com>
7/12
----
lib/readline/isearch.c
- rl_display_search: don't call rl_redisplay_function before returning;
rl_message already calls it. Reported by
Frédéric Moulins <frederic@moulins.org>
configure.ac
- bumped version to bash-5.2-rc2
7/18
----
jobs.c
- set_job_control: don't bother calling tcgetpgrp if shell_tty < 0,
since it will just fail
variables.c
- reset_local_contexts: new function, delete all context tables
associated with shell functions and set variable_context to 0.
Called when we want to stop executing in a shell function without
going through the pop_context chain with its side effects
variables.h
- reset_local_contexts: extern declaration
builtins/evalstring.c
- parse_and_execute: call reset_local_contexts instead of setting
variable_context to 0
eval.c
- reader_loop: call reset_local_contexts in cases where the shell has
longjmped for a fatal error and errexit is enabled (ERREXIT), but
not for other cases, and especially not for the exit builtin,
instead of just setting variable_context to 0. Fixes issue originally
reported by Robert Stoll <robert.stoll@tegonal.com>
subst.c
- pat_subst: implement sed-like behavior when presented with a null
pattern that's anchored at the start or end of the string, or when
presented with a null string: process the replacement string for `&'
and `\&' and substitute in the result as before. Patch from
Koichi Murase <myoga.murase@gmail.com>
7/20
----
[bash-5.2-rc2 frozen]
7/27
----
parse.y
- reset_parser: set need_here_doc, esacs_needed_count, expecting_in_token
all to 0, since jumping back to a top-level parse needs that
- parse_comsub: make sure to reset expand_aliases and shell_eof_token
if we're not going to exit immediately out of this function
7/28
----
parse.y
- parse_comsub: if the compatibility level is <= 51, set extglob while
parsing the command substitution, so bad pattern errors can still be
caught but valid patterns are let through and can be evaluated at
runtime, when extglob may have been set. If it isn't set, it will
still be a parser error when the command substitution is executed.
Fixes report from Sam James <sam@gentoo.org> about gentoo scripts.
- reset_parser: set extended_glob from global_extglob if the parser
state includes PST_CMDSUBST
- xparse_dolparen: set global_extglob but don't modify extended_glob,
so parse errors can be caught before forking a child for command
substitution, as part of word expansion, but after extglob may have
been set by command execution (e.g., in a shell function)
8/5
---
[bump version to bash-5.2-rc3]
8/6
---
trap.c
- run_pending_traps: move code from evalstring() so we call
parse_and_execute() directly and handle any `return' invocations so
we can restore the value of running_trap. Otherwise, if we longjmp
past this function, we will think we're running a trap after we
finish. Prompted by post from Koichi Murase <myoga.murase@gmail.com>
8/9
---
lib/readline/nls.c
- _rl_current_locale: private variable, stores the value of the
LC_CTYPE locale category, as determined by _rl_init_locale; set
to allocated memory in _rl_init_locale()
- _rl_set_localevars: new function, code from _rl_init_eightbit that
checks the current locale (passed as an argument) and sets the
various locale-aware variables based on it. It accepts a second
argument: FORCE. If non-zero, it means to restore the default "C"
locale values if the locale is "C" or "POSIX", now that this
function can be called multiple times
- _rl_init_eightbit: now just calls _rl_init_locale and
_rl_set_localevars
- _rl_reset_locale: new function, checks whether our the locale has
changed since we last called _rl_init_locale to set our internal
idea of its value. If it has changed, call _rl_set_localevars with
the new locale and a FORCE argument of 1 to change the
locale-dependent variables.
lib/readline/rlprivate.h
- _rl_reset_locale: extern declaration
lib/readline/readline.c
- rl_initialize: call _rl_reset_locale instead of _rl_init_locale so
the internal readline variables get set when we move from a non-
multibyte locale ("C") to a multibyte one ("en_US.UTF-8"). Report
from Alan Coopersmith <alan.coopersmith@oracle.com>
8/16
----
lib/sh/setlinebuf.c
- sh_setlinebuf: allocate buffers for line-buffering stdout and stderr
only once, the first time it is requested. Only allocate memory if
we're using setvbuf (we usually are). Double the buffer size to 2016
if we're using the bash malloc. Otherwise, let stdio handle it.
8/17
----
builtins/exec.def
- exec_builtin: make sure to initialize orig_job_control in case the
command is not found by search_for_command. Report and fix from
Xiami <i@f2light.com>
[bash-5.2-rc3 frozen]
8/27
----
parse.y
- parse_comsub: restore extended_glob to a local copy (local_extglob)
only if we changed it; a safer way to do it. Fixes extglob change
issue reported by Kerin Millar <kfm@plushkava.net>
- cond_term: restore extended_glob to a local copy; safer than using
global_extglob, which we will reserve for error recovery
8/30
----
parse.y
- parse_comsub: don't clear the pushed string list; we might need it to
consume additional input to satisfy this command substitution. When
we restore the parser state, don't restore the pushed string list in
case we used it. From
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018727
- parse_comsub: don't modify extended_glob if parser_state includes
PST_EXTPAT, in which case we've already set extended_glob and
global_extglob appropriately. Only matters in compatibility mode.
8/31
----
subst.c
- parameter_brace_transform: make sure we return an error if *xform
is '\0'. Report from Ivan Kapranov <koltiradw@yandex.ru>
9/7
---
[bump version to bash-5.2-rc4]
9/8
---
[bash-5.2-rc4 frozen]
9/20
----
lib/readline/history.c
- replace_history_entry: check for a NULL timestamp before trying to
copy it. Report from nov.ondrej@gmail.com
9/23
----
[bash-5.2 frozen]
9/26
----
[bash-5.2 released]
9/27
----
mailcheck.c
- time_to_check_mail: don't bother if we're in the middle of readline
completion or command dispatching.
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019462
lib/readline/display.c
- rl_forced_update_display: use memset to clear out visible_line
instead of trying to use a loop; line_size is the size.
Report from <srobertson@peratonlabs.com>
print_cmd.c
- indirection_level_string: use MBRLEN and an initialized mbstate_t
object to avoid altering an internal mbstate_t.
From Koichi Murase <myoga.murase@gmail.com>
subst.c
- string_extract_verbatim: use an explicit mbstate_t object and pass
it to MBRLEN and mbrtowc to avoid altering the state that
ADVANCE_CHAR is using.
From Koichi Murase <myoga.murase@gmail.com>
- setifs: use an explicit mbstate_t object and pass it to MBRLEN so
to avoid altering an internal mbstate_t.
From Koichi Murase <myoga.murase@gmail.com>
builtins/printf.def
- asciicode: use an explicit mbstate_t object and pass it to mbrtowc
to avoid using an incorrect internal mbstate_t
From Koichi Murase <myoga.murase@gmail.com>
lib/sh/{mbscasecmp,mbscmp}.c
- mbscasecmp,mbscmp: use different mbstate_t objects for the different
strings so they don't affect each others' intermediate mbstate.
From Koichi Murase <myoga.murase@gmail.com>
9/28
----
execute_cmd.c
- execute_command_internal: if executing a (command) subshell, restore
the value of line_number from save_line_number before returning early
due to being a non-terminal pipeline element.
From https://savannah.gnu.org/support/index.php?110714
9/30
----
subst.c
- expand_array_subscript: make sure to pass a non-NULL first argument
to sh_backslash_quote. Report from Emanuele Torre <torreemanuele6@gmail.com>,
patch from Koichi Murase <myoga.murase@gmail.com>
9/30
----
jobs.c
- cleanup_dead_jobs: delete dead foreground jobs we won't notify the
user about (those not killed by a signal or killed by SIGINT/SIGPIPE).
From a report from Koichi Murase <myoga.murase@gmail.com>
- wait_for_any_job: never return a foreground job, even when requested
by pid, if it's in the jobs list
Report and fix from Koichi Murase <myoga.murase@gmail.com>
m4/strtoimax.m4
- BASH_FUNC_STRTOIMAX: fix logic inversion of result; we should be
replacing the function if the tests show we *don't* have a working
version. Report from Emanuel Haupt <ehaupt@FreeBSD.org>
10/4
----
lib/readline/nls.c
- _rl_init_locale: cope with setlocale returning NULL, make sure we
set up a default value for LC_CTYPE. Report from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
lib/readline/{input.c,rlprivate.h}
- fixes for compiling on w64-mingw32
10/5
----
parse.y
- xparse_dolparen: save and restore extended_glob using local_extglob
in the same way that parse_comsub does. Fixes compat issue reported in
https://bugs.gentoo.org/873931 and by Kerin Millar <kfm@plushkava.net>
10/6
----
subst.c
- extract_dollar_brace_string: keep a stack of dolbrace_state values
to handle nested expansions. Report from
Antoine <bug-bash@glitchimini.net>
10/7
----
builtins/{shopt.def,common.h}
- extglob_flag: new variable to hold the state of the `extglob' option;
initialized to EXTGLOB_DEFAULT like extended_glob
- shopt_set_extglob: new function to set extended_glob to the right
value for the rest of the shell
parse.y
- reset_parser: set extended_glob to extglob_flag, which is only
changed by shopt, remove global_extglob
- parse_comsub,parse_cond_command,xparse_dolparen: no longer use
global_extglob
execute_cmd.c
- execute_cond_node: reset extended_glob to the value of extglob_flag,
since we're executing a command here
10/8
----
parse.y
- save_dstart: when we set the value of function_dstart, save the old
value in save_dstart (read_token, read_token_word); restore it in
the grammar production after calling make_function_def. This gives
you correct line numbers for one level of function nesting.
Report from Daniel Castro <danicc097@gmail.com>
10/10
-----
execute_cmd.c
- shell_execve: rearrange code so that we check for a bad interpreter
before printing a generic ENOENT error message. Report from
Kirill Elagin <kirelagin@gmail.com>
10/12
-----
lib/readline/callback.c
- CALLBACK_READ_RETURN: add an inlined call to RL_CHECK_SIGNALS so we
can handle any signals that arrived before we restored the calling
application's signal handlers. From a gdb dicussion with
Simon Marchi <simon.marchi@polymtl.ca>
10/12
-----
variables.c
- pop_var_context: flag an internal error for shell_variables not
pointing to a function context only if we haven't already flushed
all the local contexts and reset variable_context. This can happen
if errexit is enabled and we're going to be exiting the shell, but
we're running unwind-protects on our way out. Report from
Xavier Delaruelle <xavier.delaruelle@gmail.com>
10/13
-----
sig.c
- kill_shell: broke the code that resets the signal disposition to the
default and sends a terminating signal to the shell into a separate
function
- termsig_handler: set handling_termsig to terminating_signal and make
it file-scope so other functions know we're handling a terminating
signal and are about to exit, and which signal it is (latter not used
yet)
- termsig_sighandler: if we get a fatal signal while we're handling a
fatal signal, kill ourselves with the second fatal signal immediately.
Fixes issue reported by Andreas Schwab <schwab@suse.de>
execute_cmd.c
- execute_case_command: call CHECK_TERMSIG after the call to strmatch,
since gmatch will return FNM_NOMATCH if there's a pending terminating
signal and we don't want incorrect results
subst.c
- pat_subst: make sure REP is non-NULL before calling savestring on it.
Report from Justin Wood (Callek) <callek@gmail.com>
10/14
-----
builtins/{shopt.def,common.h}
- expand_aliases: split into a variable that holds the current state
of alias expansion (expand_aliases) and a variable that reflects the
global option value (expalias_flag), make sure expand_aliases is set
appropriately by shopt
shell.c,execute_cmd.c,general.c
- expand_aliases: make sure expand_aliases and expalias_flag always
agree
parser.h
- PST_STRING: new parser flag, set when parsing a string to a command
or word list
parse.y
- reset_parser: if we're parsing a command substitution or a string,
and need to restore expand_aliases, make sure it's set to the value
of expalias_flag.
Fixes SIGINT during interactive command substitution parsing bug
reported by feng xiangjun <fengxj325@gmail.com>
- parse_string_to_word_list,parse_string_to_command: make sure to set
PST_STRING in parser_flags since we're resetting expand_aliases
10/17
-----
print_cmd.c
- print_function_def, named_function_string: if the function doesn't
have any here-documents, unset was_heredoc after printing the
closing brace so we can add a separator if there is another command
following the function definition. Fixes bug with multiple function
definitions and here-documents reported by D630 <d630@posteo.net>
- make_command_string_internal: if we're printing a command
substitution, make sure to preserve newlines in the comsub so we
avoid problems with re-parsing function defs or command substitutions
containing multiple compound commands that need to be separated
by newlines, but don't double them up
parse.y
- P_ARITH: new parse_matched_pair flags value; used to jump to
parse_comsub if we see a $( inside a $(( )), $[ ], or (( ))
- parse_matched_pair,parse_comsub,parse_arith_command,read_token_word:
make sure to call parse_matched_pair with P_ARITH if we're parsing
an arithmetic command or expansion
- parse_matched_pair: if we see $( inside a call with P_ARITH in the
flags argument, jump to parse_dollar_word and call parse_comsub to
parse it. The rest of the steps assume that parse_comsub has
expanded aliases (or not) appropriately. Fixes bug 2 from
https://bugzilla.redhat.com/show_bug.cgi?id=2134307
10/18
-----
builtins/evalstring.c
- parse_and_execute: we play tricks in the parser and in command_substitute
to turn expand_aliases on and off depending on the comsub parser
pass and whether or not we're in posix mode. Since this should only
matter for parsing, when we're processing a command substitution, we
set expand_aliases to the global flag value after parsing the
command and before executing it, and restore it if the global flag
value isn't changed during execution. Fixes bug 1 from
https://bugzilla.redhat.com/show_bug.cgi?id=2134307
command.h
- PF_BACKQUOTE: new flag value, only used by command_substitute to
differentiate between `` and $() forms. The former does not have
aliases expanded by parse_comsub in posix mode, so needs to expand
them in parse_and_execute like default mode
subst.c
- command_substitute: don't modify expand_aliases if PF_BACKQUOTE is
included in flags, since aliases haven't been expanded in the
command string (it was run through parse.y:parse_matched_pair())
- expand_word_internal: pass PF_BACKQUOTE to command_substitute() if
expanding a `` command substitution
10/20
-----
parse.y
- yylex: return YYUNDEF as current_token if read_token returns < 0.
Fixes parser reset issue reported by Todd Stein <toddbstein@gmail.com>
in https://savannah.gnu.org/support/index.php?110745
subst.c
- ARITH_EXP_CHARS: chars that are special and trigger expansion in
arithmetic expressions, EXP_CHARS without `<' and `>'. Fixes bug
reported by Glenn Jackman <glenn.jackman@gmail.com>
execute_cmd.c
- retain_fifos: replace executing_list (which is still present) as the
indicator of whether or not to save and restore the FIFO list around
a call to execute_command_internal/execute_command; it's more
descriptive and can be used elsewhere
- execute_for_command: set retain_fifos so we don't unlink the fifo
list until the for command completes. Fixes issue reported in
https://savannah.gnu.org/support/index.php?110743
lib/readline/xmalloc.c
- memory_error_and_abort: add `const' qualifiers to the argument. Fix
from Markus Elfring <Markus.Elfring@web.de>
10/24
-----
general.c
- check_binary_file: check the first two lines for NULs if the first
line begins with a `#!'; otherwise check the first. From a discussion
and patch in https://savannah.gnu.org/support/?110744
(larsh@apache.org)
parse.y
- parse_matched_pair: set PST_NOERROR if we read to EOF without finding
a closing match and call parser_error; avoids redundant error
message
lib/sh/uconvert.c
- uconvert: RETURN: if ipart (integer part) is 0, but upart (fractional
part) is non-zero, multiply upart by mult so we don't lose the sign
for values in the range (-1, 0]. From a report by
izabera <izaberina@gmail.com>
execute_cmd.c
- execute_in_subshell: check for terminating signals before we return
to our caller, which will immediately exit, and before running any
exit trap (since termsig_handler will run any exit trap). Fixes bug
reported by Andrew Neff <andrew.neff@visionsystemsinc.com>
10/26
-----
lib/readline/complete.c
- rl_filename_completion_function: if the application doesn't supply
any directory hook functions, we need to handle the case where we
dequoted users_dirname and also tilde-expanded dirname. We choose
to tilde expand users_dirname rather than call the application
dequoting function again. Report and patch from
Stefan H. Holek <stefan@epy.co.at>
10/27
-----
execute_cmd.c
- execute_in_subshell: call procsub_clear in addition to clear_fifo_list,
since none of these process substitutions are children of this new
subshell
jobs.c
- wait_for_background_pids: call procsub_waitpid on the last procsub
created as long as it's the same as $!, then call reap_procsubs to
clean up the procsub list. Don't call procsub_waitall. Report from
Oguz İsmail Uysal <oguzismailuysal@gmail.com>
10/31
-----
expr.c
- expr_streval: explicitly permit `@' and `*' as associative array
subscripts if the shell compatibility level is greater than 51.
Prompted by report from Corey Hickey <bugfood-ml@fatooh.org>
subst.c
- string_list_pos_params, param_expand: make sure that $* is treated
the same as "$*" in here-document bodies that are being expanded.
From https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00002.html
11/1
----
lib/readline/readline.c
- readline_internal_char: save and restore the value of _rl_top_level
around our use of setjmp, even though it doesn't matter in most
cases. Report from sparrowhawk996@gmail.com that it causes crashes
in some obscure callback-mode cases
lib/readline/isearch.c
- _rl_isearch_dispatch: if we end the search and stuff characters back
to be read again, decrement the current key sequence index by 2 so
we don't have duplicate characters in the sequence
lib/readline/misc.c
- rl_digit_argument: call _rl_del_executing_keyseq after rl_execute_next
11/3
----
builtins/setattr.def
- show_localname_attributes: special-case "-" local variable, since
there is no `declare -' equivalent.
Reported by Emanuele Torre <torreemanuele6@gmail.com>.
11/4
----
lib/sh/tmpfile.c
- sh_mktmpname,sh_mktmpfd: use get_urandom32() instead of random() if
we're not using mktemp or mkstemp and the system provides the
appropriate support
trap.c
- trap_variable_context: new variable, set to variable_context every
time a trap string runs (that is, every time running_trap is set to
a value > 0) in _run_trap_internal, run_exit_trap, run_pending_traps
trap.h
- trap_variable_context: extern declaration
builtins/common.c
- get_exitstat: if the `return' builtin is running, we are running a
trap (but not the DEBUG trap), and the return would cause the trap
string to complete (variable_context == trap_variable_context, so
we haven't executed another shell function), use the last command
exit value as the return status. POSIX interp 1602, from
https://www.austingroupbugs.net/view.php?id=1602
11/4
----
lib/readline/display.c
- local_prompt_invis_chars: new array variable, similar to
local_prompt_newlines, that keeps track of the number of invisible
characters on each line of the prompt string. Use in WRAP_OFFSET
macro with eye to using in W_OFFSET as well. Used for the case where
the last line of the prompt is not the last line with invisible
characters. Can use this in more calculations replacing wrap_offset
and prompt_invis_chars_first_line going forward. Inspired by report
from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018851
- update_line: use local_prompt_invis_chars to set _rl_last_c_pos
correctly when on a non-terminal prompt line that contains
invisible characters
11/7
----
subst.c
- get_var_and_type: allocate new memory for *valp and return it if the
type is VT_ARRAYMEMBER. The callers -- all of which treat this case
the same as VT_VARIABLE -- will free appropriately. Fixes problems
with using parameter operations like ## on dynamic array variables,
reported by Ivan Kapranov <koltiradw@yandex.ru> back on 8/31/2022
expr.c
- change some error messages to make it clearer these are arithmetic
syntax errors. These will require new translations.
test.c
- integer_expected_error: change the message to remove `expression',
since this is only called for the `test' builtin, where TEST_ARITHEXP
is not in FLAGS. This will require a new translation.
Reported by Emanuele Torre <torreemanuele6@gmail.com> back on
6/15/2022
11/10
-----
builtins/read.def
- reset_timeout: when a timer expires, make sure to cancel any
readline timeout as well with rl_clear_timeout().
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023776
11/11
-----
builtins/reserved.def
- !: add short help text
lib/readline/complete.c
- make_quoted_replacement: if readline found quote characters anywhere
in the filename, but is not completing on an unclosed quoted string,
and there is an application filename quoting function, let that
function quote the filename if necessary
bashline.c
- COMPLETE_DQUOTE2: new completion quoting style define
- bash_expand_filename: new function, runs a filename passed to it
through word expansion, suppressing command and process substitution
and returns the result (in new memory if it's different than the
filename argument)
- bash_quote_filename: if the return value from bash_check_expchar is
`$' or ``', expand the filename and if it contains characters that
should be quoted, set the quoting style to COMPLETE_DQUOTE2
- bash_quote_filename: if the completion quoting style is COMPLETE_DQUOTE2,
use sh_mkdoublequoted to put double quotes around the entire
unexpanded filename instead of using sh_double_quote, which will
backslash-quote any `$'. This is a start at preserving user-supplied
quotes if the (expanded) completed filename requires them. From
reports by Peng Yu <pengyu.ut@gmail.com> in 5/2020 and
Pedro Gimeno <pgba-da0a@personal.formauri.es> in 6/2021
11/14
-----
parse.y
- report_syntax_error: if word_top is set and we reach EOF, report the
starting line number in the error message. From a patch from
L A Walsh <bash@tlinx.org> and Manuel Reiter <manuel.reiter@dwd.de>
back in 9/2018
- MAX_CASE_NEST: doubled to 256, renamed to MAX_COMPOUND_NEST
- read_token_word: add `if', `while', and `until' to the set of
compound commands that use WORD_TOP and WORD_LINENO (with
corresponding changes to grammar productions)
- [grammar]: changed check to decrement WORD_TOP to >= 0 since we
start at -1 and we want to decrement back to -1 when all loops are
closed
builtins/jobs.def
- jobs_builtin: call notify_and_cleanup after displaying the status of
jobs to implement POSIX requirement that `jobs' remove terminated
jobs from the jobs list
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/jobs.html#tag_20_62
11/15
-----
lib/sh/input_avail.c
- include signal.h unconditionally, we need it for HAVE_SELECT and
HAVE_PSELECT
- nchars_avail: make sure we declare and use readfds and exceptfds if
we have pselect or select available
lib/readline/input.c
- rl_gather_tyi,rl_getc: need to declare and use readfds and exceptfds
if HAVE_PSELECT or HAVE_SELECT is set. Report from
Henry Bent <henry.r.bent@gmail.com>, fixes from
Koichi Murase <myoga.murase@gmail.com>
11/16
-----
lib/sh/ufuncs.c
- quit.h: include unconditionally for declaration of sigemptyset even
if HAVE_SELECT is not defined
lib/sh/timers.c
- USEC_PER_SEC: make sure it's defined even if HAVE_SELECT is not
lib/glob/sm_loop.c
- BRACKMATCH: if an equivalence class does not match, and the next
character following the class is a `]', treat that as the end of
the bracket expression.
Report and fix from Koichi Murase <myoga.murase@gmail.com>
- GMATCH: if the current character in the string is a `/' and the
current element in the pattern is a bracket expresion, and the FLAGS
include FNM_PATHNAME, return FNM_NOMATCH immediately. A bracket
expression can never match a slash.
Report and fix from Koichi Murase <myoga.murase@gmail.com>
- BRACKMATCH: if we encounter a <slash> in a bracket expression, either
individually or as part of an equivalence class, nullify the bracket
expression and force the `[' to be matched as an ordinary
character
11/17
-----
lib/glob/sm_loop.c
- BRACKMATCH: if a slash character appears as the first character
after a non-matching character class or equivalence class, treat
the bracket as an ordinary character that must be matched literally
- BRACKMATCH: if a slash character appears as the second character
of a range expression, treat the bracket as an ordinary character
- BRACKMATCH: if a slash character appears in the portion of a
bracket expression that already matched, treat the bracket as an
ordinary character
Updates from Koichi Murase <myoga.murase@gmail.com>
- BRACKMATCH: if a range expression is incomplete (no end char),
treat the bracket as an ordinary character
11/18
-----
doc/bashref.texi
- Reporting Bugs: add mention of the Savannah project page. Suggested
by Loïc Yhuel <loic.yhuel@gmail.com>
11/20
-----
builtins/common.h
- SEVAL_NOOPTIMIZE: new flag for parse_and_execute: means don't try to
optimize forks out of any simple or conditional commands
builtins/evalstring.c
- parse_and_execute: if FLAGS includes SEVAL_NOOPTIMIZE, don't try to
call can_optimize_connection to optimize away forks from AND_AND or
OR_OR commands
builtins/eval.def,trap.c,parse.y,jobs.c
- parse_and_execute: include SEVAL_NOOPTIMIZE in any calls to
parse_and_execute. Fixes bug reported by
Frode Nordahl <frode.nordahl@canonical.com>
11/21
-----
lib/readline/readline.c
- readline_initialize_everything: use xmalloc to initialize
rl_executing_keyseq, since we use xrealloc to reallocate it and
don't check it for NULL anywhere
subst.c
- parameter_brace_expand_word: make sure to update *ESTATEP and pass
ES back to the caller even if array_value returns NULL. Fixes
memory leak referencing unset associative array elements reported
by Ralf Oehler <Ralf@Oehler-Privat.de>; fix from
Koichi Murase <myoga.murase@gmail.com>
11/22
-----
lib/glob/sm_loop.c
- BRACKMATCH: if a backslash appears before a slash in a bracket
expression, treat the whole thing as literal and try to match the
open bracket
- BRACKMATCH: if a bracket expression ends in an unquoted backslash,
try to match the left bracket literally and go on. More discussion with
Koichi Murase <myoga.murase@gmail.com>
execute_cmd.c
- execute_in_subshell: don't try to optimize away forks in the command
if the subshell command is being timed or its return value is being
inverted. Report from Dabrien 'Dabe' Murphy <dabe@dabe.com>
11/23
-----
lib/readline/complete.c
- __WIN32__: remove uses of this preprocessor symbol, use _WIN32
lib/readline/rldefs.h
- Don't define NEW_TTY_DRIVER on _WIN32. Fix from
sparrowhawk996@gmail.com
include/posixselect.h
- include "posixtime.h" instead of <sys/time.h> so the right guards
are present
builtins/read.def
- read_builtin_timeout: make sure we don't try to call shtimer_select
if HAVE_SELECT isn't define; it won't be compiled in
include/stdc.h
- restrict: make sure we have a definition if __STDC__ is not defined
include/posixtime.h,lib/sh/gettimeofday.c
- gettimeofday: make sure the function signature matches POSIX by
adding `restrict'
11/25
-----
include/posixselect.h
- don't try to define HAVE_SELECT at all if _WIN32 is defined
lib/readline/kill.c
- define WIN32_LEAN_AND_MEAN for the windows-specific paste function
lib/readline/rlprivate.h
- _rl_timeout_select: only include declaration if HAVE_SELECT or
HAVE_PSELECT are defined
11/28
-----
lib/readline/input.c
- rl_gather_tyi: call rl_input_available_hook after FIONREAD test,
let the application hook into whether or not there are characters
to read
execute_cmd.c
- execute_function: if the maximum function nesting level is exceeded,
run the unwind-protects before jumping back to top level. Report
from felix <felix@f-hauri.ch>
variables.c
- find_variable_nameref_for_create,find_variable_nameref_for_assignment:
handle find_variable_nameref returning &nameref_maxloop_value, return
NULL and print a warning message in that case
- find_variable_nameref: return &namref_maxloop_value instead of NULL
if the number of resolution cycles exceeds NAMEREF_MAX; change
callers to print a new error message in this case; no other change
in behavior. From a 4/2020 suggestion from Andrej Podzimek
<andrej@podzimek.org>
- find_variable_nameref_context, find_nameref_at_context,
find_variable_last_nameref_context: make sure to return
&nameref_maxloop_value consistently and handle getting it as a
return value from other functions
11/29
-----
lib/readline/display.c
- _rl_update_final: if there is only one line (_rl_vis_botlin == 0)
and that line is empty (botline_length == 0), assume there is no
prompt and the line has no contents, so output the CR/LF to indicate
that the newline has been read. From a report from
Kevin Pulo <kev@pulo.com.au>
11/30
-----
builtins/evalstring.c
- parse_and_execute: if we are executing the eval builtin, and the
return status from the command is suppressed (builtin_ignoring_errexit),
set CMD_IGNORE_RETURN in the parsed command's flags. From a report
from Tycho Kirchner <tychokirchner@mail.de>
12/1
----
lib/glob/sm_loop.c
- PARSE_SUBBRACKET: a reworked PARSE_COLLSYM, generalized to handle
[:, [=, and [. special bracket expressions
- BRACKMATCH: change to use PARSE_SUBBRACKET consistently to parse
[:, [=, and [. special bracket expressions
- PATSCAN: takes new FLAGS arg, changed all callers to just pass the
flags they get through to PATSCAN
- PATSCAN: call PARSE_SUBBRACKET for [:, [=, and [. to treat them
consistently (uses FLAGS argument here)
- PATSCAN: handle FNM_NOESCAPE appearing in FLAGS argument
This set of fixes contributed by Koichi Murase <myoga.murase@gmail.com>
lib/glob/{glob,gmisc}.c
- PATSCAN: change all callers to add extra flags arg of 0
doc/{bash.1,bashref.texi}
- trap description: replace ARG with ACTION
- clarify the language describing what trap without arguments and
trap -p without arguments display
- clarify that trap in non-interactive shells does not allow signals
that were ignored at shell start to be trapped; interactive shells
allow this
- trap: add missing command types to the description of when the
DEBUG trap is executed
builtins/trap.def
- LONG_DOC: replace ARG with ACTION
- make it clear that trap and trap -p without arguments display a
information about specified signals, but in a form that may be
reused as shell input
12/5
----
pcomplete.c
- compgen_compspec: new flag saying whether or not we're running via
the compgen builtin or via programmable completion: set to 0
every time gen_progcomp_completions runs, set to 1 in
gen_compspec_completions if this_shell_builtin == compgen_builtin
- gen_shell_function_completions: call rl_clear_signals and
rl_set_signals so the shell's signal handlers are active when
running shell functions to generate completions. We try to do it
only when programmable completion, not the compgen builtin, is active.
Idea from Koichi Murase <myoga.murase@gmail.com>, fixes bug
reported in 9/22
sig.c
- sigint_sighandler, termsig_sighandler: since these can now be called
during programmable completion, we need to set the readline signal
event hook if the readline state includes RL_STATE_DISPATCHING or
RL_STATE_COMPLETING, since we can't rely on RL_STATE_SIGHANDLER
being set and we want to call throw_to_top_level here
- throw_to_top_level: if the shell is interactive, before calling
bashline_reset (which zeroes rl_signal_event_hook), call
rl_cleanup_after_signal if we think readline hasn't called it
already
12/9
----
configure.ac
- add "LOCAL_LDFLAGS = -rdynamic" for freebsd/openbsd/netbsd. Reported
by Christian Weisgerber <naddy@mips.inka.de>
12/12
-----
subst.c
- parameter_brace_expand_length: handle namerefs with values that are
valid length expansion expressions but invalid identifiers. From
ed7-aspire4925@hotmail.com via https://savannah.gnu.org/support/?110799
12/13
-----
subst.c
- extract_heredoc_dolbrace_string: fix off-by-one error after calling
extract_command_subst and extract_process_subst that caused it to
copy one too many parsed characters. Fix for bug reported by
Norbert Lange <nolange79@gmail.com>
12/14
-----
execute_cmd.c
- execute_cond_node: if a regular expression fails to compile, print
an error message. Report from Emanuele Torre <torreemanuele6@gmail.com>
back on 6/15/2022
trap.c
- trap_variable_context -> trap_return_context, initialize from
funcnest + sourcenest instead of variable_context so we handle
shell function execution and `./source', both of which can use
`return'. Idea from Koichi Murase <myoga.murase@gmail.com>
builtins/common.c
- get_exitstat: compare trap_return_context against funcnest+sourcenest,
since that's how it's initialized now
lib/readline/readline.c
- readline_internal_charloop: if we're not using the callback interface,
don't restore _rl_top_level from olevel, since we will just be going
around the loop again and will potentially need to use it multiple
times. Report from Emanuele Torre <torreemanuele6@gmail.com>
12/15
-----
shell.h
- EX_UTILERROR: new generic special builtin return status to indicate a
POSIX utility error that should cause a non-interactive shell to abort
execute_cmd.c
- builtin_status: translate EX_UTILERROR to EXECUTION_FAILURE
builtins/set.def
- unset_builtin: return EX_UTILERROR if posix_utility_error is set;
set it when trying to unset a non-identifier (variable) or a
non-unsettable or readonly variable
12/16
-----
subst.c
- de_backslash: now takes a second argument with the current quoting
flags
- de_backslash: if the quoting flags include Q_HERE_DOCUMENT and the
shell is in posix mode, remove backslashes quoting double quotes
subst.h
- de_backslash: update extern declaration
lib/readline/histexpand.c
- history_expand_internal,get_history_word_specifier,get_subst_pattern,
hist_error,history_find_word,hist_string_extract_single_quoted:
now take const char * string arguments
lib/readline/mbutil.c
- _rl_get_char_len,_rl_adjust_point,_rl_find_next_mbchar_internal,
_rl_find_next_mbchar,_rl_find_prev_mbchar,_rl_find_prev_mbchar_internal,
_rl_test_nonzero,_rl_find_prev_utf8char,_rl_is_mbchar_matched,
_rl_compare_chars,_rl_char_value: take const char * string arguments
12/17
-----
builtins/umask.def
- parse_symbolic_umask: add missing POSIX pieces:
o `action' of ugo, meaning to copy portions of initial mask
o multiple `op' specs as part of the action string (`u=r-w')
(resets perm)
o missing perm characters Xst in action string
o default `who' equivalent to `a' instead of fixing up later
12/19
-----
builtins/type.def
- if -a and -P are both supplied, look in the command hash table but
continue and perform a $PATH search even if the NAME is hashed.
From a report by Adam Vodopjan <adam.vodopjan@gmail.com>
doc/{bash.1,bashref.texi}
- type: update description to fix it to what the code actually does
builtins/set.def
- set_edit_mode: don't run with_input_from_stdin or with_input_from_stream
unless command_execution_string is NULL. Report from
Harald van Dijk <harald@gigawatt.nl>
12/20
-----
braces.c
- array_concat: add a check for interrupts and terminating signals
into the inner loop
jobs.c
- without_job_control: set original_pgrp == NO_PID since we don't
want to be messing with the terminal pgrp if we call end_job_control.
From a report from ks1322 ks1322 <ks1322@gmail.com>
12/21
-----
include/{posixtime.h,systimes.h,shmbutil.h,shtty.h}
- PARAMS: remove
12/22
-----
builtins/evalfile.c
- _evalfile: add SEVAL_NOOPTIMIZE to the parse_and_execute flags
(maybe overkill, but safer). From a report by
Dan Church <h3xx@gmx.com> and Oguz <oguzismailuysal@gmail.com>
lib/sh/gettimeofday.c
- gettimeofday: added code for _WIN32 version
12/27
-----
doc/{bash.1,bashref.texi},builtins/printf.def
- specify the valid format characters as a subset of what printf(3)
specifies, note that the %n format specifier takes a variable name
as an argument. Suggestion from Emanuele Torre <torreemanuele6@gmail.com>
12/28
-----
{xmalloc,variables,unwind_prot,trap,test,subst,sig,siglist,shell,redir,
pcomplete,pathexp,make_cmd,mailcheck,jobs,input,hashcmd,hashlib,general,
flags,findcmd,externs,execute_cmd,error,dispose_cmd,command,bashline,
bashhist,assoc,arrayfunc,array,alias}.h
{version,version2}.c
- PARAMS: remove for ANSI C-ification
builtins/{getopt,common,bashgetopt}.h
builtins/{mkbuiltins,gen-helpfiles,psize,psize-posix}.c
builtins/{evalstring,bashgetopt,common,evalfile,getopt}.c
builtins{alias,bind,break,cd,command,complete,declare,enable,exit,fc,
fg_bg,getopts,hash,help,history,jobs,kill,mapfile,printf,pushd,read,set,
shopt,source,suspend,trap,type,ulimit,umask,wait}.def
- PARAMS: remove for ANSI C-ification
lib/malloc/{watch,table,shmalloc,mstats,imalloc}.h
lib/malloc/{malloc,stats,table,trace}.c
- PARAMS: remove for ANSI C-ification
lib/glob/{glob,strmatch}.h
lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
- PARAMS: remove for ANSI C-ification
lib/intl/{eval-plural,plural-exp,loadinfo,hash-string,gettextP}.h,
lib/intl{plural.y,plural.c},
lib/intl/{finddomain,bindtextdom,dcigettext,l10nflist,loadmsgcat,localealias,plural-exp}.c
- PARAMS: remove for ANSI C-ification
- STATIC -> static
- internal_function -> inline
lib/sh/{casemod,clock,eaccess,fnxform,fpurge,makepath,mktime,netopen,pathphys,random,shquote,snprintf,spell,strtod,strtoimax,strtoumax,times,timeval,tmpfile,unicode,winsize,zcatfd,zgetline,zmapfd}.c
- PARAMS: remove for ANSI C-ification
support/{bashversion.c,mkversion.sh,mksignames.c}
- PARAMS: remove for ANSI C-ification
lib/sh/{clock,strchrnul,getcwd,times,rename,inet_aton,strdup,strerror,strnlen
strpbrk,strtod,strtoimax,strtol,strtoumax,wcsdup,wcsnwidth,wcswidth,strcasecmp,
strcasestr}.c
- C89-style function declarations
lib/malloc/{alloca,malloc,stats,table,trace,xmalloc}.c
- C89-style function declarations
12/29
-----
lib/glob/{glob,glob_loop,gmisc,sm_loop,smatch,strmatch,xmbsrtowcs}.c
- C89-style function declarations
lib/sh/{zcatfd,zgetline,zmapfd,zread,zwrite,winsize,vprint,uconvert,ufuncs,
unicode,utf8}.c
lib/sh/{stringlist,stringvec,strtrans,strvis,timeval,tmpfile}.c
lib/sh/{setlinebuf,shmatch,shmbchar,shquote,shtty,snprintf,spell}.c
lib/sh/{random,pathcanon,pathphys,oslib,netconn,netopen}.c
lib/sh/{mailstat,makepath,mbscasecmp,mbschr,mbscmp,mktime}.c
lib/sh/{input_avail,itos,getenv,fmtulong,fnxform,eaccess,dprintf,casemod,clktck}.c
- C89-style function declarations
examples/loadables/{accept,asort,basename,bcat,cat,csv,cut,dirname,dsv}.c
examples/loadables/{fdflags,finfo,head,hello,id,lcut,ln}.c
examples/loadables/{mkdir,mkfifo,mktemp,mypid,necho,pathchk}.c
examples/loadables/{print,printenv,push,realpath,rm,rmdir,seq}.c
examples/loadables/{setpgid,stat,strftime,sync,tee,template,truefalse,tty}.c
examples/loadables/{uname,unlink,whoami}.c
- C89-style function declarations
xmalloc.c, array2.c, list.c, dispose_cmd.c, copy_cmd.c, bracecomp.c, mksyntax.c
- PARAMS: remove for ANSI C-ification
- C89-style function declarations
12/30
-----
hashlib.c,assoc.c,input.c,hashcmd.c,alias.c,alias.h,array.c,flags.c,pcomplib.c,
pcomplib.h,locale.c
variables.c,arrayfunc.c,bashhist.c,bashline.c,error.c,pathexp.c,nojobs.c,
stringlib.c,eval.c,findcmd.c,mailcheck.c,make_cmd.c,shell.c,print_cmd.c,
general.c,expr.c
- PARAMS: remove for ANSI C-ification
- C89-style function declarations
- add `const' and `inline' where it makes sense
12/31
-----
test.c,execute_cmd.c,parse.y,pcomplete.c,trap.c,subst.c,braces.c,jobs.c,sig.c
builtins/{evalstring.c,gen-helpfiles.c,mkbuiltins.c}
builtins/{alias.def,bind.def,break.def,builtin.def,caller.def,cd.def,colon.def}
builtins/{command.def,complete.def,declare.def,echo.def,enable.def,eval.def}
builtins/{exec.def,exit.def,fc.def,fg_bg.def,hash.def,help.def,history.def}
builtins/{jobs.def,kill.def,let.def,mapfile.def,printf.def,pushd.def,read.def}
builtins/{return.def,set.def,setattr.def,shift.def,shopt.def,source.def}
builtins/{suspend.def,test.def,times.def,trap.def,type.def,ulimit.def}
builtins/{umask.def,wait.def}
- PARAMS: remove for ANSI C-ification
- C89-style function declarations
- add `const' and `inline' where it makes sense
1/2/2023
--------
lib/sh/{stringvec.c,inet_aton.c,strnlen.c,spell.c,netopen.c,stringlist.c}
lib/sh/{strtrans.c,tmpfile.c,uconvert.c,zcatfd.c}
builtins/{common.c,common.h}
mailcheck.c,bashline.c,pathexp.c,stringlib.c,locale.c,pcomplete.c,redir.c
test.c,trap.c,variables.c,bashhist.c,expr.c,arrayfunc.c,assoc.c,variables.c
subst.c,findcmd.c
arrayfunc.h,variables.h,findcmd.h,bashline.h,trap.h,pathexp.h,externs.h,
pcomplete.h,bashhist.h,assoc.h,general.h,subst.h
- more `const' changes, remove `register'
1/3
---
parse.y
- more `const' changes, remove `register'
variables.h
- VARLIST: list_len and list_size now size_t
variables.c
- vlist_alloc: take size_t parameter, changed callers
- vlist_realloc: take size_t parameter, changed callers
lib/sh/stringvec.c,externs.h
- functions that take int size params now take size_t
- strvec_len: returns size_t
lib/sh/stringlist.c,externs.h
- STRINGLIST: list_size and list_len now size_t
- functions that take int size params now take size_t
variables.c,bashline.c,builtins/bind.def
- change strvec_ int parameters to size_t where it makes sense
- change strlist_ int parameters to size_t where it makes sense
builtins/shopt.def
- reset_shopt_options: set glob_always_skip_dot_and_dotdot to 1,
since that's the current default in lib/glob/glob.c
1/4
---
execute_cmd.c,parse.y,general.c,make_cmd.c,print_cmd.c,variables.c,expr.c
jobs.c,subst.c,input.c,unwind_prot.c,pathexp.c,pathexp.h,alias.c,bashline.c
bashhist.c,lib/sh/shquote.c,externs.h,stringlib.c,locale.c,findcmd.c
builtins/common.c,builtins/declare.def,builtins/enable.def,builtins/fc.def
lib/sh/zmapfd.c,builtins/help.def,builtins/mapfile.def,builtins/read.def
builtins/shopt.def,lib/glob/glob.c,lib/glob/smatch.c,lib/glob/sm_loop.c
lib/glob/xmbsrtowcs.c,lib/glob/gmisc.c,lib/glob/gm_loop.c
lib/sh/getenv.c,lib/sh/makepath.c,lib/sh/pathphys.c,lib/sh/tmpfile.c
lib/sh/stringlib.c,lib/sh/spell.c,lib/sh/strtrans.c,lib/sh/zgetline.c
lib/sh/mbscasecmp.c,lib/sh/utf8.c
lib/readline/readline.c,lib/readline/rlprivate.h,lib/readline/vi_mode.c
lib/readline/complete.c,lib/readline/bind.c,lib/readline/isearch.c
lib/readline/util.c,lib/readline/kill.c,lib/readline/macro.c
lib/readline/text.c,lib/readline/histexpand.c,lib/readline/histfile.c
lib/readline/mbutil.c,lib/tilde/tilde.c
- size_t changes
- remove some unused variables
- remove `register'
1/5
---
builtins/getopt.c
- sh_getopt_restore_state: make sure argv[sh_curopt] is non-null before
using it
parse.y
- CHECK_FOR_RESERVED_WORD: make sure to set word_top appropriately if
the last token was IF, WHILE, or UNTIL, since these tokens can follow
those reserved words
Makefile.in
- ubsan: new target, to build with gcc/clang UBSan undefined behavior
sanitizer
1/6
---
execute_cmd.[ch],locale.c,parse.y,expr.c,bracecomp.c,bashline.c,externs.h
stringlib.c,general.[ch]
builtins/{subst.c,array.c,echo.def,printf.def,enable.def,help.def,set.def}
lib/sh/{strtrans.c,stringvec.c,shquote.c}
lib/glob/sm_loop.c
lib/readline/{vi_mode.c,histfile.c,funmap.c,complete.c,display.c,bind.c,isearch.c}
lib/tilde/tilde.c
- final code cleanups for ANSI C and lint/ubsan/asan runs
1/7
---
lib/readline/complete.c
- rl_complete_internal: when computing nontrivial_lcd and the length
of the text from the line buffer, dequote the text from the line
buffer before comparing it against the common prefix of the matches
(matches[0]), so we don't get spurious mismatches if the quoted text
from the line is longer than the unquoted match. Report from
Martin Castillo <castilma@uni-bremen.de>
input.[ch]
- get_buffered_stream(fd): new function, return the BUFFERED_STREAM *
corresponding to file descriptor FD, if it exists
1/8
---
parse.y
- shell_getc: if yy_getc returns EOF but the buffered stream input
indicates an error state, set shell_input_line_terminator to
READERR. Currently treated the same as EOF.
1/10
----
lib/sh/random.c
- intrand32: use % operator instead of (mathematically equivalent)
subtraction and multiplication, which can cause signed 32-bit
overflow. Report from Sam James <sam@gentoo.org>
lib/readline/input.c
- rl_getc: if the application hasn't defined a signal event handler,
and readline is in callback mode, make sure SIGINT breaks out of
operations like incremental and non-incremental searches and digit
arguments by calling _rl_abort_internal, since the callback code
expects the various contexts that rl_callback_sigcleanup() resets
to be valid
- rl_getc: if there is a pending signal when we enter the while loop
in callback mode, handle it in the same way we would if a signal
arrived while we were waiting in select/pselect. That forces
callback mode to call _rl_abort_internal in the right place.
From a report from Andrew Burgess <aburgess@redhat.com>
1/13
----
trap.c
- SIG_ASYNCSIG: new value for sigmodes; means that the signal is
ignored because an async command is being executed
- set_signal: if the original signal disposition is SIG_IGN only
return if SIG_ASYNCSIG isn't set. This implements POSIX interp 751
for setting a trap
- ignore_signal: if we're ignoring a signal that already has SIG_IGNORED
set, make sure we set SIG_TRAPPED in case of SIG_ASYNCSIG (POSIX
interp 751)
- reset_signal,restore_signal: if we want to reset or restore a signal
that has SIG_ASYNCSIG set, make sure we reset to SIG_DFL if the
signal is trapped to maintain POSIX semantics
- set_signal_async_ignored: new function to set original_signals to
SIG_IGN and set the SIG_IGNORED and SIG_ASYNCSIG sigmode flags; used
by setup_async_signals
- signal_is_async_ignored: return true if the SIG argument is being
ignored because it's part of an async list
trap.h
- set_signal_async_ignored,signal_is_async_ignored: extern declarations
sig.c
- initialize_terminating_signals: if a signal is ignored because it's
part of an async list, don't bother trying to initialize or set the
hard ignored flag
execute_cmd.c
- execute_simple_command: if we're executing a builtin or function
asynchronously, call reset_terminating_signals like we do in
execute_in_subshell()
- execute_subshell_builtin_or_function: only call set_sigint_handler
if async is 0, so we don't undo the work done by setup_async_signals.
If the old handler is SIG_IGN and the signal has SIG_ASYNCSIG set
and isn't trapped, restore the old handler
- setup_async_signals: call set_signal_async_ignored to set the right
flags
1/16
----
parse.y
- read_token_word: if we're in posix mode, and we find a reserved word
before checking a token for aliases, turn off the `check next word
for aliases' flag (PST_ALEXPNEXT). This is for compatibility with
other shells. From a report by <anonymous4feedback@outlook.com>
- shell_getc: make sure the shell is reading a buffered stream before
checking the default buffered stream for errors if yy_getc returns 0
1/17
----
subst.c
- split_at_delims: if the cursor is at whitespace just preceding a
word, and we're doing this for completion (e.g., to build COMP_WORDS),
force the creation of an empty word and set the current word to it.
This is a change from previous behavior, but a useful one: it makes
COMP_WORDS[COMP_CWORD] and $2 to a completion function consistent
and the same as the word readline wants to complete. From a report
from Naim Favier <n@monade.li> back in 6/2022
parse.y
- read_token: turn off PST_ALEXPNEXT if we read a shell metacharacter:
we will expand aliases anyway if the token puts the shell in a
command word position and we took pains to turn it off for
redirection tokens; remove special cases that turned it off
- pop_string: don't turn off PST_ALEXPNEXT if it's on; this is what
prevents it from being enabled if an alias expansion of more than
two aliases ends with a space. Fixes issue reported by
<anonymous4feedback@outlook.com>
1/18
----
jobs.c
- wait_for: if we are reaping a background job, don't bother trying to
give the terminal back to shell_pgrp -- we never set the terminal's
pgrp to that job in the first place. Fixes issue reported by
Steffen Nurpmeso <steffen@sdaoden.eu>
1/19
----
lib/readline/{histexpand.c,history.h}
- history_expand: first argument is now `const char *'. Request from
Simon Marchi <simon.marchi@polymtl.ca>
lib/readline/doc/{history.3,hstech.texi}
- history_expansion: change description to note new const first arg
1/21
----
lib/readline/input.c
- rl_gather_tyi: move call to rl_input_available_hook to the top,
giving it first shot. There's still no way for it to set chars_avail.
Conditionalize the rest of the input methods based on whether the
result == -1.
lib/readline/rl_private.h
- move the decision making about RL_TIMEOUT_USE_SELECT/RL_TIMEOUT_USE_SIGALRM
here from input.c
1/23
----
trap.c
- restore_default_signal: if we have a signal that's not trapped, but
is a signal that is set to SIG_ASYNCSIG, POSIX interp 751 requires
the shell to allow it to be reset to the default, even though it
wasn't already trapped
subst.c
- do_assignment_internal: don't allocate new memory for NAME, just
modify and restore it in place
1/25
----
lib/readline/histfile.c
- history_write_slow: a fallback function that uses stdio to write the
history list to a supplied file descriptor
- history_do_write: call history_write_slow if ftruncate/mmap/malloc
fail; hope the simpler approach works
1/27
----
general.[ch]
- valid_function_name: new function, returns non-zero if the name
can be used as a function name without the `function' prefix
print_cmd.c
- named_function_string,print_function_def: use valid_function_name so
the rules about when to use the `function' reserved word are
consistent
builtins/trap.def
- new option -P, which prints only the action associated with each
signal spec argument
doc/{bash.1,bashref.texi}
- trap: document new -P option, add note that trap -p or trap -P in a
subshell can print the parent's traps
1/28
----
parse.y
- shell_getc: make sure references to shell_input_line_property are
protected by #ifdef HANDLE_MULTIBYTE. From
https://savannah.gnu.org/patch/?10309
print_cmd.c
- named_function_string,print_function_def: don't copy the function
COMMAND * before printing it as text; unwind-protect any redirects
attached to the function body
parse.y
- PST_CMDBLTIN: new parser state, means the previous token word was
`command' in a command position
- read_token_word: in posix mode, "command" followed by a declaration
utility preserves the declaration utility status of the following
word, so we mark that state and then check a word for being an
assignment builtin if in that state on the next call. This makes
compound assignments to builtins that accept them (e.g., `declare')
work as if `command' were not present. This is a POSIX issue 8
requirement
- read_token: turn off PST_CMDBLTIN state as appropriate
subst.c
- use locale_mb_cur_max instead of MB_CUR_MAX consistently
2/1
---
builtins/printf.def
- printf_builtin: %q and %Q use the `alternate form' flag to force
single quoting instead of backslash quoting. $'...' is still
preferred if there are characters that require it
- getwidestr, getwidechar: functions to take a possibly multibyte
character string and convert to a wide character string or a wide
character, respectively
- convwidestr, convwidechar: functions to take a wide character string
or single character, apply any precision, convert back to a multibyte
character string, and return the result for printing
- printf_builtin: consistently print an error message if printstr()
returns < 0, since it will only do that if ferror(stdout) is true;
let the PRETURN macro do that if appropriate, so we don't duplicate
code
2/2
---
builtins/printf.def
- printwidestr: wide-character version of printstr; understands
fieldwidth and precision as characters instead of bytes
- printf_builtin: interpret %ls and %lc as referring to wide strings
and characters, respectively; use printwidestr to print the wide-
character string obtained from the (presumably multibyte) argument.
Fieldwidth and precision are characters, not bytes
2/3
---
builtins/set.def
- unset_builtin: since tokenize_array_reference modifies its NAME
argument, we need to restore the original word if there is no
array variable found with that name, so we can go ahead and try to
unset a function with that wonky name. Inspired by a report from
Emanuele Torre <torreemanuele6@gmail.com>
parse.y
- read_token_word: don't set the W_HASDOLLAR flag in the returned WORD
for <(command) and >(command). That way they can be used in function
names.
execute_cmd.c
- execute_simple_command: if in posix mode, don't perform function
lookup for command names that contain a slash
builtins/enable.def
- dyn_load_builtins: don't allow dynamically loaded builtins to have
slashes in their name
2/4
---
general.c
- valid_function_word: new function, used to check whether a word can
be used as a function name. Replaces call to check_identifier();
incorporates POSIX interp 383 check for special builtin so we can
move it out of execute_intern_function().
- valid_function_name: use the FLAGS argument instead of POSIXLY_CORRECT;
only reject reserved words if FLAGS&1
execute_cmd.c
- execute_intern_function: call valid_function_word() instead of
check_identifier(); remove check for special builtin that
valid_function_word performs
print_cmd.c
- print_function_def,named_function_string: pass POSIXLY_CORRECT to
valid_function_name as the FLAGS argument
2/6
---
subst.c
- expand_subscript_string: don't set W_NOTILDE in td.flags so we
perform `normal' tilde expansion (expansion at the start of the
word) on the array subscript
- expand_oneword,expand_compound_assignment_word: change second arg to
ATYPE, which better reflects its use
arrayfunc.c
- assign_assoc_from_kvlist,assign_compound_array_list,expand_and_quote_assoc_word:
use expand_assignment_string_to_string instead of expand_subscript_string
for the rhs of the assignment or the second word in the kvpair to
be more consistent with how assignment statements behave (e.g.,
tilde expansion). Fixes issue reported by maroloccio@gmail.com
2/7
---
parse.y
- discard_until: now returns the last character read. If we get an
EOF while processing a comment, return EOF (rarely happens;
shell_getc returns EOF only under certain circumstances)
- read_token: if discard_until returns EOF, return yacc_EOF
input.h
- bclearerror: new macro, clears the B_ERROR flag in the buffered
stream BP
input.c
- b_fill_buffer: try making errors `sticky': if the B_ERROR flag is
set for the buffered stream, return EOF immediately. This is similar
to what stdio does
builtins/fc.def
- fc_builtin: in posix mode, if there are extra arguments supplied to
-s (e.g. pat=rep first last), throw an error
doc/{bash.1,bashref.texi}
- printf: document new altform for %q/%Q and %ls/%lc
2/8
---
bashline.c
- set_up_new_line: if the new line doesn't change rl_line_buffer,
just return right away without changing rl_point. Affects
alias-expand-line, history-expand-line, and history-and-alias-expand-line.
Inspired by a report from
Addison Brendtro <addison.brendtro@gmail.com>
builtins/declare.def
- declare_internal: make multiple calls to `local -' at the same
context have no effect after the first one. That way we don't keep
overwriting the saved option set. Report and fix from
Emanuele Torre <torreemanuele6@gmail.com>
2/10
----
execute_cmd.[ch]
- bind_lastarg: now a public function
parse.y
- execute_variable_command: call bind_lastarg instead of bind_variable
to avoid exporting $_ if allexport is set. Fix from
Emanuele Torre <torreemanuele6@gmail.com>
- history_delimiting_chars: if we're parsing some kind of delimited
construct that's *not* a quoted string, don't bother adding an extra
newline to the history if the current history entry already ends in
a newline. From https://savannah.gnu.org/support/?110838 via
Ganapathi Kamath <hgkamath@hotmail.com>
2/13
----
bashline.c
- set_up_new_line: add some more heuristics to try and usefully
position rl_point
2/16
----
lib/readline/complete.c
- complete_fncmp: fix for case mapping `-' and `_' if the bytes do not
form a valid multibyte character
lib/readline/util.c
- new functions: _rl_strcaseeqn, like strcasencmp but with a flag to
handle character mapping (-_) like completion-map-case wants, and
_rl_charcasecmp, to do the same thing for two characters.
Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
lib/readline/mbutil.c
- new functions: _rl_mb_strcaseeqn and _rl_mb_charcasecmp, multibyte
versions of the above
Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
lib/readline/{rlprivate.h,rlmbutil.h}
- extern declarations for the above functions
lib/readline/complete.c
- complete_fncmp: use _rl_mb_strcaseeqn and _rl_strcaseeqn as
appropriate, remove duplicated inline code
Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
lib/readline/{isearch.c,rlprivate.h}
- _rl_search_case_fold: new variable, will be used to indicate case-
insensitive incremental and non-incremental searches
lib/readline/bind.c
- search-ignore-case: new bindable variable, tied to _rl_search_case_fold
Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
lib/sh/mbsncmp.c
- mbsncmp(3) replacement
lib/readline/isearch.c
- _rl_isearch_dispatch: honor `search-ignore-case' variable and perform
case-insensitive incremental searches if it's set
Inspired by a patch from Brennan Vincent <brennan@umanwizard.com>
lib/readline/histlib.h
- CASEFOLD_SEARCH: new flag for history searching, means to search
strings case-insensitively
lib/readline/histsearch.c
- history_search_internal: anchored searches honor CASEFOLD_SEARCH
lib/readline/histsearch.c
- history_search_internal: searches now honor CASEFOLD_SEARCH
- _hs_history_search: new function, just external interface to
history_search_internal, allows the rest of the library to specify
search flags
lib/readline/histlib.h
- _hs_history_search: extern declaration
lib/readline/search.c
- noninc_search_from_pos: use _hs_history_search, add CASEFOLD_SEARCH
to flags if _rl_search_case_fold is non-zero
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- search-ignore-case: document new bindable variable
2/17
----
config-top.h
- PATSUB_REPLACE_DEFAULT: macro set to 1 or 0 to set the default value
of `patsub_replacement'. Can be overridden by -DPATSUB_REPLACE_DEFAULT=0
in the `make' command
builtins/shopt.def
- reset_shopt_options: reset patsub_replacement to PATSUB_REPLACE_DEFAULT
subst.c
- patsub_replacement: initialize to PATSUB_REPLACE_DEFAULT
parse.y
- shell_getc: only call clearerr(stdin) when yy_stream_get returns EOF
if the shell is currently interactive (interactive != 0)
- shell_getc: if the shell is not interactive (interactive_shell == 0)
and using stdio to read the script (bash_input.type == st_stream),
set shell_input_line_terminator to READERR if ferror(stdin) is true
after yy_stream_get returns EOF
2/20
----
doc/{bash.1,bashref.texi}
- update aliases description based on a bug-bash discussion
- update description of word splitting behavior when IFS is unset
builtins/evalfile.c
- _evalfile: if reading the entire file doesn't return the same
number of bytes as requested (the file size), treat this as a read
error
2/21
----
parse.y
- yylex: if read_token returns < 0, return YYEOF if EOF_Reached = 1.
Don't return yacc_EOF because that allows commands to be executed.
- grammar: add a production to handle YYEOF, treating it the same as
yacc_EOF. Based on a report from
Eduardo A. Bustamante López <dualbus@gmail.com>
jobs.c
- wait_for: if we're checking for window size changes, allow checks
during trap commands while readline is active or `bind -x' command
execution. Fix from Koichi Murase <myoga.murase@gmail.com>
2/22
----
jobs.c
- wait_for: check for window size changes during programmable completion
2/23
----
execute_cmd.c,input.c,jobs.c,nojobs.c,parse.y,redir.c,shell.c
builtins/{exec.def,read.def}
input.h
- BUFFERED_INPUT: preprocessor #define is gone, this code is now
unconditional
2/24
----
builtins/declare.def
- declare_internal: set the att_propagate flag on a variable that is
marked as att_tempvar only if it's *not* marked att_local. The
effect is that local variables with the same name as variables in
the temporary environment are not propagated to the previous scope.
From a report by Voldemar Lazarev <voldemar.lazarev@alludo.com>
that prompted a bug-bash discussion
builtins/setattr.def
- set_var_attribute: don't set local variables for which we are setting
export or readonly to propagate back to the previous context, but
make sure we preserve posix semantics
parse.y
- read_token_word: if we're parsing the words of a compound assignment
(parser_state & PST_COMPASSIGN), and we have a valid assignment
statement as a word ([sub]=value), set W_NOBRACE in the word so we
don't try and perform brace expansion on it. This makes ( [sub]=word )
closer to name[sub]=word.
From a report by Ilkka Virta <itvirta@iki.fi> back in July, 2020:
https://lists.gnu.org/archive/html/bug-bash/2020-07/msg00133.html
2/27
----
lib/readline/display.c
- rl_redisplay: if HANDLE_MULTIBYTE is defined, do the special META_CHAR
handling if wc_bytes == wc_width == 1
execute_cmd.c
- eval_arith_for_expr: make sure we don't call make_word with a NULL
string if expand_arith_string returns NULL. Report from
F G <frank.graziano@gmail.com>
arrayfunc.c
- assign_assoc_from_kvlist: added code, currently disabled, to perform
all expansions, including word splitting, on the kv-pair word list
2/28
----
lib/readline/search.c
- rl_history_search_reinit: change check against history_string_size
to account for history_string_size now being a size_t. Report and
fix from Grisha Levit <grishalevit@gmail.com>
3/2
---
lib/readline/history.c
- _hs_search_history_data: search the history list for an entry with
`data' matching the argument; return the index
- _hs_replace_history_data: search backwards through the history list
from the end
lib/readline/histlib.h
- _hs_search_history_data: extern declaration
lib/readline/search.c
- make_history_line_current: make sure rl_undo_list doesn't appear in
any history entries (it should be a private search string undo list)
before freeing it
lib/readline/misc.c
- _rl_free_saved_history_line: make sure the undo list in
_rl_saved_line_for_history isn't rl_undo_list and doesn't appear in
any history list entries as `data' before freeing it. Fixes core
dump after SIGINT reported by Grisha Levit <grishalevit@gmail.com>
parse.y,print_cmd.c
- changes for size_t when computing new amount for xrealloc
3/3
---
parse.y
- set_word_top: new inline function to check and set word_top; called
from the appropriate places
- parse_dparen: call set_word_top before parsing an arith command or
nested subshell. Fixes underflow issue reported by
Grisha Levit <grishalevit@gmail.com>
examples/loadables/kv.c
- kv: new loadable builtin, reads key-value pairs from stdin and assigns
them to an associative array
3/7
---
builtins/trap.def
- trap_builtin: if trying to restore SIGQUIT to its default disposition,
and the shell is in posix mode, set to SIG_DFL if the shell is
running as an async command and signal_is_async_ignored (SIGQUIT) is
true. Posix conformance issue 751
3/8
---
builtins/alias.def
- print_alias: now returns int. Check for write errors using sh_chkwrite
and return EXECUTION_FAILURE if it fails
- alias_builtin: if print_alias returns EXECUTION_FAILURE, return
EXECUTION_FAILURE immediately (write error). POSIX test conformance
3/9
---
builtins/cd.def
- change_to_directory: if we're not in physical mode and are in posix
mode, add step 9 of the posix cd algorithm, which essentially tries
the pathname the user supplied if it's shorter than PATH_MAX and the
length of the canonicalized pathname is longer than PATH_MAX. This
is basically what default bash mode does without the length checks.
POSIX test conformance.
subst.c
- strip_trailing_ifs_whitespace: use ifs_whitespace(*s) instead of
spctabnl(*s) like word splitting and get_word_from_string. POSIX
test conformance
jobs.c
- wait_for: tweak change from 1/18 to make sure a J_ASYNC job isn't in
the foreground (J_FOREGROUND) as it would be if it had been continued
in the foreground with `fg'; if it is, we want to give the terminal
back to shell_pgrp
3/10
----
input.c
- fd_berror: returns true if the file descriptor passed as an arg
corresponds to a buffered stream with an error condition
parse.y
- shell_getc: use fd_berror instead of inline code
- shell_getc: if yy_getc returns EOF, immediately set line[0] to NULL
and set shell_input_line_terminator to READERR. Then exit immediately
with status 128 if index == 0, line[index] == NULL, and READERR.
Posix interp 1629
config-top.h
- FATAL_READERROR: now defined to 1 by default
lib/readline/display.c
- rl_expand_prompt: allocate an empty string for local_prompt if prompt
is the NULL or empty string. Fixes seg fault with rl_message and
empty prompt reported by Grisha Levit <grishalevit@gmail.com>
lib/readline/histexpand.c
- history_expand: if hist_extract_single_quoted returns an index at or
past the end of the string, correct the index and break the loop,
which will cause a return. Report and fix from
Grisha Levit <grishalevit@gmail.com>
3/13
----
lib/readline/vi_mode.c
- rl_domove_motion_callback: set the MOVE_FAILED flag in the context M
if rl_dispatch returns non-zero and other movement-command-specific
conditions are met. Right now, an unsuccessful `f' or `F' command
is failure.
- _rl_vi_domove_motion_cleanup: if the command is `c' or `C', we don't
enter insert mode if the MOVE_FAILED flag is set in the context M.
This is how standalone vi works.
lib/readline/kill.c
- rl_unix_filename_rubout: add some checks for rl_point > 0 before
looking at rl_line_buffer[rl_point - 1]. Report and fix from
Grisha Levit <grishalevit@gmail.com>
lib/readline/isearch.c
- _rl_isearch_dispatch: reset cxt->sline_index to 0 if it's past the
end of the history string (sline_len). Fixes asan bug reported by
Grisha Levit <grishalevit@gmail.com>
lib/readline/histexpand.c
- history_tokenize_word: don't increment the string index past the
NULL if the line ends in a backslash.Fixes asan bug reported by
Grisha Levit <grishalevit@gmail.com>
lib/readline/vi_mode.c
- rl_vi_yank_to,rl_vi_change_to,rl_vi_delete_to: if these are called
with an existing valid vimvcxt, save it and allocate a new one for
the current function call to use, then restore it before returning.
This prevents referencing vimvcxt after freeing it in the case that
these functions call each other recursively (e.g., y1y1, c1d1, etc.).
Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
3/14
----
bashhist.c
- bash_add_history: make sure curlen is large enough before checking
curlen - 1 and curlen - 2, otherwise you can get buffer underflow.
Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
bashline.c
- bash_spell_correct_shellword: don't bother trying to correct empty
words. Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
lib/sh/shquote.c
- sh_mkdoublequoted: make sure to allocate enough memory for the
pathological case: where every character in the string needs to be
backslash-escaped because it's special within double quotes.
Fixes asan bug reported by Grisha Levit <grishalevit@gmail.com>
doc/{bash.1,bashref.texi}
- here documents: make sure the summary specifies the here-document is
terminated by `delimiter'; specify what the delimiter is if the word
is not quoted. Prompted by a help-bash post from
goncholden <goncholden@protonmail.com>
3/15
----
doc/bash.1,lib/readline/doc/rluser.texi
- shell-expand-line: enumerate the specific expansions performed.
From a request by Alex Bochannek <alex@bochannek.com>
findcmd.c
- path_value: new function, returns normalized version of $PATH. Takes
a single argument saying whether or not to look in the temporary
environment first. Normalizes null $PATH (PATH=) into ".". From a
bug-bash discussion started by Moshe Looks <moshe.looks@gmail.com>
- _find_user_command_in_path: use path_value()
- user_command_matches: use path_value()
- search_for_command: if PATH[0] == 0, set PATH = "." like path_value().
This has the side effect of calling command_not_found_handle when
PATH is the empty string and the command isn't in the current
directory
- search_for_command: if path == 0, but we found an executable in the
current directory, make sure to set dot_found_in_search before adding
it to the command hash table
findcmd.h
- path_value: extern declaration
bashline.c
- command_word_completion_function: use path_value()
builtins/enable.def
- dyn_load_builtin: use path_value for BASH_LOADABLES_PATH; it's cleaner
though it doesn't change the behavior
3/17
----
bashline.c
- bashline_reset: reset rl_filename_quoting_function, since there is a
SIGINT code path where it could remain reset by glob completion.
Reported by Grisha Levit <grishalevit@gmail.com>
- command_word_completion_function,command_subst_completion_function,
glob_complete_word: set some static variables to NULL
after freeing them so they don't potentially get freed twice after
a SIGINT during completion
Reported by Grisha Levit <grishalevit@gmail.com>
parse.y
- read_token_word: when deciding how to quote translated strings, don't
free ttok before comparing it to ttrans
Reported by Grisha Levit <grishalevit@gmail.com>
- parse_matched_pair: same thing for freeing nestret
- read_token: if we return a newline, make sure we call set_word_top()
if necessary.
Fixes underflow reported by Grisha Levit <grishalevit@gmail.com>
lib/glob/sm_loop.c
- EXTMATCH: don't bother with FNM_PATHNAME checks; this function isn't
called with a pathname.
Fixes underflow reported by Grisha Levit <grishalevit@gmail.com>
lib/readline/misc.c
- rl_maybe_replace_line: if we replace a history entry's data with
rl_undo_list, we need to set rl_undo_list to 0, since we should not
have rl_undo_list pointing to something from a history entry
Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
3/20
----
lib/readline/histexpand.c
- postproc_subst_rhs: fix off-by-one error when reallocating new string
for case where we're *not* substituting for `&'
Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
jobs.c
- terminate_current_pipeline: add a SIGKILL call in there in case the
SIGTERM doesn't work
- terminate_current_pipeline: add a version that works when job control
isn't enabled (pipeline_pgrp == shell_pgrp)
subst.c
- skip_to_delim: pass completeflag (SX_COMPLETE) to extract_dollar_brace_string
in case it includes a command substitution, since we want to inhibit
error messages in this case
parse.y
- no_semi_successors: add DOLPAREN to list since something like $(\n
shouldn't have a semicolon added there.
From a report by Grisha Levit <grishalevit@gmail.com>
3/21
----
pcomplete.c
- gen_globpat_matches: set noglob_dot_filenames here since we're not
calling shell_glob_filename to do it
From a report by Grisha Levit <grishalevit@gmail.com>
3/22
----
lib/readline/misc.c
- rl_maybe_replace_line: if we're replacing a history entry with the
current line buffer and undo list, then zero out any undo list in
_rl_saved_line_for_history, since we're not going to use it any more
Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
lib/readline/undo.c
- rl_free_undo_list: if we're freeing rl_undo_list, it can't be a
valid value for data in _rl_saved_line_for_history
Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
lib/readline/complete.c
- display_matches: don't call rl_display_match_list if we received a
signal during get_y_or_n and didn't jump out for some reason
From a report by Grisha Levit <grishalevit@gmail.com>
- rl_display_match_list: return if we received a signal during
_rl_internal_pager (via get_y_or_n) and didn't jump out
From a report by Grisha Levit <grishalevit@gmail.com>
3/23
----
lib/readline/history.c
- history_truncate_file: don't bother trying to read the existing
history file if we're just truncating it to 0 lines
3/24
----
lib/readline/histfile.c
- history_truncate_file: fix off-by-one error that resulted in the
timestamp associated with the first history entry not being written
to the truncated history file
From a report by Grisha Levit <grishalevit@gmail.com>
parse.y
- decode_prompt_string: do something rational if localtime() returns
NULL (extraordinarily rare)
From a report by Paul Eggert <eggert@cs.ucla.edu>
examples/loadables/stat.c
- stattime: ditto
examples/loadables/strftime.c
- strftime_builtin: ditto
lib/readline/examples/histexamp.c
- main: ditto
include/posixtime.h
- getnow(): new inline function, calls gettimeofday and returns tv_sec;
replacement for time(0). From Paul Eggert <eggert@cs.ucla.edu>
general.h
- NOW: use a call to getnow() to standardize on gettimeofday for time
information
lib/readline/history.c
- include #posixtime.h for getnow()
- hist_inittime: use getnow() instead of calling time(0)
parse.y
- posixtime.h: include instead of <time.h>
- decode_prompt_string: use getnow() instead of calling time(0)
3/27
----
parse.y
- count_all_jobs: add extern definition if JOB_CONTROL is not defined.
From Emanuele Torre <torreemanuele6@gmail.com>
bashhist.c
- bash_add_history: make sure the current history line is not empty
before checking what ended it.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/histexpand.c
- history_tokenize_word: break out of loop for incomplete command and
process substitution or extended globbing patterns
From a report by Grisha Levit <grishalevit@gmail.com>
bashline.c
- hostnames_matching: fix size_t issue when checking whether to realloc
From a report by Grisha Levit <grishalevit@gmail.com>
lib/sh/random.c
- genseed: use uintptr_t instead of u_bits32_t to silence compiler
warnings. From Paul Eggert <eggert@cs.ucla.edu>
aclocal.m4
array2.c
builtins/mkbuiltins.c,builtins/psize-posix.c,version.c
builtins/getopts.def
lib/readline/text.c,lib/readline/bind.c
support/recho.c,support/mksignames.c,support/zecho.c,support/xcase.c
support/printenv.c,support/signames.c,support/bashversion.c
support/memtest.c,support/endian.c
lib/glob/gm_loop.c
- some cleanups for function prototypes and other stdc requirements
From Paul Eggert <eggert@cs.ucla.edu>
lib/readline/doc/{rltech.texi,hstech.texi}
- add prototypes and stdc requirements to the examples
builtins/complete.def
- compgen_builtin: save and restore readline variables affecting how
filename completions are treated in case someone uses compgen in
the foreground.
From a report by Grisha Levit <grishalevit@gmail.com>
3/28
----
aclocal.m4
builtins/enable.def,builtins/gen-helpfiles.c,builtins/help.def,builtins/printf.def
general.h,hashlib.h
include/ansi_stdlib.h,include/ocache.h
lib/glob/collsyms.h,lib/glob/glob.c
lib/readline/history.h,lib/readline/xmalloc.h
xmalloc.c,xmalloc.h
lib/sh/strtrans.c
lib/tilde/tilde.c
mksyntax.c
support/endian.c
- don't bother with __STDC__ if we are just using C89 features like
const, function prototypes, etc.
From Paul Eggert <eggert@cs.ucla.edu>
externs.h
- prototype the list functions that take GENERIC_LIST *
From Paul Eggert <eggert@cs.ucla.edu>
builtins/common.c,examples/loadables/getconf.c
execute_cmd.c,pcomplete.c,subst.c
lib/sh/stringlist.c,lib/sh/stringvec.c
- changes and casts now that the generic list functions are prototyped
From Paul Eggert <eggert@cs.ucla.edu>
3/29
----
aclocal.m4,configure.ac
builtins/common.c,builtins/mkbuiltins.c,builtins/printf.def
include/memalloc.h,include/stdc.h
general.h,jobs.h
pcomplete.c,print_cmd.c
m4/iconv.m4
lib/readline/bind.c,lib/readline/complete.c,lib/readline/display.c
lib/readline/funmap.c,lib/readline/util.c,lib/readline/parens.c
lib/readline/histlib.h
lib/readline/readline.h,lib/readline/rldefs.h,lib/readline/rlstdc.h,lib/readline/rlprivate.h
lib/sh/dprintf.c,lib/sh/snprintf.c,lib/sh/vprintf.c
lib/malloc/shmalloc.h,lib/malloc/imalloc.h,lib/malloc/xmalloc.c
lib/termcap/termcap.h
- stdarg: since we now assume C89 for prototypes at least, always
prefer stdarg to old-style varargs
- SH_VA_START: now use plain old va_start
- don't bother with extern declarations for standard C89 functions
From Paul Eggert <eggert@cs.ucla.edu>
config-bot.h
- PREFER_STDARG: remove
builtins/mkbuiltins.c
execute_cmd.c,unwind_prot.c
unwind_prot.h
- start on ANSI/ISO C changes for the unwind-protect framework
- introduce new unwind-protect function pointer type to replace
Function
From Paul Eggert <eggert@cs.ucla.edu>
3/30
----
builtins/command.def,builtins/fc.def,builtins/read.def,builtins/source.def
builtins/evalfile.c,builtins/evalstring.c
dispose_cmd.c,execute_cmd.c,pcomplete.c,print_cmd.c,subst.c,jobs.c,variables.c
dispose_cmd.h,general.h,trap.h
unwind_prot.c,unwind_prot.h
- rest of work to convert unwind-protect framework to ANSI/ISO C.
Convert unwind-protects to use new shim functions that obey the new
unwind-protect function type
From Paul Eggert <eggert@cs.ucla.edu>
general.h
- STREQ, STREQN: now static inline functions to take advantage of arg
type conversion
pcomplete.c,subst.c
lib/readline/histexpand.c,lib/readline/mbutil.c
- fix size_t subtractions in comparisons to avoid unsigned underflow
externs.h
execute_cmd.c
builtins/times.h
- add prototypes for functions taking clock_t and timeval, make their
declaration in externs.h conditional on NEED_CLOCK_FUNCS_DECL and
NEED_TIMEVAL_FUNCS_DECL, respectively
3/31
----
subst.c
- expand_string_dollar_quote: check for zero-length return from
string_extract_{single,double}_quoted and avoid size_t underflow
Fixes asan error reported by Grisha Levit <grishalevit@gmail.com>
4/3
---
builtins/evalstring.c
- open_redir_file: treat the case of failing to open the file as a
non-fatal expansion error instead of a (fatal) redirection error.
Report from Zev Weiss <zev@bewilderbeest.net>
4/4
---
lib/readline/vi_mode.c
- _rl_domove_motion_cleanup: d/D require the same special case as c/C
so that a motion command that doesn't move the cursor consumes/deletes
at least one character.
From Emanuele Torre <torreemanuele6@gmail.com>
- _rl_domove_motion_cleanup: ditto for y/Y
- rl_domove_motion_callback: if t/T/;/, fail (return non-zero without
moving point), flag the motion command as having failed (MOVE_FAILED)
4/6
---
subst.c
- command_substitute: save the return status of the child process in
last_command_subst_status; don't assign to last_command_exit_value
in posix mode (posix interp 1150)
execute_cmd.c
- execute_null_command: a simple command without a command word but
with command substitutions now returns last_command_subst_status.
It may or may not have already modified $? depending on posix mode
redir.c
- redir_varvalue: legal_number validity check should be == 0, not < 0
From a report by Grisha Levit <grishalevit@gmail.com>
4/10
----
subst.c
- parameter_brace_expand_rhs: check for namerefs in the variable name
part of the ${name=word} expansion so we can go back and implement
the POSIX semantics of returning "the final value of parameter."
From a report by Grisha Levit <grishalevit@gmail.com>
sig.c,sig.h
- sigpipe_handler: clean up, set $?, and throw to top level on receipt
of a SIGPIPE
- termsig_handler: if the variable builtin_catch_sigpipe is set (it's
not set anywhere yet), call sigpipe_handler instead of terminating
the shell. Still need to make sure a sighandler is installed for
SIGPIPE even if initialize_terminating_signals isn't called
4/14
----
lib/sh/tmpfile.c
- sh_mktmpfd: add support for MT_UNLINK flag, unlinks created filename
before returning fd, fails if the unlink fails for some reason
4/15
----
pathexp.c,pathexp.h
- globsort: support for various glob sorting criteria as defined by
the GLOBSORT variable: name, size, blocks, mtime, atime, ctime.
Default is ascending sort by name, as is traditional. Based on an
idea from Evan Gates <evan.gates@gmail.com>
- setup_globsort: parse the value of the GLOBSORT variable, find
sorting type and whether or not it's ascending or descending
- noquote_glob_filename: glob_filename for programmable completion,
doesn't call quote_string_for_globbing and honors GLOBSORT, dotglob,
and globstar
pcomplete.c
- gen_globpat_matches: call noquote_glob_filename, let that handle
all the variables and GLOB_FAILED
variables.c
- GLOBSORT: support for special variable, call setup_globsort on
set or unset
doc/bash.1,doc/bashref.texi
- GLOBSORT: document variable and its effects on pathname expansion
4/17
----
builtins/complete.def
- build_actions: take an additional char ** arg VNAMEP; if it is non-
null, accept a -V VARNAME option that names an indexed array
variable in which to store the completions.
- compgen_builtin: if the -V option is supplied, store the possible
completions into VARNAME instead of printing them on stdout. From a
patch from Grisha Levit <grishalevit@gmail.com>, idea originally
from konsolebox <konsolebox@gmail.com> back in 2/2022
doc/bash.1,lib/readline/doc/rluser.texi
- compgen: document new -V option
4/18
----
lib/readline/vi_mode.c
- rl_domove_read_callback: call _rl_arg_init before reading digit
argument so prompt gets saved, both callback and non-callback modes
From a report by Grisha Levit <grishalevit@gmail.com>
- rl_vi_arg_dispatch: if we return 0 to end the digit argument and
turn off NUMERICARG, call rl_restore_prompt
lib/readline/histexpand.c
- history_expand_internal: make sure subst_lhs is not null before we
call postproc_subst_rhs.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/display.c
- rl_redisplay: remove redundant code that ends up incrementing lpos
too much for meta characters displayed as octal escape sequences.
From a report by Grisha Levit <grishalevit@gmail.com>
4/19
----
bashline.c
- attempt_shell_completion: handle case where s > e after calls to
find_cmd_start and find_cmd_end, respectively.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/display.c
- update_line: fix setting of `wsatend' when computing ols and nls in
the multibyte case; this caused redisplay to print more characters
than it needed
- update_line: fix calculation of visible_wrap_offset when moving up
to line 0, trying to figure whether or not the visible prompt has
any invisible characters. Fixes C locale issue reported by
Grisha Levit <grishalevit@gmail.com>
4/20
----
lib/readline/text.c
- _rl_rubout_char: update erase-at-end-of-line hack to deal with the
unlikely event that a character in a non-multibyte locale is
displayed using an octal representation.
From a report by Grisha Levit <grishalevit@gmail.com>
execute_cmd.c,execute_cmd.h,builtins/evalstring.c
- interrupt_execution: replaces `executing_list'
- interrupt_execution: set while executing while, for, until, select,
and arithmetic for loops
jobs.c
- wait_for: if a process dies due to a SIGINT while the shell is
executing a loop or a list, act as if the shell got SIGINT. This
is no longer dependent on the compatibility level
From a report by Grisha Levit <grishalevit@gmail.com>
bashline.c
- name_is_acceptable: allow FIGNORE suffixes to match the entire
pathname like tcsh does instead of requiring a non-empty prefix.
From Emanuele Torre <torreemanuele6@gmail.com>
4/23
----
lib/readline/misc.c
- _rl_unsave_line: new function, takes a HIST_ENTRY * as an argument,
generalized rl_maybe_unsave_line
- _rl_alloc_saved_line: allocate a new HIST_ENTRY *, populate it like
rl_saved_line_for_history
- _rl_free_saved_line: free a saved HIST_ENTRY *
- _rl_free_saved_history_line: call _rl_free_saved_line
- _rl_previous_history_internal: new function, internals of
rl_get_previous_history; change rl_get_previous_history to call it
lib/readline/history.h
- HIST_ENTRY_DEFINED: define sentinel if HIST_ENTRY struct defined
lib/readline/rlprivate.h
- _rl_alloc_saved_line,_rl_free_saved_line,_rl_unsave_line: new extern
function definitions
- _rl_free_saved_search_line: new extern definition
lib/readline/search.c
- _rl_saved_line_for_search: use private storage to save current line,
avoid clashes with rl_saved_line_for_history
- _rl_free_saved_search_line,_rl_unsave_saved_search_line: new functions
to manage _rl_saved_line_for_search
- noninc_dosearch,_rl_nsearch_abort: clean up _rl_saved_line_for_search
instead of rl_saved_line_for_history
- rl_history_search_internal: allocate private _rl_saved_line_for_search;
unsave or free it as appropriate
- _rl_history_search_reinit: free up any _rl_saved_line_for_search just
in case
lib/readline/vi_mode.c
- rl_vi_search: free _rl_saved_line_for_search, since that's what the
non-incremental search functions use now
- rl_domove_read_callback: if we read a numeric argument, then a motion
character, make sure the motion character is valid before returning
it and going on
From a report by minipython <599192367@qq.com>
4/27
----
lib/readline/display.c
- _rl_move_cursor_relative: when checking to see whether data is within
the invisible line, make sure to stay within the invisible line
line break boundaries
From a report by minipython <599192367@qq.com>
lib/readline/search.c
- dispose_saved_search_line: new function, either unsave the saved
search line (if we're not at the end of the history) or free it
(if we are). Needs to be immediately followed by call to
make_history_line_current, which resets rl_undo_list
- make_history_line_current: change strategy: rely on callers to
manage _rl_saved_line_for_search and rl_undo_list; just copy the
data from the passed history entry into the line buffer and reset
rl_undo_list
- noninc_dosearch,rl_history_search_internal: call dispose_saved_search_line
before calling make_history_line_current
lib/readline/misc.c
- _rl_start_using_history: free the undo list associated with
_rl_saved_line_for_history, if one exists. Have to watch out for
this causing pointer aliasing problems, maybe add a call to
_hs_search_history_data()
4/28
----
pathexp.c
- sh_globsort: a sort specifier of `nosort' disables sorting completely
doc/bash.1,doc/bashref.texi
- GLOBSORT: document `nosort' sort specifier
bashline.c
- attempt_shell_completion: attempt completion with the empty command
for a null command word on a line with only whitespace following any
optional assignment statements
- attempt_shell_completion: make sure that the start of the command
word is not after rl_point before calling the programmable completion
for the initial word.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/histexpand.c
- history_expand: don't read past the end of the string if it ends with
an incomplete multibyte character
From a report by Grisha Levit <grishalevit@gmail.com>
5/1
---
lib/readline/text.c
- _rl_insert_char: make sure to return 1 in all cases where there are
pending bytes accumulating for a multibyte character
- _rl_insert_char: if the COUNT argument is 0, insert any pending
bytes read so far. The idea is that these bytes were accumulating
to compose a possible multibyte character, and the count of 0
indicates that the current character doesn't contribute to that
because it's bound to an editing command.
- rl_insert, rl_quoted_insert: make sure to call _rl_insert_char
with a 0 count as appropriate to insert any accumulating bytes
From a patch by Grisha Levit <grishalevit@gmail.com>
sig.c
- top_level_cleanup,throw_to_top_level: set variable_context to 0, just
to make sure
execute_cmd.c
- function_misc_cleanup: new function, runs make_funcname_visible and
unlink_fifo_list at the end of execute_function, replaces inline
code
- uw_function_misc_cleanup: unwind-protect function, just calls
function_misc_cleanup. Installed by execute_function.
Partial fix for FUNCNAME bug reported by Grisha Levit <grishalevit@gmail.com>
- execute_builtin: run unwind-protects if evalnest exeeds max
- execute_builtin: run unwind-protects if sourcenest exeeds max
parse.y
- parse_string_to_word_list: set current_token = '\n' on error
- parse_string_to_word_list: if we're executing and not running in
parse_and_execute, call top_level_cleanup before we jump to the
top level. Rest of fix for FUNCNAME bug
- parse_compound_assignment: set last_read_token and current_token to
'\n' on parse error. Fix for alias expansion bug reported by
Grisha Levit <grishalevit@gmail.com>
- parse_compound_assignment: if we're executing and not running in
parse_and_execute, call top_level_cleanup before we jump to the
top level
5/2
---
jobs.c
- run_sigchld_trap: don't freeze and unfreeze the jobs list; move it
to the callers who are running this on SIGCHLD receipt and cannot
deal with jobs disappearing from the list while they're running
- waitchld: if we are running the wait builtin, continue to run the
SIGCHLD trap immediately upon signal receipt, but freeze and
unfreeze the jobs list around the call to run_sigchld_trap().
Fixes issue with `jobs' in a SIGCHLD trap not removing jobs from
the jobs list reported by Guldrelokk <me@rarity.fan>
5/4
---
input.c
- fd_to_buffered_stream: make sure buffers[fd2] is non-null before
turning on SHAREDBUF.
From Emanuele Torre <torreemanuele6@gmail.com>
eval.c
- reader_loop: save and restore EOF_Reached around expanding $PS0,
setting it to 0 for the expansion so it doesn't affect things like
command substitution.
From a report by Grisha Levit <grishalevit@gmail.com>
parse.y
- parse_comsub: handle ${Ccommand; }, where C == space, tab, newline,
or '|'
- read_token_word: understand ${Ccommand; } and call parse_comsub to
parse the contents
- parse_matched_pair: understand ${Ccommand; } inside another paired
construct
- new `funsub' production, like comsub but for ${Ccommand;} nofork
command substitution
execute_cmd.c
- execute_simple_command: if we fork because of pipes in or out, clear
the fifo list, since subshell aren't supposed to inherit fifos
5/8
---
parser.h
- PST_FUNSUBST: new parser state, parsing the command in ${Ccommand;}.
Primarily used to have read_token_word return `}' as a separate
token even if it's not delimited like a reserved word
subst.h
- SX_FUNSUB: new flag, tell xparse_dolparen we are parsing the command
in a ${Ccommand;} nofork command substitution
parse.y
- xparse_dolparen: handle parsing ${Ccommand;} nofork command
substitution like parse_comsub
- read_token: if we're parsing a foreground command substitution,
treat a word that begins with an unquoted `}' as a `}' token to
terminate the ${Ccommand;} construct without requiring that the
close brace be delimited like a reserved word
- no_semi_successors: add DOLBRACE
- reserved_word_acceptable: add DOLBRACE
subst.c
- extract_function_subst: like extract_command_subst, but for nofork
command substitutions; calls xparse_dolparen with the SX_FUNSUB
flag to differentiate
- string_extract_double_quoted,extract_delimited_string,
extract_heredoc_dolbrace_string,extract_dollar_brace_string,
param_expand: call extract_function_subst as appropriate
- function_substitute: like command_substitute, but for nofork command
substitutions. Just a stub for now
5/11
----
jobs.[ch]
- pipeline_saver: already_making_children now saved and restored as
part of the struct; no longer need a separate variable
- save_pipeline,restore_pipeline: save already_making_children to struct
parse.y
- parse_comsub,xparse_dolparen: handle `(' as the first char of a
funsub (ksh93 supports that)
subst.c
- function_substitute: complete implementation; handle both funsubs
and valsubs (need different terminology); dummy up a fake shell
function so local variables and `return' work; do the right thing
with process groups
- executing_funsub: flag for the rest of the shell to know we're
expanding a funsub; used by parse_and_execute
builtins/evalstring.c
- parse_and_execute: check executing_funsub to do the right thing with
alias expansion and posix mode
5/12
----
doc/bash.1,doc/bashref.texi
- function substitution (or lambda substitution, or nofork command
substitution): document
5/15
----
subst.c
- function_substitute: make sure to decrement variable_context in the
unwind-protects since we don't unwind_protect it individually.
Report from Oguz <oguzismailuysal@gmail.com>
5/17
----
configure.ac
- i370 machines cannot use the bash malloc
Patch from Igor Todorovski <itodorov@ca.ibm.com>
support/signames.c
- initialize_signames: add support for z/OS signals.
Patch from Igor Todorovski <itodorov@ca.ibm.com>
lib/glob/smatch.c
- collseqcmp: new name for collequiv[_wc], that function apparently
exists in libc on z/OS
Patch from Igor Todorovski <itodorov@ca.ibm.com>
jobs.c
- mark_all_jobs_as_dead: make sure to reset js.j_ndead to the right
number of jobs in the array
execute_cmd.c
- execute_while_or_until: move call to REAP() after the action
executes, like other loop functions
shell.c,parse.y,lib/intl/gettextP.h
- add some __MVS__ checks for z/OS systems
5/18
----
jobs.c
- wait_for_any_job: catch jobs that can terminate and be reaped
when we call UNBLOCK_CHILD between the loop where we check the
jobs list for dead jobs and the loop where we check for running
jobs and poll for them with wait_for().
Fixes bug reported by Aleksey Covacevice <aleksey.covacevice@gmail.com>
5/20
----
subst.c
- read_comsub: quote CTLNUL if it's in $IFS and we're parsing the
RHS of an assignment statement
- comsub_quote_string: ditto
- comsub_shouldquote: break code that decides whether to CTLESC escape
a character read from a command substitution or $REPLY into its own
inline function; change read_comsub/comsub_quote_string callers
5/21
----
subst.c
- quote_escapes_internal: use ifs_cmap instead of iterating through
ifs_value to set skip_ctlesc and skip_ctlnul
5/23
----
parser.h
- remove `(' from FUNSUB_CHARS
parse.y
- parse_comsub: don't bother with `(' as one of the FUNSUB_CHARS
doc/bash.1,doc/bashref.texi
- command substitution: remove mention of `(' as a valid character
following the open brace in nofork command substitution
5/24
----
parse.y
- parse_comsub: avoid adding `;' to an empty ${ command substitution
- parse_comsub: if open == '{', push back a newline we read into
peekc to get PS2 prompting right.
From a report by Grisha Levit <grishalevit@gmail.com>
subst.c
- skip_double_quoted: pass the SX_COMPLETE flag down to
extract_dollar_brace_string in case it contains an unclosed command
substitution.
From a report by Grisha Levit <grishalevit@gmail.com>
5/25
----
shell.c
- make sure shell_initialized is set to 1 before running -c command
make_cmd.c
- make_function_def: initialize source_file to something other than
`main' or `environment' if the shell is not interactive.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
parse.y
- save_token_state,restore_token_state: save and restore token_to_read
- read_token_word: if we read EOF in an interactive shell, set
token_to_read to yacc_EOF and EOF_Reached to 1 so the token will
be delimited but the next call to read_token returns yacc_EOF
- handle_ignoreeof: broke the code that checks eof_encountered and
possibly exceeds the ignoreeof limit out into a separate public
function, called from handle_eof_input_unit
eval.c
- reader_loop: if EOF_Reached is set in an interactive shell after
parse_command and execute_command, and ignoreeof has been enabled,
check for ignoreeof with handle_ignoreeof and reset EOF_Reached
back to 0 if we should not exit. This can occur when EOF delimits
a simple command (simple_command_terminator)
From a report by Grisha Levit <grishalevit@gmail.com>
5/27
----
lib/readline/mbutil.c
- _rl_get_char_len: if SRC is "", make sure to return 0
lib/readline/isearch.c
- _rl_isearch_callback: if _rl_search_getchar returns EOF, return 1
to abort search; if it returns with RL_STATE_ISEARCH unset, return
1 (handling a signal can turn it off via _rl_isearch_cleanup)
5/29
----
lib/readline/text.c
- _rl_insert_char, rl_quoted_insert: minor fixes from Grisha Levit
builtins/printf.def
- bexpand: use the same calculation for the size of the return buffer
as ansicstr().
From a report by Grisha Levit <grishalevit@gmail.com>
locale.c
- locale_setblanks: work around problem with macOS where isblank(x)
incorrectly returns true for characters 0x80-0xff in a UTF-8 locale
From a report by Grisha Levit <grishalevit@gmail.com>
- set_default_locale_vars,set_locale_vars,reset_locale_vars: make sure
we call locale_setblanks after setting/resetting locale_utf8locale,
since we use that in locale_setblanks
lib/sh/smatch.c
- charseqcmp,is_cclass,FOLD: make sure we don't treat chars >= 0x80
as valid in a UTF-8 locale, since they are multibyte characters.
From a report by Grisha Levit <grishalevit@gmail.com> with a full
explanation in http://www.openradar.me/FB9973780
5/30
----
builtins/enable.def
- enable_builtin: don't call dlopen with a null pathname, it will
succeed. Report from Wiley Young <wyeth2485@gmail.com>
lib/readline/readline.c
- _rl_dispatch_subseq: if a user binds do-lowercase-version to something
that isn't an uppercase character, flag an error rather than recurse.
From a report by Grisha Levit <grishalevit@gmail.com>
5/31
----
builtins/enable.def
- enable_builtin: don't try to load a builtin that's not found if
the -n flag is supplied.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
parse.y
- parse_comsub: use was_word code again to make sure we add a closing
`;' if the last token parsed before the closing ';' or '\n' was a
word, no matter what character ends it.
From a report by Grisha Levit <grishalevit@gmail.com>
aclocal.m4,configure.ac,findcmd.c
- IBM z/OS changes from Igor Todorovski <itodorov@ca.ibm.com>
6/1
---
parse.y
- shell_getc: if the shell is not interactive and reading from a
buffered stream or stdin, and not expanding an alias, add a
backslash to a line ending with <backslash><EOF> like we do when
reading from a string. This prevents a backslash-newline from
being discarded when we are removing backslash-newlines from the
input, since we will add a newline to shell_input_line in this case.
From a report by Rob Landley <rob@landley.net>
parse.y
- parse_compound_assignment: check and compensate for an alias being
popped out from underneath this function by read_token() (e.g.,
alias L='m=("x")'. Since we don't push a new input source, we should
never restore pushed_string_list from the saved parser state, but
we check and only do this if we were expanding an alias when this
function was called.
From a report by Wiley Young <wyeth2485@gmail.com>
6/2
---
print_cmd.c
- print_if_command: make sure to print any pending here-documents after
printing the test.
From https://bugzilla.redhat.com/show_bug.cgi?id=2211214
builtins/enable.def
- if -n is supplied with -f, attempt to load the builtin but mark it
as disabled after loading.
Suggested by Robert Elz <kre@munnari.OZ.AU>
builtins/evalfile.c
- _evalfile: increment retain_fifos, so we don't delete any FIFOs or
pipes we inherited before sourcing this file; restore original value
before we return.
From https://savannah.gnu.org/support/index.php?110883
6/3
---
subst.c
- expand_string_dollar_quote: if singlequote_translations is set, there
is a chance for a use-after-free of `t'.
From a report by Grisha Levit <grishalevit@gmail.com>
6/7
---
jobs.c,nojobs.c,jobs.h
- job_control_active_p: new function, returns 1 if job control is
currently enabled and we have given away the terminal
builtins/evalstring.c
- should_suppress_fork: don't optimize away the fork if job control is
active because we need to call end_job_control and give the terminal
back to the original process group when this command finishes. Call
job_control_active_p() to check this.
Report from Andrew Hamon <and.ham95@gmail.com>
6/8
---
shell.c
- ssh_run_startup_files: new variable, set by run_startup_files if
the shell decides it's being run by ssh and runs bashrc (only if
SSH_SOURCE_BASHRC is defined). Non-zero while the startup files
are being run. Not used by any other part of the shell yet.
6/12
----
arrayfunc.h
- new inline functions to convert between assignment flags (ASS_*),
array value flags (AV_*), and valid array flags (VA_*)
shell.h
- include arrayfunc.h after subst.h and variables.h so all the values
for the new inline functions are available
variables.c
- bind_int_variable: use convert_assign_flags_to_validarray_flags and
convert_assign_flags_to_arrayval flags instead of inline assignments
builtins/common.c
- builtin_bind_variable: use convert_assign_flags_to_validarray_flags
instead of inline assignments
arrayfunc.c
- assign_array_element: use convert_assign_flags_to_arrayval_flags
instead of inline code
- assign_array_element_internal: use convert_assign_flags_to_arrayval_flags
to pass the right values to array_expand_index
- assign_array_var_from_string: since expand_compound_array_assignment
performs one round of expansion on the subscripts, make sure to add
ASS_NOEXPAND (if assoc_expand_once is set) and ASS_ALLOWALLSUB to the
flags we pass to assign_compound_array_list
- unbind_array_index: use convert_validarray_flags_to_array_value_flags
to pass the right values to array_expand_index
- array_expand_index: uncomment code tagged for bash-5.3 that checks
AV_NOEXPAND and suppresses call to expand_arith_string if it's set.
This set of changes extends assoc_expand_once to indexed arrays
arrayfunc.[ch],execute_cmd.c,expr.c,test.c,builtins/common.c,builtins/mkbuiltins.c
builtins/declare.def,builtins/set.def,builtins/shopt.def
- array_expand_once: new name for internal assoc_expand_once variable
6/13
----
builtins/shopt.def
- array_expand_once: new option, replaces assoc_expand_once
doc/bash.1,doc/bashref.texi
- array_expand_once: document new shopt option
6/15
----
lib/readline/complete.c
- rl_full_quoting_desired: new application-settable variable, if set
to non-zero by an application completion function, all completions
will be quoted as if they were filenames, subject to the value of
rl_filename_quote_characters. Initialized to 0 and reset to 0
by set_completion_defaults.
From a contribution by Grisha Levit <grishalevit@gmail.com>
- QUOTING_DESIRED: new macro to check whether we should quote completions
lib/readline/readline.h
- rl_full_quoting_desired: extern declaration
lib/readline/doc/rltech.texi
- rl_full_quoting_desired: document
configure.ac
- bumped version to 5.3-devel
pcomplete.h
- COPT_FULLQUOTE: new compspec option, for rl_full_quoting_desired
pcomplete.c
- pcomp_set_readline_variables: set rl_full_quoting_desired according
to COPT_FULLQUOTE
builtins/complete.def
- fullquote: add new complete/compopt option value
doc/bash.1,lib/readline/doc/rluser.texi
- fullquote: document new complete/compopt option
lib/sh/timeval.c
- timeval_to_secs: sfp argument is now a long *; there is a new
maxval argument (always 10^6 for now) that determines how to
round; returns tv_usec in *sfp if maxval == 10^6; otherwise
return value is basically tv_usec/maxval with rounding
- print_timeval: change argument type in call to timeval_to_secs
lib/sh/clock.c
- clock_t_to_secs: sfp argument is now a long *
- print_clock_t: change argument type in call to clock_t_to_secs
externs.h
- timeval_to_seconds, clock_t_to_seconds: change prototypes
execute_cmd.c
- mkfmt,print_formatted_time: fractional seconds arguments are now
longs
- mkfmt: accept precisions up to 6; since sec_fraction is in usecs,
perform any necessary rounding for precisions < 6
- print_formatted_time: allow precision specifiers up to 6; default
is still 3
- time_command: fractional seconds variables are now long; add new
argument to timeval_to_secs (always 1000000)
- time_command: if we call clock_t_to_secs, multiply the return
fractional seconds value by 1000 to convert it from msec to usec
doc/bash.1,doc/bashref.texi
- TIMEFORMAT: document that the max precision is now 6
From https://savannah.gnu.org/support/?110343
6/16
----
variables.c
- get_monoseconds: use clock_gettime to return the value of the
system's monotonic clock, if available
- BASH_MONOSECONDS: a new dynamic variable that returns the value of
get_monoseconds
From a suggestion by William Kennington <wak@google.com>
doc/bash.1,doc/bashref.texi
- BASH_MONOSECONDS: document
trap.c
- save_bash_trapsig,set_bash_trapsig,restore_bash_trapsig: functions
to manage value of BASH_TRAPSIG
- run_pending_traps: save and restore the value of BASH_TRAPSIG; set
it to the numeric signal number of the trap being run while it's
executing
From a feature request by Eric Marceau <ericmarceau@rogers.com>
- _run_trap_internal,run_exit_trap: save and restore BASH_TRAPSIG;
make sure it's set appropriately
doc/bash.1,doc/bashref.texi
- BASH_TRAPSIG: document
builtins/declare.def
- declare_internal: if declare is supplied -f and an argument that
looks like an assignment statement, fail only if there is not a
function with that name already defined.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
back in 12/22
jobs.c
- wait_for: make checkwinsize work in subshell commands started from
interactive shells
New feature request by Kerin Millar <kfm@plushkava.net>
print_cmd.c
- semicolon: don't return immediately unless a preceding `&' is
itself preceded by a space, as the rest of the printing code prints
asynchronous commands.
Report and patch by Grisha Levit <grishalevit@gmail.com>
6/17
----
arrayfunc.c
- arrayvar_copyval: copy an array or hash table from shell variable
V1 to V2
arrayfunc.h
- arrayvar_copyval: extern declaration
subst.h
- ASS_NOTEMPENV: new flag for bind_variable and assignments
variables.c
- bind_variable: if ASS_NOTEMPENV is in FLAGS, don't bother calling
bind_tempenv_variable
builtins/declare.def
- declare_internal: if we find the variable in the temporary
environment, call bind_variable with the ASS_NOTEMPENV flag since
we are already dealing with a variable from the temporary environment
- declare_internal: if we bind a new global variable because we're
modifying a variable from the temporary environment, make sure to
call arrayvar_copyval to copy array variables from the temporary
environment to the global scope
variables.c
- push_temp_var: if we are pushing an array variable, make sure to
call arrayvar_copyval on the new variable
Final fix for bug reported by Wiley Young <wyeth2485@gmail.com>
- push_posix_tempvar_internal: call arrayar_copyval instead of using
inline code
6/19
----
lib/sh/shmatch.c
- sh_regmatch: use builtin_find_indexed_array to allow a local copy
of BASH_REMATCH.
From https://lists.gnu.org/archive/html/bug-bash/2022-05/msg00052.html
execute_cmd.c
- execute_in_subshell: tentative change to clear procsub list after
performing redirections, so nothing in a redirection can affect
what's in the subshell.
From https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00114.html
test.c
- binary_operator: in posix mode, the < and > operators compare strings
using the current locale (strcoll).
From https://www.austingroupbugs.net/view.php?id=375
bashline.c
- bash_default_completion: make sure that command completion adds the
trailing `/' suffix for directories even if the directory name is
the same as the common prefix of matches.
From https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00034.html
lib/readline/kill.c
- rl_vi_yank_pop: make repeated invocations of vi-yank-pop cycle
through the kill ring just like in emacs mode, even when point
is at the end of the line.
From https://lists.gnu.org/archive/html/bug-bash/2022-08/msg00105.html
parse.y
- parse_comsub: set variables if the last token (last_read_token) is
`;', `\n', or `&', in addition to was_word
- parse_comsub: if the last read token was a newline (was_newline),
terminate the comsub with a newline instead of a semicolon; keeps
the line numbers more consistent.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/sh/anonfile.c
- anonopen: use memfd_create if it is available, fall through to
traditional Unix/POSIX implementation if it fails
6/20
----
parse.y
- yy_string_unget: don't push EOF back to a string, like the other
unget functions
6/21
----
parse.y
- read_a_line: don't push an EOF back into the string or line if the
line ends in a backslash.
From a report by Rob Landley <rob@landley.net>
6/22
----
lib/readline/input.c
- rl_gather_tyi: make sure result is initialized
lib/readline/kill.c
- _rl_read_bracketed_paste_prefix: make sure key is initialized
builtins/read.def
- read_builtin: make sure pass_next and saw_escape are initialized
before a possible goto
- read_builtin: make sure to initialize prevset for very short
timeouts
subst.c
- function_substitute: make sure tflag is initialized even when we
don't call read_comsub, since we return it in ret->flags
All from a report by Grisha Levit <grishalevit@gmail.com>
builtins/complete.def
- compgen_builtin: use array_from_argv to assign elements of the
stringlist to the array variable.
Update from Grisha Levit <grishalevit@gmail.com>
builtins/cd.def
- bindpwd: fix seg fault from an unlikely set of circumstances
From a report by Grisha Levit <grishalevit@gmail.com>
arrayfunc.h
- convert_validarray_flags_to_arrayval_flags: initialize avflags
From a report by Grisha Levit <grishalevit@gmail.com>
lib/sh/anonfile.c
- anonopen: set *fn if memfd_create is used
From a report by Grisha Levit <grishalevit@gmail.com>
6/23
----
arrayfunc.c
- bind_assoc_var_internal: free key to fix small leak if assign_func
used
- quote_compound_array_word: free value to fix small leak
builtins/evalstring.c
- parse_and_execute: free parsed command on failed function definition
import
- open_redir_file: free FN if we're not passing it back to the caller
subst.c
- param_expand: free TEMP1 in code paths that don't do it now
bashline.c
- bash_command_name_stat_hook: if we modify *NAME, free the old value
examples/loadables/{kv,stat}.c
- bind_assoc_variable is caller-free VALUE, so free when needed and
don't allocate a new copy if not
All from a report by Grisha Levit <grishalevit@gmail.com>
6/24
----
lib/readline/complete.c
- rl_menu_complete: use _rl_free_match_list instead of just freeing
MATCHES if we have too many possible completions to display.
From a report by Grisha Levit <grishalevit@gmail.com>
6/25
----
eval.c
- reader_loop: make sure to allow exit builtin (code == EXITBLTIN) to
exit the shell when ignoreeof is set
From a report by Grisha Levit <grishalevit@gmail.com>
6/26
----
lib/readline/complete.c
- complete_sigcleanarg_t: new struct to hold match list and saved line
buffer for cleanup on receipt of SIGINT
- _rl_complete_sigcleanup: use new sigcleanarg_t struct and free both
members
- rl_complete_internal: whenever we display the match list, set up to
clean the matches and saved line buffer in the event of a SIGINT
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/signals.c
- _rl_handle_signal: if readline is compiled to include callbacks, only
call rl_echo_signal_char if we're not in callback mode or the
application has set rl_persistent_signal_handlers, leaving any
application signal handler to call it (or not) otherwise.
From a discussion with Andrew Burgess <aburgess@redhat.com>
lib/glob/glob.c
- glob_filename: if ARRAY == TEMP_RESULTS, make sure to free TEMP_RESULTS
after copying the filenames out of ARRAY, since we either assigned it
directly or glob_dir_to_array returned it because the dirname was
the empty string.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/rltypedefs.h
- Function: only compile in these obsolete typedefs if
WANT_OBSOLETE_TYPEDEFS is defined
print_cmd.c
- xtrace_print_assignment,xtrace_print_word_list: prioritize checking
for characters that need $'...' printing over shell metacharacters
so that strings containing both get the $'...' treatment
From a report by Grisha Levit <grishalevit@gmail.com>
6/27
----
subst.c
- skip_double_quoted: make sure to call extract_function_subst with
the SX_NOALLOC flag
From a report by Grisha Levit <grishalevit@gmail.com>
trap.c
- _run_trap_internal: if we're running a trap but shell_eof_token is
set, this means we're somehow running a trap while parsing a
command substitution (weird set of circumstances). Call
reset_parser and unset shell_eof_token if shell_eof_token is set
From a report by Wiley Young <wyeth2485@gmail.com>
builtins/setattr.def
- set_var_attribute: don't set the att_propagate attribute unless the
variable whose attribute is being modified is in the temporary
environment for this builtin, not any previous temporary environments
(like the temp env for a function call, or a special builtin like
`.')
variables.c
- push_posix_temp_var: if we have an array variable we're trying to
push up here, use arrayvar_copyval to copy the value correctly
arrayfunc.c
- arrayvar_copyval: make sure that V2 ends up being the same type of
array as V1 (att_array or att_assoc), since we're copying the value.
Fixes issue reported by Grisha Levit <grishalevit@gmail.com>, but
with the previous fix to set_var_attribute, it's not needed
- assign_compound_array_list: check for integer overflow if the max
index of the array is already INT_MAX.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
- assign_array_var_from_word_list: ditto
6/28
----
pcomplete.c,bashline.c
- uw_restore_parser_state,uw_rl_set_signals: move to bashline.c so the
general readline support can use them
bashline.h
- uw_restore_parser_state,uw_rl_set_signals: extern declarations
bashline.c
- unset_readline_variables,uw_unset_readline_variables: function to
unset READLINE_{LINE,POINT,MARK,ARGUMENT} and its unwind-protect
counterpart
- bash_execute_unix_command: add unwind-protect to free up allocated
memory
Report and patch by Grisha Levit <grishalevit@gmail.com>
doc/bash.1,doc/bashref.texi
- BASH_ARGC,BASH_ARGV,BASH_SOURCE,BASH_LINENO: note that these variables
may not be assigned to or unset
6/29
----
builtins/declare.def
- declare_internal: attempting to assign to a noassign variable is no
longer an assignment error; the attempt is just ignored
arrayfunc.c
- find_or_make_array_variable: take a new flag value, 4: means to
return noassign variables as themselves instead of NULL without
performing the assignment so the caller can handle them differently.
- assign_array_from_string: pass flags & 4 to find_or_make_array_variable
so we can simply ignore attempted assignments to noassign array
variables instead of treating them as assignment errors
From a report by Kerin Millar <kfm@plushkava.net>
expr.c
- exppower: only report negative exponent error if noeval == 0.
Fixes issue reported by Steffen Nurpmeso <steffen@sdaoden.eu>
6/30
----
lib/sh/anonfile.c
- anonopen: add support for using shm_open or shm_mkstemp to create
an anonymous file using POSIX shared memory
configure.ac
- if --enable-static-link is supplied, add -static to LDFLAGS on
Linux if opt_profiling isn't enabled
From a report from Emanuele Torre <torreemanuele6@gmail.com>
print_cmd.c
- make_command_string_internal: if we're recursively printing a list
(connection) with more than two elements, don't print any deferred
here-documents after the make_command_string_internal on the right
side of the connection unless we're at the end of the list
(printing_connection == 1). This way the caller gets to add the
appropriate connector before printing the deferred here-documents.
From a report by Grisha Levit <grishalevit@gmail.com>
- make_command_string_internal,print_group_command: after we call
PRINT_DEFERRED_HEREDOCS and follow it with a closing `)' (subshell)
or `}' (group command), we can set was_heredoc to 0 because we are
no longer printing a here-document
From a report by Grisha Levit <grishalevit@gmail.com>
7/3
---
lib/readline/complete.c
- rl_username_completion_function: simplify things by just skipping the
function body if HAVE_GETPWENT is not defined.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/sh/ufuncs.c
- fsleep: broke into three functions: nsleep, which uses nanosleep,
ssleep, which uses select/pselect, and ancientsleep, which uses
sleep. Prefer nanosleep, use the others depending on what's
defined.
From a report and patch by Grisha Levit <grishalevit@gmail.com>
arrayfunc.c
- assign_compound_array_list: now behaves more like a series of
assignment statements (a=(one two) is more like a[0]=one a[1]=two)
in terms of error handling -- break after the first invalid
assignment -- and return value -- now return int, 0 on failure and
1 on success so the callers can throw assignment errors
- assign_compound_array_list: if we have an explicit [subscript]=value
assignment, use the negative-indices-count-back-from-the-end strategy;
otherwise use last_ind and throw an error on overflow. This is like
standalone assignment statements
- assign_array_var_from_string: catch new return value from
assign_compound_array_list; return NULL if assign_compound_array_list
returns failure
subst.c
- do_compound_assignment: if assign_compound_array_list or
assign_array_var_from_string return error (0 or NULL, respectively),
treat as an assignment error similar to assigning to a readonly
variable
Inspired by a report from Emanuele Torre <torreemanuele6@gmail.com>
arrayfunc.h
- assign_compound_array_list: new return type
7/5
---
builtins/enable.def
- enable_builtin: make sure dynamic builtin loading and unloading
updates the `enabled' and `disabled' programmable completion lists.
From a report and patch by Grisha Levit <grishalevit@gmail.com>
doc/bash.1,doc/bashref.texi
- hash: add note that assigment to PATH clears the hash table.
Report by Sebastian Carlos <sebaaa1754@gmail.com>
lib/readline/complete.c
- rl_filename_completion_function: make sure the results of
*rl_filename_rewrite_hook are freed consistently if the function
returns newly-allocated memory
From a report and patch by Grisha Levit <grishalevit@gmail.com>
back in May
7/6
---
builtins/cd.def
- cd_builtin: if $OLDPWD is set by the user or script to something
that's not a full pathname, allow it to use $CDPATH.
From a report by Dustin Boyd <chronokitsune3233@gmail.com>
7/7
---
shell.h
- user_info: add members for saved uid and saved gid
shell.c
- uidget: if we have setresuid/setresgid, get the saved uid and saved
gid so we can set them if we disable privileged mode
- disable_priv_mode: only call setuid/setresuid and setgid/setresgid
if the euid (egid) != uid (gid). If we have setresuid/setresgid,
add a check whether the saved uid (gid) isn't the same as the real
uid (gid). Potentially saves a couple of system calls.
Fixes Android issue, patch by Grisha Levit <grishalevit@gmail.com>
test.c
- unary_operator: only support historical handling of -t and its
optional argument when not in posix mode
- unary_test: print an error if the argument to -t is not a number
- unary_operator: only make the argument to -t optional if the
next argument is -a or -o and we are using the historical algorithm
(argc >= 5), otherwise force it to be a number and print an error
message if it's not
From a report by Stephane Chazelas <stephane@chazelas.org>
doc/bash.1,doc/bashref.texi
- added note about test/[ sorting using the current locale with the
`<' and `>' operators when in posix mode
- added note about the integer argument to test -t being required
when in posix mode
- added note recommending against the use of test with 5 or more
arguments in favor of combining multiple instances of test with
&& or ||
From a report by Stephane Chazelas <stephane@chazelas.org>
7/10
----
jobs.c
- start_job: turn off (on) the J_ASYNC flag depending on whether the
job is being started in the foreground (background). It matters now
that we use IS_ASYNC to determine whether to give the terminal
back to the shell's process group.
From a report by Grisha Levit <grishalevit@gmail.com>
bashline.c
- command_word_completion_function: if we have a glob pattern that
expands to multiple words, dispose of the list before returning NULL.
From a report by Grisha Levit <grishalevit@gmail.com>
variables.c
- makunbound: if we're unsetting a local variable, preserve the export
attribute even if the variable's not in the temporary environment
Tentative fix, compatible with other POSIX shells (except the BSD
variants of ash)
7/12
----
lib/sh/unicode.c
- include <langinfo.h> if HAVE_LANGINFO_CODESET is defined, use
nl_langinfo (CODESET) if HAVE_LANGINFO_CODESET is define, since
we no longer check for nl_langinfo. This is what locale.c does.
7/15
----
lib/readline/display.c
- rl_redisplay: rudimentary code to handle some cases where the line
buffer consumes more than the physical number of screen lines. It's
not a screen editor, but it handles some of the common cases.
From https://bugs.launchpad.net/ubuntu/+source/bash/+bug/2024628
7/17
----
builtins/printf.def
- getwidestr: make sure to force mbsrtowcs to convert the closing NULL
so the wide-character string is NULL-terminated.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/sh/shmatch.c
- strregerror: new function to return regerror(3) error message text
in allocated memory
- sh_regmatch: add an additional argument to hold the error message
from regerror(3), in newly-allocated memory; generated by call to
strregerror() on regcomp(3) failure
From a patch by Grisha Levit <grishalevit@gmail.com>
externs.h
- sh_regmatch: update extern declaration
execute_cmd.c
- execute_cond_node: pass pointer to buffer to return any error
message; if sh_regmatch returns 2, use a non-NULL error buffer in
the error message.
lib/readline/bind.c
- _rl_get_string_variable_value: return the values for
active-region-start-color (_rl_active_region_start_color) and
active-region-end-color (_rl_active_region_end_color) if they
are set.
Fixes bind -v issue reported by Sebastian Carlos <sebaaa1754@gmail.com>
- _rl_get_string_variable_value: if the history is stifled, make
sure we report the history size as < 0 so the output of bind -v
can be reused as input.
Fixes bind -v issue reported by Sebastian Carlos <sebaaa1754@gmail.com>
7/20
----
pathexp.c
- quote_string_for_globbing: don't bother backslash-quoting multibyte
characters. It matters for macOS and doesn't make a difference for
other systems, and those aren't going to be special globbing chars.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/glob/glob.c
- glob_vector: normalize the pattern with fnx_fromfs so we make sure
it's also in NFC on macOS (other systems don't care). This is a
POSIX violation, but part of correcting the longtime HFS+ (and Finder)
misfeature
lib/readline/complete.c
- rl_filename_completion_function: if the application sets a filename
rewrite hook, use it to rewrite the filename we're matching as well
as filenames read with readdir().
[SUPERSEDED BY CHANGE OF 10/4/2023]
From a report by Grisha Levit <grishalevit@gmail.com>
7/21
----
pathexp.c
- quote_string_for_globbing: see if we can get away without backslash-
quoting single-byte characters that aren't CTLESC or characters
that are special to EREs or BREs, even if they're quoted
bashline.c
- bashline_set_filename_hooks: convenience function to set the
directory hook and the filename rewrite and stat hooks; call from
other places in the file so these are set consistently
bashline.h
- bashline_set_filename_hooks: extern declaration
builtins/complete.def
- compgen_builtin: make sure to set the directory and filename hooks
so compgen called from a script works more like compgen called
from a word completion context.
Inspired by a report by Grisha Levit <grishalevit@gmail.com>
doc/Makefile.in
- bash.pdf: use groff -T pdf to create, instead of creating postscript
and then using ghostscript
7/24
----
jobs.c
- start_job: unconditionally send SIGCONT to the job we just started,
even if we think it was already running, to reduce the window for a
potential race condition, and only change the state to RUNNING if
the SIGCONT succeeds or if the process has terminated so we can
clean it up later.
Report from Earl Chew <earl_chew@yahoo.com>
make_cmd.c
- make_simple_command,make_bare_simple_command: now take line number as
an argument; used instead of line_number to set the line associated
with the simple command
make_cmd.h
- make_simple_command,make_bare_simple_command: change prototype
parse.y,builtins/command.def,builtins.jobs.def
- make_simple_command,make_bare_simple_command: change callers
7/25
----
parse.y
- read_token_word: try to keep track of whether we are parsing the
first word of a simple command and set simplecmd_lineno if we
are. We start a simple command when we return ASSIGNMENT_WORD
or WORD in a command token position. This gives better values for
$LINENO in multi-line simple commands
- redirection: set simplecmd_lineno if it's -1, meaning this is a
simple command with a leading redirection or a null command with
only a redirection
- pass simplecmd_lineno to make_simple_command if we are starting a
simple command (the first ELEMENT)
- parse_comsub,xparse_dolparen: save and restore simplecmd_lineno
- simple_command,function_def production: reset simplecmd_lineno to -1
after parsing a simple command or a function declared as WORD()
7/26
----
doc/bash.1,doc/bashref.texi
- xpg_echo: add description of how this can be used to suppress echo
option interpretation
Inspired by report from Zachary Santer <zsanter@gmail.com>
7/27
----
builtins/printf.def
- printf_erange: make out-of-range errors conversion errors even if
the conversion function fully consumes the argument.
From a report by thomas@habets.se
7/31
----
lib/readline/rltypedefs.h
- rl_macro_print_func_t: typedef for a function to print macro key
bindings
lib/readline/bind.c
- rl_macro_display_hook: hook function to call if the application
wants to display a key sequence bound to a macro
- rl_macro_dumper: if rl_macro_display_hook is non-NULL, call it to
display the macro value (after `untranslating' it to add back any
required backslashes)
lib/readline/doc/rltech.texi
- rl_macro_display_hook: add description
pathexp.c
- glob_char_p: add the characters that are special within BRE bracket
expressions.
Inspired by a report by Grisha Levit <grishalevit@gmail.com>
bashline.c
- bind_keyseq_to_unix_command: allow whitespace to separate the keyseq
and the command string, but require the command string to be
surrounded by double quotes if it is. If we get a whitespace
separator, call rl_macro_bind so we get the string `translated'
according to how readline does it (backslash-escape sequences
processed, etc.)
- print_unix_command: function to print a key sequence and a unix
command bound to it from cmd_xmap, using a space separator
- print_unix_command_map: make sure to set rl_macro_display_hook to
print_unix_command before calling rl_macro_dumper to print the
bound command strings
8/1
---
builtins/read.def
- read_builtin: saw_escape is now a count of CTLESCs we added to the
input
- read_builtin: since we increment saw_escape when we add a CTLESC,
decrement it when we remove one from the input (\\\n, \\\0)
- read_builtin: remove the CTLESC we added if we have a backslash-
escaped NULL character ('\0')
- read_builtin: if the input ends with an unescaped newline, remove
the CTLESC we added
From a report by Grisha Levit <grishalevit@gmail.com>
8/2
---
builtins/history.def
- history_builtin: if history -[anrw] is used without a filename
argument, and HISTFILE is unset or null, return success immediately
From a report by Grisha Levit <grishalevit@gmail.com>
doc/{bash.1,bashref.texi},lib/readline/doc/hsuser.texi
- history: document that if filename is not supplied, and HISTFILE is
unset or null, the [-anrw] options have no effect
8/3
---
pcomplete.c
- gen_progcomp_completions: if the actual compspec that's run is
something different from what's typed (full pathname, alias, etc.),
set pcomp_curcmd to the word corresponding to the actual compspec,
instead of what was typed. This is what eventually gets used by
the compopt builtin's output.
From a report by Grisha Levit <grishalevit@gmail.com>
execute_cmd.c
- execute_coproc: in parent, close /dev/fd FIFOs only if we're not
executing a shell function, like other calls to unlink_fifo_list().
Report from Hal Blackburn in
https://savannah.gnu.org/support/index.php?110910
subst.c
- do_compound_assignment: don't attempt to convert a global associative
array to an indexed array with declare -g.
From a report and patch by Grisha Levit <grishalevit@gmail.com>
8/7
---
lib/readline/bind.c
- rl_print_keybinding: new function, prints a the key bindings for a
single function specified by name
- rl_function_dumper: call rl_print_keybinding for every function name
lib/readline/readline.h
- rl_print_keybinding: extern declaration
lib/readline/bind.c
- _rl_untranslate_macro_value: make sure characters betweeen 128 and
159 (metafied control characters) are printed using the \M-\C-
notation instead of directly writing the control character.
From a report and patch by Grisha Levit <grishalevit@gmail.com>
- rl_get_keyname: if a key binding shadows a function or macro, print
the ANYOTHERKEY binding as a null string
From a report and patch by Grisha Levit <grishalevit@gmail.com>
- rl_untranslate_keyseq: make changes analogous to
_rl_untranslate_macro_value so that we don't print control characters
directly
- rl_invoking_keyseqs_in_map: if the key corresponds to a keymap, use
_rl_get_keyname to get its text representation, so this function
returns consistent results
- rl_translate_keyseq: if convert-meta is on, don't convert meta chars
that are, e.g., \M-\C-@ (128) into \e followed by a NUL, resulting
in truncated key sequences. Just don't honor convert-meta in this
case
8/8
---
bashhist.c
- bash_history_no_expand_chars: add the rest of the shell
metacharacters so we don't get empty history events; tcsh does more
or less the same thing
Inspired by a report from Emanuele Torre <torreemanuele6@gmail.com>
8/9
---
parse.y
- grammar: change bare `time' and `!' productions to use nullcmd_terminator,
which is a list_terminator or a `&' to allow things like `time &'
and `! &' which the original version of POSIX interp 267 (the one
I implemented) says we should support
8/11
----
m4/bison.m4,m4/flexmember.m4,m4/locale_h.m4
- new m4 files from gettext-0.21.1
m4/gettext.m4,m4/intl.m4
m4/{codeset,extern-inline,fcntl-o,glibc2,glibc21,host-cpu-c-abi,iconv,intdiv0}.$
m4/{intl-thread-locale,intlmacosx,intmax,inttypes-pri,inttypes,inttypes_h}.m4
m4/{lcmessage,lib-ld,lib-link,lib-prefix,locale_h,lock,nls,po,printf-posix}.m4
m4/{progtest,pthread_rwlock_rdlock,size_max,stdint_h,strtoimax,threadlib}.m4
m4/{uintmax_t,ulonglong,visibility,wchar_t,wint_t,xsize}.m4
- updated m4 files from gettext-0.21.1
configure.ac,config.h.in
- updated autoconf files with changes for gettext-0.21.1
MANIFEST
- updated distribution manifest with new files from gettext-0.21.1
lib/sh/unicode.c
- u32cconv: prefer nl_langinfo to locale_charset like locale.c:
locale_isutf8()
execute_cmd.c
- uw_restore_lineno: an unwind-protect fuction to restore a saved
line_number
- execute_command: add an unwind-protect to restore line_number in
case execute_simple_command longjmps back to top_level or a
return context.
Side effect of https://savannah.gnu.org/support/index.php?110919
- execute_for_command, execute_select_command, execute_case_command:
add unwind-protect to restore line_number (could also do it for
if, while, until but those don't modify line_number)
- execute_command_internal: add_unwind_protect to restore line number
for arith, cond, function def commands
8/14
----
execute_cmd.c
- execute_simple_command: don't call savestring on the_printed_command_except_trap
if it's NULL.
From a report by Grisha Levit <grishalevit@gmail.com>
8/15
----
lib/readline/rltty.c
- prepare_terminal_settings: replace USE_XON_XOFF macro with private
variable _rl_use_tty_xon_xoff (initially set to 1); if it's set to
0 disable the tty start and stop characters. Prep for making it a
bindable variable setting
builtins/read.def
- edit_line: now takes a third argument saying whether or not to
set rl_attempted_completion_function to NULL to use readline's
default filename completion (the default)
- read_builtin: new option -E to use readline and use the bash
default completion (that is, leave rl_attempted_completion_function
unchanged)
From a suggestion by konsolebox <konsolebox@gmail.com> back in 5/2021
doc/bash.1,doc/bashref.texi
- read: document new -E option
8/17
----
aclocal.m4
- BASH_CHECK_LIB_TERMCAP: add a check for bash_cv_termcap_lib ==
"libcurses"; set TERMCAP_LIB=-lcurses in this case
8/18
----
subst.c
- bash_variable_assignment_error: new function, implements default mode
behavior for variable assignment errors
- posix_variable_assignment_error: new function, implements posix mode
behavior for variable assignment errors
- parameter_brace_expand_rhs,expand_declaration_argument,
do_assignment_statements: call posix_variable_assignment_error or
bash_variable_assignment_error as appropriate
8/21
----
lib/readline/misc.c
- _rl_arg_dispatch: add the digits or other characters to
rl_executing_keyseq if we're not calling _rl_dispatch.
From a report by Grisha Levit <grishalevit@gmail.com>
print_cmd.c
- print_simple_command: make sure that the_printed_command[0] == '\0'
if we're printing a null simple command with no words
Patch by Grisha Levit <grishalevit@gmail.com>
8/22
----
builtins/read.def
- read_builtin: make `delim' variable local, pass to edit_line to
set the last character of the returned line; change edit_line
prototype.
From a suggestion by Grisha Levit <grishalevit@gmail.com>
8/23
----
parse.y
- comsub and funsub productions: don't reset eof_encountered to 0 in
the action
subst.c
- function_substitute: unwind-protect eof_encountered so ignoreeof
doesn't keep getting reset to 0 if PS1 includes a ${ ...;} command.
From a report by Grisha Levit <grishalevit@gmail.com>
8/25
----
doc/{bash.1,bashref.texi}
- clarify the cases where arrayname[@] doesn't refer to all the
elements of an associative array (the unset builtin and test/[/[[ -v
for now)
Inspired by https://savannah.gnu.org/support/index.php?110924
8/28
----
execute_cmd.c
- execute_for_command,execute_select_command,execute_arith_command,
execute_case_command: fix up order in which BASH_COMMAND is set,
the DEBUG trap is run, and PS4 is printed.
From a report by Grisha Levit <grishalevit@gmail.com>
lib/readline/colors.c
- RL_COLOR_PREFIX_EXTENSION: make sure the custom suffix has a leading
`.'
Report and fix from Stefan Klinger <readline-gnu.org@stefan-klinger.de>
lib/readline/parse-colors.c
- free_color_ext_list: new function, called on parse error, frees the
list of extensions
- rl_reparse_colors: new public function, frees old extension list and
reparses (presumably new) value of LS_COLORS; some minimal checking
to make sure the value has really changed
9/1
---
parse.y
- time_command_acceptable: make sure `time' is recognized as a
reserved word after DOLPAREN and DOLBRACE.
Report from Dima Korobskiy <dkroot2@gmail.com>
builtins/printf.def
- printf_builtin: make 'C' equivalent to 'lc'; 'S' equivalent to 'ls'
as POSIX specifies
9/6
---
eval.c
- parse_command: don't run pending traps if we're parsing a command
substitution
From a report from Emanuele Torre <torreemanuele6@gmail.com>
9/8
---
jobs.c
- stop_pipeline: don't have the parent set the terminal pgrp; rely on
child processes to do it to avoid potential race conditions.
From a discussion beginning at
https://lists.gnu.org/archive/html/bug-bash/2023-08/msg00087.html
builtins/printf.def
- bexpand: when parsing the string to be expanded, consume entire
multibyte characters at a time, in case their encoding includes a
'\\'
- printf_builtin: when parsing the format string, consume entire
multibyte characters at a time unless they begin with '\\' or '%',
to avoid characters whose encoding contains those characters
9/11
----
builtins/hash.def
- hash_builtin: if the -p option is supplied without a name to hash,
it's an error
hashcmd.c
- phash_remove: if the hash table is empty, return 1 like unalias does
when the alias isn't in the hash table.
Report from from Mike Jonkmans <bashbug@jonkmans.nl>
9/13
----
test.c
- binary_test,unary_test: now static
- cond_test: new function, calls binary_test or unary_test as appropriate
and handles longjmps from test_syntax_error
test.h
- cond_test: extern declaration
execute_cmd.c
- execute_cond_node: call cond_test instead of binary_test or unary_test.
From a report and patch from Grisha Levit <grishalevit@gmail.com>
doc/bash.1,doc/bashref.texi
- hash: add some text about the mutual exclusivity of the -t, -p, and
-d options
9/14
----
subst.c,subst.h,externs.h
- string_extract,string_extract_verbatim,string_extract_double_quoted,
string_extract_single_quoted,skip_single_quoted,skip_double_quoted,
extract_delimited_string,extract_heredoc_dolbrace_string,
extract_dollar_brace_string,parameter_brace_expand,param_expand,
extract_command_subst,extract_function_subst,extract_arithmetic_subst,
extract_process_subst,extract_array_assignment_list,
expand_array_subscript
change function signatures to take size_t * instead of int * for
arguments that are string indices or lengths, change callers
- unquoted_substring,unquoted_member,string_extract,
string_extract_double_quoted,skip_double_quoted,
string_extract_single_quoted,skip_single_quoted,
string_extract_verbatim,extract_delimited_string,
extract_heredoc_dolbrace_string,extract_dollar_brace_string,
parameter_brace_expand,param_expand,skip_matched_pair,skip_to_delim,
skip_to_histexp,list_string,expand_string_dollar_quote,
parameter_brace_expand_rhs,expand_array_subscript,shouldexp_replacement,
expand_array_subscript,string_quote_removal: change variables used
for string indexes to size_t
[merge from size_t branch]
arrayfunc.c
- expand_compound_array_assignment: use size_t for string indices
braces.c
- brace_gobbler: use size_t for string indices
parse.y
- xparse_dolparen: change function signature to use size_t *
instead of int * for string index, use size_t for string indices
general.c, general.h
- bash_tilde_find_word: change function signature to use size_t *
instead of int * for string index
lib/readline/readline.h
- rl_reparse_colors: extern declaration
lib/readline/doc/rltech.texi
- rl_reparse_colors: document as public function
9/21
----
pcomplete.c
- it_init_aliases: move the free (alias_list) inside #ifdef ALIAS.
Report and fix from Mike Jonkmans <bashbug@jonkmans.nl>
redir.c
- redirection_error: set W_NOPROCSUB in the word redirection_error
creates to call redirection_expand
builtins/bind.def
- bind_builtin: use CASE_HELPOPT so the long doc gets printed when
--help is supplied
builtins/getopts.def
- getopts_builtin: change to use no_options()
9/22
----
execute_cmd.c
- execute_select_command: in posix mode, an invalid selection variable
name is a fatal error, just like with `for'. This is compatible with
ksh93 and mksh
9/25
----
subst.c
- parameter_brace_expand_length: rearrange the code slightly to reduce
the number of find_variable calls. This matters if the variable is
dynamic and produces a new value each time (e.g., RANDOM).
9/26
----
builtins/shift.def
- shift_builtin: if get_numeric_arg returns a number out of range and
we're going to print an error message, make sure to skip over an
argument of `--' so we can print the right argument
builtins/break.def
- break_builtin,continue_builtin: ditto with get_numeric_arg and `--'
9/28
----
builtins/history.def
- history_builtin: changed error message if the numeric argument to -d
is invalid
9/29
----
subst.c
- array_length_reference: include the open bracket in the error message
passed to err_badarraysub; it looks cleaner
10/2
----
jobs.c
- delete_all_jobs: if we are clearing the jobs list, reset the stats
about running and dead jobs and child processes
Report from Koichi Murase <myoga.murase@gmail.com>
10/4
----
lib/readline/complete.c
- rl_completion_rewrite_hook: rewrite hook applied to the completion
word before comparing against the possible completions from the
file system (modified by rl_filename_rewrite_hook)
- rl_filename_completion_function: call rl_completion_rewrite_hook,
if set by the calling application, on the filename portion of the
word to be completed
lib/readline/readline.h
- rl_completion_rewrite_hook: extern declaration
bashline.c
- bash_set_filename_hooks: set rl_completion_rewrite_hook to
bash_filename_rewrite_hook now that we've separated them
From a report and patch from Grisha Levit <grishalevit@gmail.com>;
original report from Stefan H. Holek <stefan@epy.co.at>
lib/readline/doc/rltech.texi
- rl_completion_rewrite_hook: document
10/5
----
lib/readline/complete.c
- rl_complete_internal: use `%' as an op character to indicate that
we should just display the completions, like '?' in previous versions
(nothing uses this yet)
- rl_possible_completions: set last_completion_failed to 0 before we
pass '?' to rl_complete_internal so we don't worry about trying to
insert a single completion
10/6
----
subst.c
- string_transform: use ansicstr directly for the `E' transformation
so we don't accidentally remove too many escapes.
From a report and patch from Grisha Levit <grishalevit@gmail.com>
execute_cmd.c
- execute_arith_for_command: make sure a failed init expression resets
loop_level so break and continue work correctly
From a report and patch from Grisha Levit <grishalevit@gmail.com>
- execute_for_command: set line_number for invalid identifier error
messages; restore before returning error
From a report and patch from Grisha Levit <grishalevit@gmail.com>
lib/readline/misc.c
- _rl_set_insert_mode: manage RL_STATE_OVERWRITE when modifiying
insert mode
doc/bash.1,doc/bashref.texi
- some style and formatting changes from Bjarni Ingi Gislason
<bjarniig@simnet.is>
subst.c
- getifs: now returns allocated memory to insulate it from changes to
$IFS
builtins/read.def
- read_builtin: since getifs now returns allocated memory, note when
we need to free ifs_chars and free it before returning.
Reported by Robert Elz <kre@munnari.OZ.AU> in
https://www.austingroupbugs.net/view.php?id=1778#c6513
10/7
----
pathexp.c
- glob_char_p: add more of the extglob pattern characters; it doesn't
hurt to quote them
Report and patch from Grisha Levit <grishalevit@gmail.com>
- unquoted_glob_pattern_p: don't treat a `(' immediately following a
`/' as a potential globbing character
- unquoted_glob_pattern_p: only treat the extended glob characters
followed by a `(' as a glob pattern if extended_glob is enabled
- unquoted_glob_pattern_p: an unquoted backslash isn't treated
specially any more, but if it's followed by a CTLESC, you still
don't treat the next character as an unquoted globbing char
Report and patch from Grisha Levit <grishalevit@gmail.com>
10/9
----
builtins/common.c
- get_numeric_arg: if fatal > 0, set the exit status to EX_USAGE
and call jump_to_top_level with EXITPROG or DISCARD. We don't
need to do everything that throw_to_top_level() does here (it's
really meant for signals and other exceptional failure conditions).
builtins/cd.def
- cd_builtin: exit with EX_USAGE on too many arguments
builtins/shift.def
- shift_builtin: return EX_USAGE if get_numeric_arg returns 0,
indicating that the argument wasn't a valid number
builtins/history.def
- shift_builtin: return EX_USAGE if get_numeric_arg returns 0
builtins/exit.def
- exit_or_logout: if get_exitstat (which calls get_numeric_arg) returns
a value > EX_SHERRBASE, indicating an error, just return that to
the caller and let the caller deal with it. This means that
`exit xyz' is no longer a fatal error, but can potentially cause a
non-interactive posix-mode shell to exit because exit is a special
builtin
builtins/return.def
- return_builtin: if a non-interactive shell in posix mode gets an
invalid numeric arg from get_exitstat, return immediately and let
the caller deal with exiting
All prompted by a report by Martin Schulte <gnu@schrader-schulte.de>
10/13
-----
pathexp.c
- unquoted_glob_pattern_p: restore some of the special treatment of
backslash followed by CTLESC removed on 10/7
Report and patch from Grisha Levit <grishalevit@gmail.com>
parse.y
- parse_matched_pair: don't add an extra CTLESC after reading \CTLESC,
like in other parts of the parser
subst.c
- dequote_string: don't drop trailing CTLESC in a string with more
than a single character
Report and patch from Grisha Levit <grishalevit@gmail.com>
lib/sh/strtrans.c
- ansicstr: handle $'\c^A' and $'\c^?' correctly when being expanded
by the parser (flags&2). The parser passes these as \c^A^A and
\c^A^?, respectively, so we should strip the quoting CTLESC.
Report from Grisha Levit <grishalevit@gmail.com>
subst.[ch]
- extract_dollar_brace_string: now global so brace expansion can use it
braces.c
- brace_gobbler: use extract_dollar_brace_string if we see ${ with
the appropriate value of QUOTING, so we don't have to teach brace
expansion more shell syntax.
Report from Emanuele Torre <torreemanuele6@gmail.com>
- brace_gobbler: call the word extraction functions with SX_NOALLOC
so we don't have to allocate memory we're just going to free
10/16
-----
builtins/read.def
- read_builtin: return EX_MISCERROR (2) if there is an error trying
to assign to one of the variables. This is what the newest POSIX
draft specifies.
variables.c
- dispose_variable_value: do the right thing for att_nofree vars
- makunbound: call dispose_variable_value instead of using inline code
braces.c
- brace_gobbler: make sure to set no_longjmp_on_fatal_error around
calls to extract_dollar_brace_string
10/17
-----
braces.c
- brace_gobbler: set SX_NOLONGJMP|SX_NOERROR in the flags passed
to extract_command_subst; make sure no_longjmp_on_fatal_error
is set before that call
- brace_gobbler: revert 10/13 change to use extract_dollar_brace_string
10/20
-----
parse.y
- xparse_dolparen,parse_string_to_command: if SX_NOERROR is set in
FLAGS, add PST_NOERROR to parser_state. Not much effect yet.
- parse_matched_pair: if PST_NOERROR is set in parser_state, don't
print an error message if we hit EOF, just return an error. A start
at using PST_NOERROR to suppress error messages, not just duplicate
ones. We'll see how this goes before adding more
builtins/printf.def
- decodeprec: decode the precision into an intmax_t; clamp the return
value at INT_MAX
- printf_builtin: update to posix interp 1647 (even though it's about
fprintf(3)) and output a NUL byte if %lc is supplied a null argument.
- printf_builtin: fix case where %Q is supplied with a precision in
the format string
- printf_builtin: fix case where %Q is supplied with a precision
greater than INT_MAX
- getwidestr,getwidechar: handle case where there is no argument
supplied; return NULL or NUL
- convwidestr: allow a precedence of 0 for %ls
- getint: don't call getintmax any more, just use the same code style
inline; getintmax will consume an extra argument on an error
Report and patches from Grisha Levit <grishalevit@gmail.com>
- printf_builtin: handle field width and precision overflow from
getint() by ignoring the argument (fieldwidth = 0, precision = -1)
10/26
-----
jobs.c
- wait_for: rearrange code that sets the SIGINT handler to
wait_sigint_handler and saves the old handler to old_sigint_handler
to avoid delay before assigning the handler
Report from Wenlin Kang <wenlin.kang@windriver.com>
- wait_sigint_handler: if cur_sigint_handler (what restore_sigint_handler)
just restored or ignored) is INVALID_SIGNAL_HANDLER, set the
appropriate SIGINT handler with set_sigint_handler before sending
ourselves SIGINT
10/30
-----
general.c
- legal_number: use the same test (isspace(3)) to skip trailing
whitespace that strtoimax uses to skip leading whitespace.
Report and patch from Paul Eggert <eggert@cs.ucla.edu>
general.c,general.h
- legal_number: renamed to valid_number, changed all callers
- legal_identifier: renamed to valid_identifier, changed all callers
- legal_alias_name: renamed to valid_alias_name, changed all callers
lib/sh/compat.c
- legal_number: definition of legal_number here for backwards compat
with old loadable builtins
- legal_identifier: definition of legal_identifier here for backwards
compat with old loadable builtins
- legal_alias_name: same
subst.c
- brace_expand_word_list: if brace_expand returns NULL, dummy up a
single-element vector with a copy of the original word so we can
add it to the result list unchanged.
Inspired by https://savannah.gnu.org/support/?110948
11/3
----
lib/readline/text.c
- readstr: set of functions to read a string from the keyboard, using
rl_line_buffer for temporary storage, with minimal editing and an
optional caller-supplied completion function. Doesn't use the
callback framework yet since none of the functions are public
- rl_execute_named_command: new bindable function to read a bindable
command name (from the funmap_names array) and execute it, with
command name completion on SPACE and TAB
lib/readline/readline.h
- rl_execute_named_command: new extern declaration
lib/readline/rlprivate.h
- new extern declarations for the readstr function framework
lib/readline/funmap.c
- execute-named-command: new bindable function name
lib/readline/emacs_keymap.c
- rl_execute_named_function: bound to M-x by default
lib/readline/doc/rluser.texi
- execute-named-command: document as bindable function name with its
default binding to M-x in emacs mode
11/6
----
lib/readline/search.c
- _rl_nsearch_dispatch: use ^V/^Q for rl_quoted_insert into the
search string
lib/readline/isearch.c
- _rl_isearch_dispatch: use ^V or anything bound to rl_quoted_insert
for rl_quoted_insert into the search string
lib/readline/terminal.c
- add support for new BE/BD and PS/PE bracketed-paste capabilities.
Nothing uses them yet.
11/10
-----
builtins/enable.def
- dyn_load_builtin: if we don't find a pathname argument without a
slash in BASH_LOADABLES_PATH, convert it to a pathname with a slash
before calling dlopen, to force the loader to look in the current
directory (Linux, for example, will not).
11/14
-----
examples/loadables/fdflags.c
- fdflags_builtin: only parse the setspec once, since parsing uses
strtok.
Report and patch from Emanuele Torre <torreemanuele6@gmail.com>
11/15
-----
builtins/enable.def
- dyn_load_builtin: if BASH_LOADABLES_PATH is set, use only it: don't
fall back to looking in the current directory. This changes the
historical behavior and brings the path behavior more in line with
PATH, but not CDPATH.
11/20
-----
lib/readline/complete.c
- rl_complete_internal: add `|' as a character for rl_complete_internal
that also just displays the completions, since `%' is overloaded by
rl_menu_complete
11/23
-----
examples/loadables/strptime.c
- strptime: new loadable builtin, interface to strptime(3). Takes a
date-time string as its arguments and tries to parse it according
to a number of built-in formats. If successful, it outputs the
result as a number of seconds since the epoch. Understands some
handy shorthands like "now" and "tomorrow".
11/24
-----
tests/unicode1.sub
- update the driver function using namerefs and ${!x[@]}
- zh_TW.BIG5: fixed some problems with the test encodings.
Report and patches from Grisha Levit <grishalevit@gmail.com>
11/25
-----
tests/glob2.sub
- zh_HK.big5hkscs -> zh_TW.big5 to work around macOS 14 issues with
BSD-based locale definition
bashline.c
- bash_execute_unix_command: check count != 1 instead of count > 1 to
handle negative arguments
lib/readline/bind.c
- rl_trim_arg_from_keyseq: change the parsing_digits logic to handle
multiple instances of `-' the same way rl_digit_loop does (collapse
to 1)
- rl_trim_arg_from_keyseq: fix typo to correctly recognize a `-'
after a key sequence bound to universal-argument
- rl_trim_arg_from_keyseq: trim negative argument for a key sequence
that is shadowed by a longer key sequence (ANYOTHERKEY)
Report and patches from Grisha Levit <grishalevit@gmail.com>
11/27
-----
support/shobj-conf
- solaris2: change PIC option for non-gcc Solaris 2 builds
lib/malloc/malloc.c
- binsize: make sure indexing into binsizes casts to size_t (unsigned)
examples/loadables/getconf.c
- protect more of the _SC defines with #ifdefs for different systems
examples/loadables/fdflags.c
- ALLFLAGS: add some more flag values from Solaris/AIX/HP-UX
11/28
-----
subst.c
- function_substitute: unwind return_catch_flag unconditionally
Report and patch from Grisha Levit <grishalevit@gmail.com>
- function_substitute: save getopts state and restore it if the
funsub declares a local copy of OPTIND
Report and patch from Grisha Levit <grishalevit@gmail.com>
lib/readline/display.c
- rl_redisplay: make sure lpos is initialized to 0 if local_prompt is
NULL
shell.c
- run_startup_files: make sure ssh_reading_startup_files is set to 0
in more places; still dependent on SSH_SOURCE_BASHRC
builtins/evalstring.c
- should_suppress_fork: make sure ssh_reading_startup_files is 0 in
order to suppress a fork. It will never be non-zero unless someone
enables SSH_SOURCE_BASHRC.
Fixes https://issues.redhat.com/browse/RHEL-5653
variables.c
- posix_unbind_tempvar: new function to implement POSIX interp 1009,
which says that `x=4 unset x' not only unsets the variable in the
temporary environment but the most recent scope as well.
variables.h
- posix_unbind_tempvar: extern declaration
builtins/set.def
- unset_builtin: if we are unsetting a variable that is in some
temporary environment, and the shell is in posix mode, call
posix_unbind_tempvar to implement the right posix behavior
doc/bashref.texi
- update posix mode section with change to unset for interp 1009
12/1
----
lib/readline/readline.c
- _rl_subseq_result: add check before _rl_do_lowercase_version that
_rl_to_lower actually results in a different key sequence
Report and patch from Grisha Levit <grishalevit@gmail.com>
lib/readline/isearch.c
- _rl_isearch_dispatch: if the function bound to a key and the function
bound to the result of _rl_to_lower for that key are both
rl_do_lowercase_version, just insert the key into the search string
12/5
----
parse.y,parser.h
- heredoc_string: new variable to indicate whether or not we're reading
a here-document from an alias (a pushed string). Set in
gather_here_documents individually for each call to
make_here_document.
parse.y
- read_a_line: if heredoc_string is non-zero, use shell_getc instead
of yy_getc to get the right alias processing
- shell_getc: if heredoc_string is non-zero, don't add a space to the
end of the alias -- it can mess up the here-document delimiter if
the next character is a newline
Report and sample patch from gldrk <me@rarity.fan>
parse.y,make_cmd.c
- read_a_line,make_here_document: if we're using shell_getc to read
the body of a here-document, let it manage line_number
12/8
----
bashline.c
- bash_dequote_filename: fix an off-by-one error that didn't remove a
closing single quote in a filename if it was backslash-escaped.
Report by Ole Tange <ota@prosa.dk>, fix from Grisha Levit <grishalevit@gmail.com>
lib/readline/terminal.c
- _rl_check_ansi_terminal: check whether or not rl_terminal_name
appears to be an ANSI/ECMA-48 terminal. Check some common terminal
types and then check whether some common terminal capabilities
(ce, nd, ho, up) begin with CSI (ESC-[) and then have a correct
subsequent character
- _rl_term_isansi: new variable, holds readline's idea about whether
the value of rl_terminal_name is an ANSI/ECMA-48 terminal. Initialized
to RL_ANSI_TERM_DEFAULT; set to the result of _rl_check_ansi_terminal
if initialized to 0 and on a `non-dumb' terminal
From an idea by John Tsiombikas <nuclear@mutantstargoat.com> in 11/2023
lib/readline/rlconf.h
- RL_ANSI_TERM_DEFAULT: define to 1 (yes) or 0 (no) to tell readline
whether or not to assume it's running on an ANSI/ECMA-48 terminal.
The default is 1 (yes)
12/11
-----
print_cmd.c
- make_command_string_internal: when printing a coproc, print the
coproc name only if the coproc command is not a simple command.
Report from Albert Akchurin <ackbeat@gmail.com>
12/14
-----
doc/bash.1,doc/bashref.texi
- bind: clarify meaning of `re-read' as being individual arguments
to `bind'.
Report from Dan Jacobson <jidanni@jidanni.org>
- history expansion: add that the quick substitution character is
only active when it's the first character on the line.
Suggested by Dale R. Worley <worley@alum.mit.edu>
lib/readline/histexpand.c
- history_expand: if history_quoting_state is "'", don't try to
interpret the quick substitution syntax at the start of the string.
Report from Sundeep Agarwal <learnbyexample.net@gmail.com>
execute_cmd.c,execute_cmd.h
- save_lastarg: new function, returns saved value of $_ in allocated
memory
parse.y
- execute_variable_command: instead of inline code, call save_lastarg
mailcheck.c
- check_mail: instead of inline code, call save_lastarg
- check_mail: instead of calling bind_variable, use bind_lastarg
parse.y
- decode_prompt_string: use save_lastarg() and bind_lastarg() to preserve
the value of $_ across prompt string decoding.
Patch from Grisha Levit <grishalevit@gmail.com>
12/21
-----
lib/readline/doc/readline.3
- updates to some vi-mode bindings
Patch from Josh Brobst <josh@brob.st>
builtins/setattr.def
- set_or_show_attributes: in posix mode, supplying an argument that is
not an identifier when not acting on functions is a utility error.
This will cause a non-interactive shell to exit
12/27
-----
print_cmd.c
- command_print_word_list,print_select_command_head,print_case_command_head,
print_function_def: if we're in pretty-print mode, dequote words
before printing them
Report from Seth Sabar <sethsabar@gmail.com>
shell.c
- execute_profile_file,execute_bashrc_file: separate the (duplicated)
code that sources the various profile and bashrc files out into
separate functions
- find_bashrc_file: new function, returns the name of the interactive
shell startup file that should be executed if --rcfile (--init-file)
is not supplied; currently returns DEFAULT_BASHRC
- bashrc_file: default to NULL, making it just the filename supplied as
an argument to --rcfile/--init-file
- execute_bashrc_file: execute whatever find_bashrc_file() returns
if bashrc_file is NULL
From a patch from Allison Karlitskaya <allison.karlitskaya@redhat.com>
1/3/2024
--------
print_cmd.c
- print_case_clauses: if we're printing a comsub for subsequent parsing,
don't add a newline before the first case clause, since it adds a
token after the `in' that will allow reserved words to be parsed.
Report from Oguz <oguzismailuysal@gmail.com>
1/5
---
lib/readline/doc/rltech.texi,lib/readline/doc/readline.3
- Note that since quoted characters are possible, the line readline()
returns may contain embedded newlines.
From a report by Martin Buck <mb-tmp-tah.bet@gromit.dyndns.org>
1/8
---
parse.y
- parse_compound_assignment,parse_string_to_word_list: if we call
reset_parser, directly or indirectly via yyerror, make sure to set
the pushed_strings member of the saved parser state to NULL, since
reset_parser already freed it and we don't want to try and restore
it in restore_parser_state.
From a report by Nathan Mills <the.true.nathan.mills@gmail.com>
1/10
----
builtins/hash.def, builtins/ulimit.def
- add some calls to sh_chkwrite where there is builtin output
lib/sh/eaccess.c
- sh_stat: use strcpy/strcpy when constructing pbuf instead of
strcpy/strcat
lib/sh/tmpfile.c
- sh_mktmpname,sh_mktmpfd,sh_mktmpdir: use snprintf (filename, PATH_MAX, ...)
instead of sprintf (filename, ...)
1/11
----
configure.ac
- unconditionally AC_DEFINE(PGRP_PIPE), to prevent the problem with a
pipeline and a DEBUG trap containing an external command described
in https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00037.html
1/12
----
jobs.c
- wait_for_any_job: if we're executing a funsub/varsub, do the wait
even if the jobs list is frozen, but don't remove the job from the
table or change its notification status
Report from Oguz <oguzismailuysal@gmail.com>
subst.c
- uw_unbind_variable: unset the first instance of the named variable,
don't follow namerefs. This is for REPLY in a varsub if it's made
a nameref.
Report from Oguz <oguzismailuysal@gmail.com>
shell.c
- main: call compat_init() so the linker drags in the old compatibility
functions from lib/sh/compat.c. Primarily for use by existing loadable
builtins
parse.y
- parse_compound_assignment: handle error case (wl == &parse_string_error)
before restoring the parser state from ps
Report from Grisha Levit <grishalevit@gmail.com>
1/13
----
lib/readline/complete.c
- compute_lcd_of_matches: move a strlen out of a call to MBRTOWC by
computing the length of the entire string once and then using an
offset from it while going through the loop
1/15
----
parse.y
- parse_compound_assignment: treat parsing a string following (( (read
by parse_dparen but not an arithmetic command) the same as
expanding an alias when fixing up the pushed string list
Report from Grisha Levit <grishalevit@gmail.com>
1/18
----
doc/bash.1
- typos and style fixes to satisfy groff warnings; remove uses of the
`CW' constant-width font; use .EX/.EE for examples; use consistent
style for double-quoted strings; fix inconsistent inter-paragraph
spacing
Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
1/19
----
test.c
- binary_test: make sure all calls in posix mode use TEST_LOCALE for
locale-specific string comparisons
shell.c
- find_bashrc_file: remove
1/20
----
shell.c
- exit_shell: don't try to call rl_deprep_terminal, regardless of the
readline state we inherited, if bash_readline_initialized is 0
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
- shell_reinitialize: reset startup_state and reading_shell_script to 0;
reset debugging_mode to 0
1/22
----
builtins/shopt.def
- reset_shopt_options: reset debugging_mode to 0
builtins/set.def
- reset_shell_options: reset interactive_comments to 1
braces.c
- brace_expand: if the first call to brace_gobbler consumes the entire
string, don't try to call it again
- brace_expand: check that i < tlen before checking to see if
expand_seqterm left more of the string unconsumed
- brace_gobbler: if extract_command_subst hits the end of the string
without closing the command substitution, make sure we return 0 as
well as set *i = tlen
From a fuzzing report by Nathan Mills <the.true.nathan.mills@gmail.com>
1/23
----
subst.c
- function_substitute: unwind-protect current_builtin and this_shell_builtin
like we do this_shell_function
From a fuzzing report by Nathan Mills <the.true.nathan.mills@gmail.com>
1/24
----
braces.c
- brace_gobbler: handle nofork command substitutions; skip over any
enclosed command and any braces it contains
bashline.c
- check_redir: return 0 if we're in a nofork comsub, so we will attempt
command word completion if appropriate
1/26
----
lib/readline/readline.h
- RL_STATE_READSTR: new state flag saying we are reading an arbitrary
string from the keyboard using rl_readstr
lib/readline/rlprivate.h
- READSTR_FREEPMT: new context state flag for rl_readstr; indicates
that we have allocated a new prompt with _rl_make_prompt_for_search
and we should free it with rl_restore_prompt because rl_clear_message
will not do it
lib/readline/text.c
- _rl_readstr_init,_rl_readstr_cleanup: set and unset RL_STATE_READSTR
- _rl_unsave_saved_readstr_line: free any rl_undo_list, which we may
have accumulated while reading the string, before restoring the line
Fixes leaks reported by sparrowhawk996@gmail.com.
- _rl_readstr_init: set the READSTR_FREEPMT context flag after we
call _rl_make_prompt_for_search, which calls rl_save_prompt
- _rl_readstr_sigcleanup: new function to call from signal cleanup;
restores prompt and calls _rl_readstr_cleanup to free the readstr
context
- _rl_readstr_restore: if the RL_READSTR_FREEPMT flag is set in the
context, call rl_restore_prompt to deallocate the prompt we created
lib/readline/callback.c
- rl_callback_sigcleanup: call _rl_readstr_sigcleanup to deallocate
readstr state on a signal
lib/readline/text.c
- rl_execute_named_command: free COMMAND before returning
1/27
----
lib/readline/rlprivate.h
- SF_FREEPMT: new flag for non-incremental search contexts: means we
saved the prompt data with _rl_make_prompt_for_search and need to
restore it with rl_restore_prompt, since rl_clear_message will not
lib/readline/search.c
- _rl_nsearch_sigcleanup: new function that if calls rl_restore_prompt
to clean up the saved prompt data if necessary before calling the
context cleanup function, avoids memory leak
- _rl_nsearch_init: set the SF_FREEPMPT flag after calling
_rl_make_prompt_from_search so we can clean it up properly on errors
- _rl_nsearch_abort,_rl_nsearch_dosearch: call rl_restore_prompt only
if cxt->sflags includes SF_FREEPMT, manage SF_FREEPMT state
lib/readline/signals.c
- _rl_state_sigcleanup: call _rl_nsearch_sigcleanup
lib/readline/callback.c
- _rl_callback_sigcleanup: call _rl_nsearch_sigcleanup
1/29
----
builtins/cd.def
- change_to_directory: don't try to canonicalize a NULL path that's
NULL after make_absolute.
From a report by Kerin Millar <kfm@plushkava.net>
jobs.c
- retrieve_proc_status,delete_proc_status: external interfaces to
bgp_search and bgp_delete, respectively; these take an argument
that says whether or not to block SIGCHLD
jobs.h
- retrieve_proc_status,delete_proc_status: extern declarations
builtins/wait.def
- check_bgpids: new function to check whether a requested PID is in
the bgpids table (retrieve_proc_status) and optionally delete it
if it is (posixly_correct delete_proc_status) while returning its
status. If the PID isn't in the bgpids table, return -1
- wait_builtin: if -n is supplied with pid/job arguments, use
check_bgpids to check the bgpids table for any of the requested
pids. Tagged for bash-5.3, might need another option
From a report by Steven Pelley <stevenpelley@gmail.com>
1/30
----
redir.c
- redir_open: assume the AFS bug with O_CREAT and existing files in
protected directories has been fixed over the years, so take out
the workaround.
From a report by Etienne Champetier <champetier.etienne@gmail.com>
jobs.c
- wait_for_any_job: if the jobs list is frozen and we're running a
funsub, mark the job as notified so it gets cleaned up later
- wait_for_any_job: if we're in posix mode, we should remove the job
from the job list and not add it to the bgpids list, as posix
requires
builtins/set.def
- set_shellopts: use ASS_FORCE in the call to bind_variable so we
don't have to mess with temporarily turning off readonly
builtins/shopt.def
- set_bashopts: same
Report by Emanuele Torre <torreemanuele6@gmail.com>
2/1
---
builtins/printf.def
- vblen: make it a size_t to avoid going negative on underflow
- clearerr, ferror, fflush: don't test these if vflag is set and we're
writing to a string (multiple places)
- vbprintf: pass through failure returns (< 0) from vsnprintf to the
caller(s) so we can return on errors
- printf_builtin: remove redundant test for empty or missing format
string
- PF: call builtin_error if vflag is set, sh_wrerror otherwise
(via PRETURN)
- PF: use PRETURN so we can get partial output to the variable on
error (if vflag is set)
- PRETURN: free conv_buf before attempting the write (it would get
cleaned up on the next call, but why not)
- PRETURN: clean up vbuf only if vflag is set, and clean it up on
error (it would get cleaned up on the next call, but...)
Fixes from Grisha Levit <grishalevit@gmail.com>
2/2
---
doc/bash.1,doc/bashref.texi
- word expansions: make it clearer that quote removal is one of the
shell word expansions
execute_cmd.c,execute_cmd.h
- currently_executing_command: no longer static, so other parts of
the shell can save and restore it if necessary
subst.c
- function_substitute: unwind-protect currently_executing_command,
since parse_and_execute can overwrite it in the current shell
execution context.
Report from Grisha Levit <grishalevit@gmail.com>
lib/readline/readline.c
- readline_common_teardown: new function from the guts of
readline_internal_teardown, manages and deallocates rl_undo_list.
lib/readline/callback.c
- rl_callback_handler_remove: if we're removing the line handler
while we still have an undo list, we didn't call
readline_internal_teardown. Call readline_common_teardown to manage
the undo list in case we are calling this from a signal handler
but not exiting the program.
Fixes leaks reported by sparrowhawk996@gmail.com.
variables.c
- initialize_shell_variables: use ASS_FORCE when binding SHELLOPTS or
BASHOPTS if we get them from the environment, in case they've
already been created as shell variables and set to readonly (like
changes from 1/30)
- set_ppid: use ASS_FORCE in the call to bind_variable instead of
temporarily turning off att_readonly
subst.c
- extract_delimited_string: pass FLAGS down to skip_single_quoted and
skip_double_quoted so we propagate SX_COMMAND and SX_COMPLETE
properly.
Fixes bug reported by A4-Tacks <wdsjxhno1001@163.com>
2/3
---
bashline.c
- initialize_readline: add `bash-vi-complete' as a bindable command
name so users can bind other key sequences to it
- vi_advance_point: function to advance point by one character even
in the presence of multibyte characters
- bash_vi_complete: call vi_advance_point instead of just incrementing
rl_point
2/5
---
doc/bash.1,lib/readline/doc/readline.3
- minor updates to handle old versions of troff and groff warnings
Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
2/7
---
jobs.c
- notify_of_job_status: in non-interactive shells, if we're not going
to print information about a terminated background job
(SIGINT/SIGTERM/SIGPIPE), don't mark it as notified, in the same
way that we don't mark background jobs that exit cleanly as notified
Inspired by a discussion with Robert Elz <kre@munnari.oz.au> and
https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00189.html
2/9
---
lib/readline/history.c
- DEFAULT_HISTORY_GROW_SIZE: bump up to 256
- real_history, real_history_size: the true history array and its
allocated size. the_history begins a user-visible window into this
list, extending for history_size entries
- history_list_grow_size: compute how much to extend the history list;
increase by roughly sqrt(history_size), don't extend by less than
(new) DEFAULT_HISTORY_GROW_SIZE
- history_list_resize: possibly resize/realloc real_history and reset
the_history to real_history and history_size to real_history_size
- advance_history: make the `window' that the_history provides into
real_history advance to simulate dropping an initial entry; don't
need to memmove all the entries any more
- add_history: call advance_history as necessary to move the_history
window
- add_history: call history_list_resize as necessary
Report and initial patch from Casey Johnson <strykre@hotmail.com>
2/12
----
bashline.c,lib/readline/bind.c,lib/readline/display.c
- replace some sprintf calls with snprintf to appease clang
execute_cmd.c
- execute_simple_command: unwind-protect this_command_name, since we
assign it to something we will free if unwind-protects are run
- execute_function: unwind-protect currently_executing_command, since
execute_command_internal will change it to something will will free
if unwind-protects are run
Report from Grisha Levit <grishalevit@gmail.com>
- execute_function: if we didn't compile with debugger support, restore
currently_executing_command after run_debug_trap, like in other
cases
2/13
----
builtins/declare.def
- declare_invalid_opts: move the code that checks for invalid option
combinations to its own function; it returns 0 for no errors and
a return code for declare_internal to return otherwise
Inspired by report from Grisha Levit <grishalevit@gmail.com>
- declare_invalid_opts: make -A -a and -A +A/-a +a option combinations
invalid
Report from Grisha Levit <grishalevit@gmail.com>
2/14
----
bashline.c,general.c,subst.c,lib/sh/pathphys.c,builtins/read.def,
support/bashversion.c
- changes for cygwin and msys (no new features)
bashline.c,builtins/fc.def,general.c,parse.y,stringlib.c,subst.c,variables.c
- MSYS-specific changes to support \r\n line endings and DOS-style
paths
configure.ac,cross-build/msys32.cache,support/config.rpath,support/shobj-conf
- MSYS-specific build options
configure.ac,config.h.in,m4/unlocked-io.m4,general.h,include/unlocked-io.h
MANIFEST
- adapt Gnulib's unlocked-io module for faster stdio functions.
From Grisha Levit <grishalevit@gmail.com>
lib/malloc/malloc.c,lib/malloc/table.h,lib/sh/strlcpy.c
- fixes for ISO C 23
Patch from Collin Funk <collin.funk1@gmail.com>
2/16
----
jobs.c
- waitchld: note whether or not we are executing in a signal handler
context and break out of the loop if we receive a terminating
signal instead of calling termsig_handler, which can execute unsafe
functions
From https://issues.redhat.com/browse/RHEL-22295
variables.h
- valid_readonly_attrs,invalid_readonly_attrs: new defines for declare
to use to validate attempts to modify attributes of readonly
variables
builtins/declare.def
- declare_internal: reject attempts to modify (set or unset) attributes
in invalid_readonly_attrs for readonly variables.
From a discussion with Grisha Levit <grishalevit@gmail.com>
2/17
----
variables.h
- add att_readonly to valid_readonly_attrs; it's valid to use
declare -r var ; declare -r var
Makefile.in,builtins/Makefile.in
- add unlocked-io.h to dependencies and variable contents where
appropriate
- add additional include files to INSTALLED_INCFILES
builtins/pushd.def,examples/loadables/necho.c
- fix order of includes to get unlocked-io.h
From Grisha Levit <grishalevit@gmail.com>
subst.c,subst.h
- rename quote_rhs -> quote_nosplit
2/19
----
subst.c
- quote_var_value: break the code that quotes a variable value ($x,
${x}, ${x[n]}, etc.) into a separate inline function and call it
from param_expand and parameter_brace_expand_word so they do it
consistently
- param_expand: quote $* appropriately using quote_nosplit if we are
in a place where word splitting will not occur (PF_NOSPLIT2),
expand_no_split_dollar_star == 1 but quoted is 0
- quote_var_value: use quote_nosplit if we are in a place where word
splitting will not occur (PF_NOSPLIT2) but quoted == 0.
Fixes bug with IFS=$'\1' reported by alex xmb sw ratchev <fxmbsw7@gmail.com>
arrayfunc.c
- array_value: make sure to quote ${A[*]} appropriately if not quoted
(quoted == 0) and in a place where word splitting does not occur
(flags & AV_ASSIGNRHS); the caller expects array_value to quote in
this case
subst.c
- parameter_brace_expand_word: make sure to call array_value with
AV_ASSIGNRHS if we are expanding unquoted ${A[*]} in a place where
word splitting does not occur with a non-null $IFS; array_value will
quote appropriately here
- parameter_brace_expand_word,param_expand: use quote_var_value when
expanding $N and ${N}
doc/bash.1,doc/bashref.texi
- HISTIGNORE: clarify the description a little to emphasize that lines
matching one of the patterns are not saved in the history list
From https://savannah.gnu.org/support/index.php?111020
2/20
----
builtins/evalfile.c
- FEVAL_RETRY: if set in FLAGS, _evalfile will retry an interrupted
open
- _evalfile: if open() returns -1, FEVAL_RETRY is set in FLAGS, and
errno == EINTR, retry the open after checking for interrupts or
terminating signals
- maybe_execute_file,force_execute_file: pass FEVAL_RETRY in flags
bashhist.c
- load_history: retry read_history if it returns EINTR after checking
for interrupts or terminating signals
lib/readline/bind.c
- _rl_read_init_file: retry the open once if it's interrupted due to a
signal. If we are at a point where readline has installed its
signal handlers, check for signals readline handles
From a patch from Grisha Levit <grishalevit@gmail.com>
2/21
----
subst.c
- make_internal_declare: now takes two strings of option arguments:
those to turn on (`-') and those to turn off (`+')
- expand_declaration_argument: simplify the code; handle `-' and `+'
optionsns; always call make_internal_declare
From a patch from Grisha Levit <grishalevit@gmail.com>
2/22
----
aclocal.m4
- add additional character to test for broken wcwidth (0x200b)
lib/readline/display.c
- update_line: use IS_COMBINING_CHAR instead of UNICODE_COMBINING_CHAR
plus WCWIDTH; it doesn't make sense on systems where wcwidth isn't
broken
2/27
----
print_cmd.c
- print_case_clauses: if one of the case command pattern lists begins
with the word `esac' (unquoted), precede the pattern list with `(',
since it had to be there originally to get through the parser.
Report by Emanuele Torre <torreemanuele6@gmail.com>
2/29
----
general.c,general.h
- string_to_rlimtype: takes a second ENDP argument, like strtol, so
the caller doesn't have to check that the string is all digits,
but can optionally check for and disallow a 0x prefix
3/2
---
subst.c
- dequote_list: unset the W_QUOTED flag in the word after dequoting it
- parameter_brace_expand_rhs: if the word in the list returned by
expand_string_for_rhs has W_QUOTED set, but the string being
expanded was not quoted, turn on the W_QUOTED in the returned word
so we can potentially avoid word splitting
- expand_word_internal: if CTLNUL is a IFS character, don't add quoted
null strings to istring if we're going to be word splitting, since
they will be treated as word delimiters
3/6
---
examples/loadables/getconf.c
- getconf_builtin,getconf_all: changes for POSIX interp 1808 proposal
to allow an optional pathname argument with -a that forces its use
for pathconf variables
https://www.austingroupbugs.net/view.php?id=1808
3/11
----
builtins/printf.def
- printf_builtin: %lc/%ls (%C/%S) should only work on wide characters
when in a locale where MB_CUR_MAX > 1.
Report by Emanuele Torre <torreemanuele6@gmail.com>
3/12
----
jobs.c
- notify_of_job_status: don't mark terminated background jobs or stopped
jobs as notified in shells started to run -c command
From a report by Greg Wooledge <greg@wooledge.org>
- notify_of_job_status: make the final marking the dead job as notified
a true catch-all so we can put a debugging message in there to see
if there are other missing cases
- notify_of_job_status: don't mark terminated jobs that died due to
a signal the shell trapped (on the assumption that the shell
received the signal, too) as notified, since we don't report on it
in the JDEAD case if the signal is trapped
3/13
----
builtins/printf.def
- PF: print an error message if printf returns an error or leaves
ferror(stdout) true
From a report by Paul Eggert <eggert@cs.ucla.edu>
3/14
----
builtins/printf.def
- getint: now takes an int argument and returns it if the conversion
overflows an int; changed callers in printf_builtin
- getint: consolidate checks for overflow. This changes the behavior
if the argument overflows an intmax_t: it returns a field width of
0 (the overflow result) instead of -1, which changes how printf
behaves. This is consistent with the behavior when the argument
overflows an int
- printf_builtin: change check for overflow of [LONG_MIN..LONG_MAX]
for %d/%i to be explicit instead of relying on integer overflow of p
- printstr,printwidestr: print message if field width or precision
overflow, since we don't call printf
- printstr,printwidestr: set field width and precision on integer
overflow the way we do in printf_builtin
From a report and patch by Paul Eggert <eggert@cs.ucla.edu>
bashtypes.h
- PRIdMAX: move redefinition here after including inttypes.h
builtins/printf.def,examples/loadables/seq.c,examples/loadables/getconf.h
- remove PRIdMAX redefinitions, since it's now fixed in bashtypes.h
From a report and patch by Paul Eggert <eggert@cs.ucla.edu>
3/15
----
include/stdckdint.in.h,include/intprops-internal.h
- new files, from gnulib
configure.ac
- stdckdint.h: create in the build directory if the system doesn't
provide one by copying ${srcdir}/include/stdckdint.in.h; make
sure we don't create a new one every time, changing the timestamp
Makefile.in
- CREATED_HEADERS: add stdckdint.h
stringlib.c,externs.h
- substring: now takes size_t arguments for START and END
lib/sh/stringvec.c
- strvec_create,strvec_mcreate,strvec_resize,strvec_mresize: use
ckd_mul to avoid size_t overflow
- strvec_len,strvec_flush: use size_t variable as array index
From a report by Paul Eggert <eggert@cs.ucla.edu>
bashansi.h
- stdbool.h: include if we have it, typedef bool as unsigned char if
we don't and HAVE_C_BOOL isn't defined
m4/c-bool.m4
- autoconf check for `bool' from gnulib
configure.ac
- include m4/c-bool.m4, call gl_C_BOOL; don't explicitly check for
stdbool.h using AC_CHECK_HEADERS any more
config.h.in
- HAVE_C_BOOL: define
3/16
----
builtins/printf.def
- decodeprec: now decodeint, takes new arguments: a char ** that is
the string to parse and update, an argument saying whether or not
to print an error message on overflow, and an argument that should
be the return value on overflow; use ckd_* macros to check overflow
- printstr, printwidestr: use a different mechanism to check overflow;
call decodeint to get precision and field width
braces.c
- include stdckdint.h for the ckd_* overflow checking macros
- mkseq: the width argument is now size_t
- mkseq: perform overflow detection using the ckd_* macros
- mkseq: perform zero-padding directly instead of using asprintf; the
sprintf family has trouble when width > INT_MAX
- expand_seqterm: use size_t instead of int for length and width
variables
From a report and patch by Paul Eggert <eggert@cs.ucla.edu>
3/18
----
builtins/printf.def
- printstr,bexpand: changed size/length arguments to be size_t; changed
callers
subst.c
- string_var_assignment: if the variable is a local variable at the
current scope, output a declare command even if there are no
attributes or value. Still tagged as tentative
3/23
----
test.c
- posixtest: takes an argument, the number of test arguments to parse
- two_arguments,three_arguments: use advance() instead of accessing
and manipulating pos directly
- posixtest,three_arguments,two_arguments: don't set pos = argc
directly, rely on functions to advance pos appropriately
Picked up from coreutils test
- term: if we see a left paren, scan forward for a closing right paren
and use posixtest() if there are 1-4 arguments between the parens to
avoid ambiguous behavior for expressions like true -a \( ! -a \),
which, though it's horribly ambiguous, a user would expect to
return false instead of an error message
Picked up from coreutils-9.2 test
3/25
----
bashansi.c
- HAVE_C_BOOL: prefer if defined, fall back to stdbool.h if bool isn't
a compiler builtin
braces.c
- mkseq: simplify break condition
builtins/printf.def
- decodeint: let the caller decide what to do with an overflow return,
don't return -1 after calling report_erange(). This will honor a
precision even if the field width overflows
- printf_builtin: check for overflow when adjusting precision for
string length with %Q
- printstr,printwidestr: now that the code uses decodeint, we don't
need to check the precision against INT_MAX
bashansi.h
- include stddef.h if we have it, otherwise define replacements for
NULL and offsetof()
builtins/help.def,lib/sh/fmtulong.c,lib/sh/getcwd.c,lib/sh/makepath.c,
lib/sh/snprintf.c,lib/sh/strtod.c,lib/sh/strtol.c,unwind_prot.c,
lib/readline/shell.c
- include bashansi.h instead of stddef.h, or remove a stddef.h include
if bashansi.h is already included
- remove extra definitions that appear in stddef.h or bashansi.h
lib/sh/reallocarray.c,externs.h
- implementation of reallocarray(), originally from OpenBSD, from
Paul Eggert
configure.ac
- use AC_REPLACE_FUNCS for reallocarray
xmalloc.c,xmalloc.h
- xreallocarray: implementation of reallocarray that uses xrealloc
- sh_xreallocarray: implementation of reallocarray that uses
sh_xrealloc and has file and line information for error messages
lib/sh/stringvec.c
- strvec_create, strvec_resize: rewrite in terms of xreallocarray
- strvec_mcreate, strvec_mresize: rewrite in terms of reallocarray
- strvec_remove, strvec_search, strvec_copy, strvec_from_word_list,
strvec_to_word_list: use size_t instead of int where appropriate
lib/sh/stringvec.c,externs.h
- strvec_search: return a value of type ptrdiff_t, since size_t is
unsigned and we want to return -1 if not found
All from a report and patch by Paul Eggert <eggert@cs.ucla.edu>
test.c
- term: change paren scan algorithm to count open and close parens so
we handle nested subexpressions. Still not compatible in the case
of something like test true -a \( ! -a \) \)
3/27
----
parse.y
- flush_parser_state: new function, deallocates the members of a
parser state struct that are dynamically allocated
- parse_comsub: call flush_parser_state in places where we will
return an error or jump to the top level
Fixes memory leaks on error reported by bug_reports00@protonmail.com
Makefile.in
- CREATED_MACOS: list of dSYM directories created by building and
testing
- distclean,maintainer-clean: remove $(CREATED_HEADERS) and
$(CREATED_MACOS)
- maintainer-clean: remove ctags/etags files
3/28
----
bashline.c,bashline.h
- uw_restore_parser_state: moved to parse.y and declaration to shell.h
shell.c,shell.h
- parsing_command: new flag, set to 1 when calling yyparse; saved and
restored by save_parser_state/restore_parser_state
parse.y,shell.h
- parsing_command: new element of sh_parser_state_t
sig.c
- throw_to_top_level: reset executing and parsing_command to 0
parse.y
- parse_comsub: set parsing_command to 1 before calling yyparse()
eval.c
- parse_command: set parsing_command to 1 before calling yyparse(),
restore old value when yyparse returns
subst.c
- function_substitute: if we are parsing a command, save the parser
state with save_parser_state and add an unwind-protect to restore it
From a report from Grisha Levit <grishalevit@gmail.com>
- function_substitute: only save and restore the pipestatus array if
we are not parsing a command, since save_parser_state saves it
parse.y,externs.h
- decode_prompt_string: now takes an additional argument to determine
whether this is expanding PS[0124] or the @P transformation
- decode_prompt_string: keep track of the (last) real prompt string
being decoded so a @P expansion embedded in the prompt returns the
same result as the prompt string itself for the \! and \# expansions
From a patch from Grisha Levit <grishalevit@gmail.com>
parse.y,print_cmd.c,eval.c,subst.c
- decode_prompt_string: changed all callers
3/29
----
doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/history.3
- fix some font-setting directives
- fix some word breaks for font-changing macros
lib/readline/doc/history.3
- fix the macros for function signatures for AT&T troff limitations
- fix some paragraph spacing and other layout/spacing/hyphenation
issues
Fixes from G. Branden Robinson <g.branden.robinson@gmail.com>
4/1
---
execute_cmd.c
- shell_execve: minor changes to code that checks the #! interpreter
name
execute_cmd.c
- execute_coproc: if MULTIPLE_COPROCS is not defined, close any old
file descriptors corresponding to sh_coproc. The user can still
copy them from the coproc array if desired; this prevents the shell
from hanging if a second coproc inherits file descriptors from a
previous one
From a report by Carl Edquist <edquist@cs.wisc.edu>
jobs.c,nojobs.c,jobs.h
- process_exit_status: no longer static, public function with an
extern declaration
4/2
---
execute_cmd.c,execute_cmd.h
- coproc_pidchk: now takes a full WAIT status word as a second
argument instead of just the exit status; arranged the prototype
to only be included if the source file includes posixwait.h for WAIT
jobs.c
- waitchld: call coproc_pidchk with a WAIT second argument (like
nojobs.c does)
command.h
- COPROC_STOPPED,COPROC_FOREGROUND: new flags values for coproc
execute_cmd.c
- coproc_setstatus: now takes a full WAIT status word as the second
argument, passed from coproc_pidchk
- coproc_setstatus: use process_exit_status to translate a WAIT into
an int status, doing proper termsig+128 handling
- coproc_getstate: take a WAIT and return the appropriate COPROC_
status flag (DEAD, STOPPED, etc.)
- coproc_setstatus: use coproc_getstate to set cp->c_flags
4/4
---
configure.ac
- changed release status to bash-5.3-alpha
- AC_PROG_GCC_TRADITIONAL: removed, since it no longer is supported
in autoconf-2.72 (which MacPorts upgraded me to)
test.c
- term: made change of 3/25 dependent on the compatibility level
support/config.guess,support/config.sub,support/config.rpath
- new versions, imported from gnulib
4/5
---
doc/bashref.texi
- update compatibility, posix mode, and bourne shell sections for
bash-5.3-alpha release
version.c
- update copyright date to 2024
[bash-5.3-alpha frozen]
4/6
---
builtins/cd.def
- cd_builtin: a null pathname argument is now an error; POSIX interp
1047
variables.c
- makunbound: revert change from 7/10/2023 about preserving the export
attribute when unsetting a local variable in light of POSIX interp
1806
4/8
---
bashline.c
- command_word_completion_function: we don't need to perform an extra
comparison against what rl_filename_completion_function returns if
we are searching $PATH for executable completions
- command_word_completion_function: if a directory name from $PATH
contains characters that need to be quoted, quote them and set
rl_completion_found_quote to force rl_filename_completion_function
to dequote the entire pathname
- command_word_completion_function: since the directory name from $PATH
is not quoted, use the dequoted hint to construct the full pathname
to pass to rl_filename_completion_function (possibly after quoting it)
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306043
4/10
----
redir.h
- RX_EXPANDED: flag set when translating redirects to their final form;
indicates the redirection should not be expanded again
redir.c
- do_redirection_internal: when translating a redirect into
r_err_and_out, set the RX_EXPANDED flag so the filename doesn't
get expanded again.
Fixes bug reported by squeaky <q7d9y9muja@liamekaens.com>
4/12
----
parse.y
- expecting_in_command: new variable, set to FOR or CASE depending on
which command is expecting the IN token to follow it
- {save,restore}_parser_state: save and restore expecting_in_command
in `incmd' member
- special_case_tokens: for POSIX rule 6, check expecting_in_token
instead of last_read_token/token_before_that for case/for command
and whether we should return IN and maybe set PST_CASEPAT
- special_case_tokens: reset expecting_in_command before returning DO
- read_token_word: set expecting_in_command if last_read_token was
CASE or FOR and we are returning a WORD
- reset_parser: reset expecting_in_command
- parse_comsub,parse_compound_assignment: reset expecting_in_command
Fixes bug reported by nbowler@draconx.ca
parser.h
- incmd: new member of parser_state, saves and restores the value of
expecting_in_command
- PST_FORCMD: new parser state, used to say if we're parsing a `for'
command and waiting for an IN token (not used yet)
4/22
----
config-top.h
- MULTIPLE_COPROCS: now enabled by default
4/23
----
doc/bash.1,doc/bashref.texi
- add text clarifying the difference between PIPESTATUS and $?
expr.c,redir.c,jobs.c,parse.y,arrayfunc.c,test.c,subst.c
builtins/declare.def,builtins/wait.def,builtins/printf.def
- went through and removed or modified TAGs for bash-5.3
lib/readline/bind.c
- rl_print_keybinding: handle case where there are no key sequences
bound to the command name; don't just print out every unbound key
builtins/bind.def
- bind_builtin: if the shell compatibility level is > 52, interpret
additional non-option arguments supplied with -P and -p as bindable
command names and print out any bindings for those names
4/24
----
Makefile.in,doc/Makefile.in,builtins/Makefile.in
lib/sh/Makefile.in,lib/glob/Makefile.in,lib/tilde/Makefile.in
lib/readline/Makefile.in
- MFLAGS -> BASH_MAKEFLAGS, rely on make passing MAKEFLAGS in the
environment
From a report by Cedric Blancher <cedric.blancher@gmail.com>
buildconf.h
- new build include file, construct from buildconf.h.in; contains a
subset of config.h for use by the build tools
mksyntax.c
- now assumes a C90 compilation environment; includes buildconf.h for
any build-time configuration variables
Makefile.in
- buildconf.h: add to CREATED_CONFIGURE
- mksyntax: now depends on buildconf.h instead of config.h
4/25
----
support/bashversion.c,version.c
- now assumes a C90 compilation environment; includes buildconf.h for
any build-time configuration variables
support/printenv.c,support/recho.c,support/xcase.c,support/zecho.c
- now assumes a C90 compilation environment and POSIX.1-1990 execution
environment
4/26
----
redir.h
- RX_INTERNAL, RX_USER (unused), RX_SAVCLEXEC, RX_SAVEFD, RX_EXPANDED:
new values starting at 0x80, now intended for rflags member of a
struct redirect; don't want them colliding with O_XX flags for open
and fcntl
redir.c
- rflags: save redirect->rflags and pass it to make_redirection if
we're translating a redirection into a new one
- new_redirect: pass rflags to all calls to make_redirection now that
it holds more than REDIR_VARASSIGN
- RX_INTERNAL, RX_USER (unused), RX_SAVCLEXEC, RX_SAVEFD, RX_EXPANDED:
check and assign these in the rflags member; they're only used here
- do_redirection_internal: assign new_redirect->rflags back to
redirect->rflags since it can possibly be modified with RX_EXPANDED
- do_redirection_internal: take care not to leave REDIR_VARASSIGN in
new_redirect->rflags, since it will cause redirector to be freed,
leading to accessing freed memory
From a report by Clark Wang <dearvoid@gmail.com> and a hint from
<oguzismailuysal@gmail.com> and Grisha Levit <grishalevit@gmail.com>
4/28
----
lib/sh/anonfile.c
- anonopen: call memfd_create with MFD_NOEXEC_SEAL
From a report by Kerin Millar <kfm@plushkava.net>
4/29
----
shell.c,shell.h
- su_shell: now global
variables.c
- get_bash_name: use the user's login shell for $BASH if the shell is
a login shell and the name is "-su".
From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069978
subst.c
- uw_unbind_localvar: unwind-protect to unbind a local variable at
the current function context
- function_substitute: make sure we unbind the local REPLY we created
at the current (fake) context
From a report by Koichi Murase <myoga.murase@gmail.com>
4/30
----
subst.c
- expand_arrayref: fix crash from freeing memory that's only allocated
and initialized if ARRAY_VARS is defined
Report and patch from Henrik Lindström <henrik@lxm.se>
jobs.h,jobs.c
- JLIST_POSIX: new format argument for pretty_print_job; implements
POSIX requirement that jobs display the status of all background
jobs and all jobs the user hasn't been notified about (unused yet)
- JLIST_BGONLY: new format argument for pretty_print_job; restricts
output to background jobs only (unused yet)
jobs.c,jobs.h,execute_cmd.c,subst.c
- freeze_jobs_list: now takes an int argument with the new value of
jobs_list_frozen; prep for having different values with different
meanings; changed callers
jobs.c
- wait_for_any_job: return right away if jobs_list_frozen > 0; allow
job status changes (e.g., J_NOTIFIED) if jobs_list_frozen < 0; use
this instead of testing executing_funsub directly
- notify_and_cleanup: allow notification and status change if
jobs_list_frozen < 0; don't delete any dead jobs
- should_notify: takes a job index and returns 1 if the shell would
notify the user about it, given the current job state
- pretty_print_job: if the jobs list is frozen, only print status
about jobs for which the shell would notify users (by calling
should_notify())
subst.c
- function_substitute: freeze the jobs list with value -1 so jobs
can change status and possibly inhibit printing by `jobs'
5/2
---
jobs.c
- notify_and_cleanup: allow job notifications if an interactive shell
is running a trap (interactive == 0 && interactive_shell && running_trap)
Fixes report by Koichi Murase <myoga.murase@gmail.com> on 11/14/2022
- print_pipeline: don't print an extra space before the pipeline; push
that into pretty_print_job; print the space after the pid if we
print one
jobs.h
- LONGEST_SIGNAL_DESC: update to 27 (macos SIGPROF). This changes the
test output
5/3
---
builtins/common.h
- SEVAL_NOTIFY: new flag for parse_and_execute; means we want job
notifications even though we're not interactive at this time and
would not satisfy the conditions
builtins/evalstring.c
- parse_prologue: if SEVAL_NOTIFY is supplied, unwind-protect
want_job_notifications and set it to 1
jobs.c,jobs.h.nojobs.c
- want_job_notifications: new global variable, initialized to 0
jobs.c
- notify_and_cleanup: notify about dead jobs if want_job_notifications
is non-zero
parse.y
- execute_variable_command: call parse_and_execute with the SEVAL_NOTIFY
flag
eval.c
- reader_loop: call notify_and_cleanup before executing $PROMPT_COMMAND
if the shell is interactive and prompting
trap.c
- run_pending_traps,_run_trap_internal,run_exit_trap: add SEVAL_NOTIFY
to the flags for parse_and_execute if the shell is interactive
bashline.c
- bash_execute_unix_command: add SEVAL_NOTIFY to the flags for
parse_and_execute if the shell is interactive
Rest of fix for report by Koichi Murase <myoga.murase@gmail.com>
on 11/14/2022
5/6
---
execute_cmd.c,shell.c,builtins/evalfile.c,unwind_prot.c
- change some translated error messages to make the text more uniform
and reduce the number of gettext() calls
redir.c,parse.y,bashhist.c.locale.c
builtins/common.c,builtins/bind.def,builtins/exec.def,builtins/fc.def
builtins/help.def,builtins/mapfile.def,builtins/printf.def,builtins/read.def
builtins/ulimit.def
- change some error messages to avoid having the format be the return
value from gettext() to avoid clang complaints; simplified
translatable strings and made them more uniform by removing printf
formatting directives
execute_cmd.c
- notfound_str: cache the translated version of "command not found"
so we can call gettext early on and work around a macOS misfeature
From a MacPorts ticket https://trac.macports.org/ticket/68638
forwarded by Tom <tom@msbit.com.au>
- execute_disk_command: use notfound_str instead of calling gettext
every time a command isn't found
execute_cmd.c,execute_cmd.h
- init_notfound_str: call gettext to initialize and translate
notfound_str
- execute_disk_command: call init_notfound_str before forking if it
hasn't been initialized
locale.c
- set_default_locale_vars: after we set the appropriate values for the
locale shell variables, call init_notfound_str to force a call to
gettext()
jobs.c
- wait_for: don't try to set the tty state if we're running a trap,
even if a process terminates due to a signal
5/7
---
builtins/enable.def
- enable_builtin: don't try to turn enable f into enable -f f if the
shell is restricted
5/11
----
doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/rltech.texi
- document some of the bindable commands bound to Home, End, Insert,
Page Up, and Page Down, if those keys exist
From a report by Xose Vazquez Perez <xose.vazquez@gmail.com> in 3/2024
configure
- make sure to note in CHANGES that configure now supports
--enable-year2038 for large time_t
5/14
----
pathexp.c
- glob_quote_char: new function, identify characters that should have
backslashes preserved when quoting a glob pattern. Currently has
all the glob_char_p characters plus `%' and `#' for pattern
substitution and removal.
Fixes issue reported by Andreas Schwab <schwab@suse.de>
5/16
----
pcomplete.c
- programmable_completions: change to allow a newly-loaded compspec
(after a completion function returns 124) to be used in more cases
From a patch from Grisha Levit <grishalevit@gmail.com>
mksyntax.c,version.c,support/bashversion.c
- include config.h if CROSS_COMPILING is not defined, assuming that
the build host and target host are the same
buildconf.h.in
- if cross-compiling, define _POSIX_C_SOURCE and _XOPEN_SOURCE to
get the C90/1003.1-1992 compilation environment we assume
From a report from Grisha Levit <grishalevit@gmail.com>
5/17
----
pathexp.c
- globsort_sizecmp,globsort_blockscmp: replace subtraction with a
generic transitive comparison function to avoid problems with
integer underflow
From a report from Grisha Levit <grishalevit@gmail.com>
5/20
----
lib/readline/kill.c
- _rl_bracketed_text: make sure buf is null-terminated even if
rl_read_key() returns an error
From a report from Grisha Levit <grishalevit@gmail.com>
builtins/read.def
- read_builtin: if -u and -e are both supplied, dup the file descriptor
supplied as an argument to -u and use it in the new FILE * to pass
to readline as rl_instream. Works around an android problem with
stdio and application-managed file descriptors
Report and patch from Grisha Levit <grishalevit@gmail.com>
5/21
----
lib/sh/spell.c
- mindist: don't check best unless we set it
Report and patch from Grisha Levit <grishalevit@gmail.com>
jobs.c
- make_child: if FORK_NOJOB is in the flags argument, don't call
setpgid to set the child's process group in either the parent or
child
- alloc_process,dispose_process: allocate and deallocate a PROCESS;
changed callers
subst.c
- command_substitute: call cleanup_the_pipeline after waiting for
the command substitution process, since we allocated it
5/22
----
lib/readline/text.c
- rl_execute_named_command: fix a leak if the command name is null or
the bound function doesn't return (rl_abort)
Report and patch from Grisha Levit <grishalevit@gmail.com>
bashline.c
- command_word_completion_function: free directory_part if it's left
over from a previous completion
- command_subst_completion_function: free contents of match list left
over from previous completion
- bash_spell_correct_shellword: free text if it's "" before returning
- build_history_completion_array: only call qsort if there's actually
something in the array to sort
Report and patches from Grisha Levit <grishalevit@gmail.com>
- bash_spell_correct_shellword: fix bug where we would correct the
previous word if we start on the first character of a word
- bash_spell_correct_shellword: make negative argument counts work
backwards, correcting words before point
Report from Grisha Levit <grishalevit@gmail.com>
5/23
----
lib/readline/text.c
- rl_change_case: if mbrtowc returns -1 or -2, jump to changing case
for a single character, since _rl_find_next_mbchar_internal() will
treat an invalid multibyte character as a sequence of bytes
Report from Grisha Levit <grishalevit@gmail.com>
5/25
----
execute_cmd.c
- shell_execve: fix typo in code that chops \r off the end of the #!
interpreter
Report and fix from Collin Funk <collin.funk1@gmail.com>
5/28
----
execute_cmd.c
- time_command: only restore command->flags if we haven't longjmped
Report from Michael Maurer <michael.maurer@univie.ac.at> and
Grisha Levit <grishalevit@gmail.com>
subst.c
- skip_to_delim: if we're not skipping over command substitutions
lexically, call extract_command_subst instead of using the old
extract_delimited_string
Fixes bug reported by Oguz <oguzismailuysal@gmail.com>
execute_cmd.c
- execute_arith_for_command: handle the extremely unlikely case that
the step or test expressions execute `break' or `continue' in a
nofork command substitution
Report from Oguz <oguzismailuysal@gmail.com>
5/29
----
lib/readline/complete.c
- compute_lcd_of_matches: if we have multiple matches that compare
equally when using case-insensitive completion, but are different
lengths due to the presence of multibyte characters, use the
shorter match as the common prefix to avoid overflow
Report from Grisha Levit <grishalevit@gmail.com>
5/30
----
lib/readline/text.c
- _rl_readstr_init: don't call rl_maybe_replace_line since we're not
actually moving off this history line
Report from Grisha Levit <grishalevit@gmail.com>
builtins/read.def
- read_builtin: free ifs_chars in more return code paths
Report and patch from Grisha Levit <grishalevit@gmail.com>
5/31
----
quit.h
- ZRESET: new macro, calls zreset() if interrupt_state is non-zero
lib/sh/zread.c
- zread: if read returns -1/EINTR, and we're executing a builtin,
call zreset just in case
builtins/read.def
- read_builtin: if read returns > 0 (partial read) but interrupt_state
is non-zero, we're going to call throw_to_top_level, so call
ZRESET before that happens
Report from Oguz <oguzismailuysal@gmail.com>
- read_builtin: if zread/zreadc/zreadintr/zreadcintr return -1/EINTR,
make sure we call ZRESET in case zread did not
variables.h
- ASSIGN_DISALLOWED: macro that encapsulates when an assignment to
SHELL_VAR *v with flags f will be disallowed and fail
arrayfunc.c,execute_cmd.c,expr.c,redir.c,subst.c,variables.c
builtins/delare.def,builtins/getopts.def,builtins/printf.def,builtins/read.def
- use ASSIGN_DISALLOWED where appropriate
arrayfunc.c
- assign_array_element_internal: if the assignment failed, as tested by
ASSIGN_DISALLOWED, free the assoc array key we allocated
Report from Grisha Levit <grishalevit@gmail.com>
6/3
---
variables.c
- bind_function_def: don't copy the command tree if we're overwriting
a function definition; after function binding, the function_def
struct never uses the saved command anyway
From a report and patch by Koichi Murase <myoga.murase@gmail.com>
parse.y
- make sure to free WORD in coproc WORD COMMAND after creating the
coproc struct
Report and patch from Grisha Levit <grishalevit@gmail.com>
builtins/exec.def
- exec_builtin: we don't need to set args to NULL; if shell_execve
reallocates args to add more items at the front, it has committed
to longjmp back to the top level
Report and patch from Grisha Levit <grishalevit@gmail.com>
subst.c
- expand_word_internal: dispose of the list used for $@ if we're not
splitting and save the space-separated list back to tword->word
Report and patch from Grisha Levit <grishalevit@gmail.com>
parse.y
- read_token: if we try to parse a conditional command and get a syntax
error, make sure to dispose of the partial command we created
Report and patch from Grisha Levit <grishalevit@gmail.com>
- read_token: if we try to parse a conditional command and get a syntax
error because we read an unexpected WORD, dispose of the WORD_DESC
before returning -1
Report and patch from Grisha Levit <grishalevit@gmail.com>
- cond_term: if we read a WORD where we expect something else, dispose
of the WORD_DESC before returning COND_ERROR
Report and patch from Grisha Levit <grishalevit@gmail.com>
6/10
----
parse.y
- cond_term: if we read a WORD when expecting a close paren, dispose
of the WORD_DESC before returning COND_ERROR
- error_token_from_token: use the TOK argument instead of
current_token if we can't find the token as a reserved word or
symbol
6/12
----
builtins/source.def
- source_builtin: add -p PATH option, searches PATH argument instead
of $PATH; overrides sourcepath; does not search $PWD if path search
fails
doc/bash.1,doc/bashref.texi
- source: document -p
pathexp.c
- if the size, blocks, or any of the time values compare equal, use
the name for a secondary sort key
lib/sh/winsize.c
- tcgetwinsize: provide definition for missing newly-standard function
- get_new_window_size: use tcgetwinsize
subst.c
- do_compound_assignment: if ASS_CHKLOCAL is in the flags, check for
variables at previous local scopes instead of just the current local
scope and the global scope
Part of fix for inconsistency between arrays and scalar variables
reported by Will Allan <billyzkid@yahoo.com>
builtins/declare.def
- declare_find_variable: if `declare -G' is used, check for
variables at previous local scopes instead of just the current local
scope and the global scope
Rest of fix for inconsistency between arrays and scalar variables
reported by Will Allan <billyzkid@yahoo.com>
pathexp.h
- SORT_NUMERIC: new "numeric" sort specifier
pathexp.c
- globsort_numericcmp: new sort function for the "numeric" sort
specifier: all-digit names are sorted as numbers; names containing
any non-digits sort after all-digit names and are sorted
lexicographically.
Inspired by a discussion with Robert Elz <kre@munnari.oz.au>
6/21
----
lib/readline/text.c
- rl_change_case: make mlen size_t to assign the return value from
wcrtomb; change the tests of < 0 to use MB_INVALIDCH.
Report from Siteshwar Vashisht <svashisht@redhat.com>
6/26
----
trap.c
- run_debug_trap: give the terminal back to pipeline_pgrp only if
job_control is enabled; that's the only way the trap command would
have given it to a different process group
Fixes bug reported by Mark March <march@systempad.cloud>
6/27
----
configure.ac
- remove support for cached files for cross-compiling; it's too hard
to keep them up-to-date without access to the platforms
6/28
----
lib/readline/util.c
- _rl_audit_tty: make sure to close fd before returning on error
lib/sh/casemod.c
- sh_modcase: use size_t variable as return value for wcrtomb; check
for invalid wide char and copy all characters in the multibyte
character as-is if it is
lib/sh/zwrite.c
- zwrite: use size_t and ssize_t variables
builtins/evalfile.c
- _evalfile: use size_t variable for return value from strlen()
lib/readline/funmap.c
- rl_funmap_names: don't bother calling qsort if result doesn't have
any entries
All from a report by Siteshwar Vashisht <svashisht@redhat.com>
6/29
----
lib/readline/examples/histexamp.c,lib/readline/examples/manexamp.c,
lib/readline/examples/rl-callbacktest.c,lib/readline/examples/rl-callbacktest2.c,
lib/readline/examples/excallback.c,lib/readline/examples/rlptytest.c
- small changes to fix warnings
From a report by Hiroo Hayashi <hirooih@gmail.com>
7/1
---
execute_cmd.c:
- ADJUST_LINE_NUMBER: encapsulate code that adjusts line_number in
shell functions executed in interactive shells into a macro
7/2
---
doc/bash.1,doc/bashref.texi
- changes to the --rcfile description to avoid the use of `force' and
stay away from the word `replace'
lib/readline/misc.c
- _rl_maybe_replace_line: old rl_maybe_replace_line, now takes an
argument saying whether or not to clear rl_undo_list
- rl_maybe_replace_line: now calls _rl_maybe_replace_line with a 0
argument for backwards compatibility
lib/readline/rlprivate.h
- _rl_maybe_replace_line: extern declaration
lib/readline/search.c
- _rl_nsearch_init,rl_history_search_internal: call _rl_maybe_replace_line
with a 1 argument so these searches can manage rl_undo_list and
restore it appropriately
- rl_history_search_internal: don't set the history offset back to
oldpos if the history search is successful; we want the history offset
to be set to the position of the last matching line, like isearch
7/5
---
jobs.c
- procsub_reap: new function, blocks and unblocks SIGCHLD around
call to procsub_prune
- cleanup_dead_jobs: call procsub_reap even if there are no jobs in
the jobs list or the jobs list is frozen
Inspired by report from Zachary Santer <zsanter@gmail.com>
7/6
---
subst.c,subst.h,execute_cmd.c,jobs.c
- reap_procsubs: rename to delete_procsubs
7/7
---
aclocal.m4
- BASH_CHECK_LIB_TERMCAP: check for ncursesw before ncurses, add
-lncursesw if found, to avoid pkgconfig issues for readline (since
this is a shared file)
Report and fix from Rosen Penev <rosenp@gmail.com>
7/8
---
builtins/evalstring.c
- should_optimize_fork: don't optimize the fork if we're executing in
a shell function and a return trap is set
- optimize_shell_function: mark a simple command at the end of a shell
function as a candidate for optimization, rather than setting
CMD_NO_FORK before the function executes -- it could set a return
trap
Report from Jens Schmidt <farblos@vodafonemail.de>
- parse_and_execute: don't let process substitutions or other calls
to parse_and_execute do <file; that should be reserved for command
substitutions and implemented in command_substitute
Report by Emanuele Torre <torreemanuele6@gmail.com>
- parse_string: if flags & SEVAL_ONECMD, stop after parsing a single
command, even if it doesn't consume the entire string
parse.y
- parse_string_to_command: call parse_string with SEVAL_ONECMD, since
we only want to parse a single command and make sure it consumes
the entire string, not consume the string and return the last command
parsed
7/9
---
bashline.c
- _ignore_completion_names: restrict force_fignore to act only on
completions that should be affected by FIGNORE; in other cases
act as if it were set to 1
From a report and patch by Koichi Murase <myoga.murase@gmail.com>
7/15
----
builtins/ulimit.def
- add help text saying that some of the units change in posix mode
7/17
----
subst.c
- remove some unused functions
jobs.c,jobs.h
- procsub_search,procsub_delete: now take an extra parameter saying
whether or not to block SIGCHLD while they run; avoids overhead
when called when SIGCHLD is already blocked; changed callers and
extern declaration
- struct process now has a new FLAGS member; possible values defined
in jobs.h; initialized in alloc_process
- procsub_setflag,procsub_setflag: set one of the PROC_XXX flags on
one or all of the processes in the procsub list
- new value for the flags argument to make_child: FORK_PROCSUB
- add_process: now returns the PROCESS * it creates so the caller can
set flags or otherwise modify it
- get_job_by_pid: return NO_JOB for negative pids immediately
subst.c
- process_substitute,command_substitute: call make_child with the
appropriate FORK_ flag
jobs.c
- make_child: set PROC_ flags in the PROCESS * we create based on the
FORK_ flags the caller passes
- wait_for: only call set_procsub_status if the process has terminated
- wait_for_any_job: check for any terminated procsubs as well as any
terminated background jobs
builtins/wait.def
- check_bgpids: rename to check_nonjobs
- wait_builtin: if the -n option is supplied and pid arguments are
supplied, check the bgpids list and procsubs for terminated processes
- check_nonjobs: if one of the pids in LIST corresponds to a terminated
procsub, return its status and move the procsub to the bgpids list
- set_waitlist: if we have a non-existent or invalid job, and a pid
argument that's >= 0, look for a procsub with that pid and set
PROC_WAITING if we have one
- unset_waitlist: unset PROC_WAITING in all procsubs
7/18
----
jobs.c
- procsub_prune: set last_procsub_child to NULL if we are cleaning up
that process because it's terminated, since that will invalidate the
pointer
7/22
----
lib/malloc/malloc.c
- RIGHT_BUCKET: don't check binsizes[nu-1] unless nu >= 1; clamp at 0
otherwise
- internal_realloc: don't check bucket at nunits-1 unless nunits >= 1
Report and fix from Collin Funk <collin.funk1@gmail.com>
7/25
----
variables.c
- push_source: new function, pushes a filename to BASH_SOURCE; changed
callers (shell.c, execute_cmd.c, builtins/evalfile.c)
- bash_source_fullpath: new variable, if non-zero, push_source runs
the filename through sh_realpath before pushing it to BASH_SOURCE
Feature requested by several, including konsolebox <konsolebox@gmail.com>
builtins/shopt.def
- bash_source_fullpath: new option, controls bash_source_fullpath and
whether or not BASH_SOURCE contains full pathnames
doc/bash.1,doc/bashref.texi
- bash_source_fullpath: document new shell option
7/26
----
jobs.c,jobs.h,subst.c
- last_procsub_pid: new variable, set to the pid of last_procsub_child,
so it will survive the PROCESS * being deleted if we need it. Not
used yet
7/29
----
doc/bash.1,doc/bashref.texi
- wait: update description to clarify wait -n and unify language
Inspired by report from Zachary Santer <zsanter@gmail.com>
- set: note that the -e behavior for pipelines is affected by the
state of the pipefail option
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
variables.c,hashcmd.c,builtins/hash.def,builtins/history.def,builtins/source.def
- use ABSPATH/RELPATH/absolute_program instead of testing for slash
explicitly
7/30
----
lib/readline/histfile.c
- history_do_write: return 0 immediately if nelements < 0
Report from ZeroIntensity Dev <zintensitydev@gmail.com>
8/3
---
lib/sh/zread.c,externs.h
- zungetc: new function, pushes a character back into a single char of
storage so it can be used with the zread* functions that call read(2)
directly and don't use lbuf. If we try to push back more than one
char, we use lbuf, assuming that the caller will accommodate it
builtins/read.def
- read_mbchar: if we read a partial multibyte character (-2) and then
a delimiter that makes it an invalid multibyte character (-1), use
zungetc to push the delimiter back, adjust mbchar, and return what
we read so far to be added as single bytes
From a report by Kerin Millar <kfm@plushkava.net>
8/7
---
builtins/evalstring.c
- can_optimize_connection: only check bash_input.location.string if
bash_input.type == st_string, in case we want to use this in other
contexts. If we do, the caller *must* make sure it's the last
command in the calling context
execute_cmd.c
- execute_subshell_builtin_or_function: if this is an async function
call, try to optimize away the fork before the last simple command
in the function body by calling optimize_shell_function
- execute_command_internal: if we have a simple command for which
CMD_TRY_OPTIMIZING is set in a SUBSHELL_ASYNC subshell environment,
try to set CMD_NO_FORK by checking via should_optimize_fork
8/9
---
parse.y
- yy_readline_get: before calling readline, call rl_clear_signals to
reset the signal handling disposition to a known state. Most of the
time it's a no-op
lib/readline/signals.c
- _rl_handle_signal: make the call to sigprocmask(SIG_UNBLOCK,...
more symmetric with the corresponding call to SIG_BLOCK
trap.c
- run_pending_traps: before calling run_interrupt_trap, restore
running_trap and trap_return_context, since _run_trap_internal
will save and restore them, too
builtins/read.def
- read_builtin: if -e is supplied, make sure to install unwind-protects
to reset the attempted completion function and the event hook even
if the timeout is not supplied.
Report from Oguz <oguzismailuysal@gmail.com>
8/12
----
lib/readline/histsearch.c,lib/readline/histlib.h
- history_search_internal: takes a new argument, LINEDIR, saying which
direction to perform the substring/pattern search in the line,
decoupling it from the direction through the history list; changed
all callers (history_search, history_search_prefix, _hs_history_search,
_hs_history_patsearch)
- _hs_history_search,_hs_history_patsearch: takes the same new LINEDIR
argument, just passes it to history_search_internal; changed all
callers (noninc_search_from_pos)
lib/readline/search.c
- noninc_search_from_pos: changed calls to _hs_history_search and
_hs_history_patsearch
lib/readline/histexpand.c
- get_history_event: instead of using function pointers to a history
search function, set the right flags and just call _hs_history_search
with those flags using -1 for list direction and line direction
8/13
----
builtins/printf.def
- printf_builtin: fix params to call to mklong for long double formats
if STRTOLD_BROKEN is defined
lib/sh/winsize.c
- rearrange includes to make sure <termios.h> is included if
HAVE_TCGETWINSIZE is defined
Report from Grisha Levit <grishalevit@gmail.com>
8/14
----
lib/readline/rlmbutil.h
- _rl_is_basic: adapted from gnulib is_basic; tells whether a character
is a single byte because it's guaranteed by ISO C and POSIX
lib/readline/mbutil.c
- _rl_mbstrlen: counts the number of possibly multibyte characters in a
string depending on the current locale; uses _rl_utf8_mbstrlen or
_rl_gen_mbstrlen as appropriate (or strlen for a single-byte locale)
lib/readline/readline.c
- _rl_internal_char_cleanup: if we are using multibyte characters, call
_rl_mbstrlen to determine whether or not we've read as many characters
than rl_num_chars_to_read says we should
Report from Grisha Levit <grishalevit@gmail.com>
builtins/read.def
- delim,delim_char: once again an int so we can more easily
distinguish -1 and other unsigned char values >= 0x7f; make
sure delim gets an unsigned char if passed with -d
- edit_line: now takes an int parameter for the delim char; only add
the delim to the end of the string if it's non-negative
- set_eol_delim,unset_eol_delim: now explicitly check whether or not
the delimiter character is non-negativesince it's no longer unsigned
- read_mbchar: make sure to cast the char read to unsigned before
comparing it against the delim
Report and patch from Grisha Levit <grishalevit@gmail.com>
8/15
----
include/shmbchar.h,lib/sh/shmbchar.c
- is_basic: update test for IS_BASIC_ASCII to include $, @, and `,
which ISO C guarantees to be single-byte
- is_basic_table: update bitmap to include new characters
8/21
----
shell.c
- main: make sure to set read_but_dont_execute (-n) to 0 in an
interactive shell in case it was set at invocation, but not in
cases where it was forced with -i
Report from Milana <94888u@riseup.net>
8/22
----
lib/readline/bind.c
- force-meta-prefix: new bindable variable, used to determine whether
to convert a meta character (>= 0x80) to an escape-prefixed key
sequence (using ESC as the meta prefix). If set, do the conversion
unconditionally; if unset, use the value of convert-meta as in
previous bash/readline versions
Suggestion from Reuben Thomas <rrt@sc3d.org>
- _rl_function_of_keyseq_internal: if we encounter a character/byte
with the eighth bit set, use force-meta-prefix to decide whether
to translate it to an escape-prefixed key sequence
- rl_bind_key: if we have a meta character, assume it was generated by
Meta- and honor the setting of force-meta-prefix
- rl_translate_keyseq: if we have \M-, use force-meta-prefix to decide
whether or not to translate it to an escape-prefixed key sequence
lib/readline/doc/rluser.texi,lib/readline/doc/readline.3,doc/bash.1
- force-meta-prefix: document new bindable variable and defaults
- convert-meta, enable-meta-key, input-meta, output-meta: update
description with better explanation of Meta key and meta characters,
and locale character encoding
- Key Bindings: expand description of \M- and Meta- modifiers
- Readline Introduction: expand description of the Meta key and the
various things it can do, reference force-meta-prefix and
enable-meta-key
8/26
----
doc/bashref.texi
- case: add process substitution to the list of expansions for the
word.
Reported by shynur <one.last.kiss@outlook.com>
execute_cmd.c
- execute_null_command: if an empty simple command (no words, just
redirections) requires a fork, reset top_level and exit if we
longjmp there. This can happen with an expansion error while we
evaluate the redirection.
Report from youheng.lue@gmail.com
- execute_connection: in default mode, bash performs jobs notifications
in an interactive shell between commands separated by ';' or '\n'.
It shouldn't do this in posix mode, since posix now specifies when
notifications can take place
examples/loadables/{realpath,csv,dsv,cut,stat,kv}
- changes to make them build when arrays are not available
Report from Dennis Clarke <dclarke@blastwave.org>
jobs.c
- notify_and_cleanup: make interactive shells notifying during sourced
scripts dependent on the shell compatibility level and inactive in
versions beyond bash-5.2
Inspired by report from Zachary Santer <zsanter@gmail.com>
doc/bashref.texi
- Bash posix mode: note the change with job notifications in command
lists
- Shell compatibility mode: note job notification changes for compat
level > 52
parse.y
- CHECK_FOR_RESERVED_WORD: call set_word_top here on the reserved word
token about to be returned; don't worry about trying to set it after
the fact
Report from Collin Funk <collin.funk1@gmail.com>
8/28
----
parse.y
- CHECK_FOR_RESERVED_WORD: change word_top to keep track of the line
number where a compound command begins; call set_word_top on the
current token about to be returned
- read_token_word: call set_word_top if special_case_tokens returns
something; currently used for `{'
- set_word_top: add `{' to the list of compound commands we track
- grammar: every time we parse a group command or equivalent for the
`for' and `select' compound commands, decrement word_top after we
see the `}'
- parse_dparen: set arith_lineno from word_lineno[word_top] since we
now set it for FOR when we read it
8/29
----
parse.y
- read_token: don't turn on PST_SUBSHELL after reading a left paren
if the last token was a WORD, since that's a function definition,
not a subshell
- read_token,parse_dparen: don't turn on PST_SUBSHELL if we run into
a left paren while parsing a conditional command (PST_CONDCMD is
set in parser_state)
- set_word_top: add `(' to the tokens saved in word_lineno
- grammar: decrement word_top in the subshell_command production
- read_token,parse_dparen: call set_word_top where we add PST_SUBSHELL
to parser_state
8/30
----
parse.y
- set_word_top: add COND_START to the list of tokens that set
word_lineno[word_top]
- grammar: decrement word_top after COND_END
- rename: word_lineno -> compoundcmd_lineno, word_top -> compoundcmd_top,
set_word_top -> set_compoundcmd_top
lib/readline/signals.c
- _rl_release_sigint: don't check for signals if we're already
handling a received signal
Report from Tycho Kirchner <tychokirchner@mail.de> and
Eduardo A. Bustamante López <dualbus@gmail.com>
8/31
----
builtins/printf.def
- printf_builtin: when parsing a time specification format, don't
increment the format pointer to check for 'T' unless it points
to a closing right paren, rejecting the format if it's not a `)'
when the loop breaks
Report from Andrey Kovalev <i.not.student@yandex.ru>
9/6
---
jobs.c,jobs.h
- notify_and_cleanup: now takes an argument saying which job to notify
about; if arg is -1 it notifies about all jobs as previously
- maybe_print_job_notifications: convenience function to encapsulate
policy about when to call notify_of_job_status in one place; called
by notify_and_cleanup
- notify_of_job_status,maybe_print_job_notifications: now take an int
argument with the same semantics as notify_and_cleanup
- wait_for_any_job: now call notify_of_job_status only on the job we
just retrieved and will return
- wait_for: don't call notify_and_cleanup if posixly_correct unless
the shell is not currently interactive, since posix says we can
notify in a non-interactive shell when a foreground job changes
state
jobs.c,parse.y,eval.c,execute_cmd.c,builtins/jobs.def,trap.c
- notify_and_cleanup: changed all callers appropriately
builtins/evalfile.c
- _evalfile: renamed to evalfile_internal
- evalfile_internal: increment and decrement (or unwind-protect) the
value of want_job_notifications; increment it to a non-zero value
if the shell is interactive and the compatibility level is <= 52
(see change to notify_and_cleanup of 8/26)
jobs.c
- maybe_print_job_notifications: remove clause testing sourcelevel;
use want_job_notifications for this
9/11
----
[prayers for the victims of 9/11]
9/12
----
support/mkdep
- new version from Martin Kealey; modified for inclusion
Makefile.in
- MKDEP_ variables to be able to control various aspects of `make
depend'
9/13
----
configure.ac
- relstatus: update to `beta'
9/16
----
builtins/jobs.def
- jobs_builtin: when listing individial jobs, don't call notify_and_cleanup
(which notifies about outstanding terminated jobs) if the shell is
interactive and in posix mode
9/20
----
jobs.c
- wait_for_single_pid: if wait finds a status for the pid argument in
the bgp list, remove it from the bgp list if the shell is in posix
mode
9/23
----
execute_cmd.c
- execute_command_internal: if the COMMAND * passed in to execute has
the CMD_INVERT_RETURN flag set, make sure we propagate that to
simple commands, for commands, arith for commands, select commands,
case commands, while/until commands, if commands, group commands,
shell functions, pipelines, subshells, and connections so if set -e
is enabled in the body (or test for if/while/until) its effect is
ignored
- execute_in_subshell: if the subshell's return status is being inverted,
make sure to ignore set -e in the commands the subshell executes
- execute_pipeline: if the pipeline's return status is being inverted,
make sure to ignore the effects of set -e in all pipeline elements
- execute_connection: if the list's return status is being inverted
(tough to do because of precedence), make sure the list commands
ignore the effect of set -e
9/24
----
jobs.c
- start_job: don't fetch the tty settings if we're being called from
a readline key binding (bind -x) or programmable completion
From a report by David Moberg <kaddkaka@gmail.com>
9/25
----
jobs.c
- wait_for_any_job: if the jobs table is empty and there are no
eligible procsubs, and the shell is in posix mode, take a random
pid from the bgpids table, delete it, and return its status
(since we would be deleting that pid from bgpids anyway)
9/26
----
lib/readline/histexpand.c
- history_tokenize_word: fix off-by-one error (incrementing i one too
many positions after the increment in the loop) preventing words
like `$((expr))' from being tokenized correctly
Report from Milana <94888u@riseup.net>
config.h.in,configure.ac
- new option: bash-source-fullpath-default: set it to make the
bash_source_fullpath option enabled by default; sets
BASH_SOURCE_FULLPATH_DEFAULT
Based on a patch from konsolebox <konsolebox@gmail.com>
variables.c
- bash_source_fullpath: initialize to BASH_SOURCE_FULLPATH_DEFAULT,
set by configure
doc/bashref.texi
- --enable-bash-source-default: document
9/27
----
doc/bash.1,doc/bashref.texi
- update builtins documenation: make language and paragraph breaks
more consistent between the document formats; update active
language
10/1
----
doc/bash.1,doc/bashref.texi,lib/readline/doc/rluser.texi,lib/readline/doc/hsuser.texi
- update more documentation sections to make language consistent
between formats, reduce passive voice
10/7
----
lib/readline/doc/history.3
- update history expansion section to be consistent with hsuser.texi
and bash.1
doc/bash.1,doc/bashref.texi,lib/readline/doc/rluser.texi,lib/readline/doc/readline.3
lib/readline/doc/hsuser.texi,lib/readline/doc/history.3
- next set of updates for consistency between formats, update language,
fix formatting conventions
10/11
-----
lib/readline/doc/rltech.texi,lib/readline/doc/hstech.texi
- next set of updates for consistency between formats, update language,
fix formatting conventions
10/12
-----
Makefile.in,builtins/Makefile.in
- update dependencies on readline, history include files
builtins/shopt.def
- update bash_source_fullpath reset to use new default
configure.ac
- update to use the right option name for bash-source-fullpath-default
Report and patch from Grisha Levit <grishalevit@gmail.com>
braces.c
- mkseq: fix loop condition to avoid integer overflow
Report and patch from Grisha Levit <grishalevit@gmail.com>
builtins/help.def
- show_desc: don't assume that long_doc[0] ends with a newline,
just add one manually when we hit a newline or NULL
Report and patch from Grisha Levit <grishalevit@gmail.com>
builtins/read.def
- read_builtin: don't check the timeout after breaking out of the
character read loop unless we didn't read anything (i == 0) and
the last read return EOF or error
- read_builtin: move check_read_timeout call to the end of the read
loop, after we check for the delimiter and whether or not we've
read the right number of characters, so we always return any
valid data
Report from Thomas Oettli <thomas.oettli@sfs.com>
10/14
-----
jobs.c
- wait_for_any_job: in posix mode, take any terminated pid from bgpids
before waiting for a running job to terminate
Inspired by report from Zachary Santer <zsanter@gmail.com>
10/14
-----
doc/bash.1,doc/bashref.texi
- next set of updates for consistency between formats, update language,
fix formatting conventions (job control section)
doc/bash.1,doc/bashref.texi,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi
- minor wording updates and typo fixes from
G. Branden Robinson <g.branden.robinson@gmail.com>
10/15
-----
doc/bash.1,doc/bashref.texi,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi
- wording/formatting updates and typo fixes from
G. Branden Robinson <g.branden.robinson@gmail.com>
doc/bash.1
- update .FN macro, use it consistently for filenames, like @file{}
doc/bashref.texi
- make sure to use @dots and @file consistently
doc/bash.1,lib/readline/doc/readline.3
- make sure `readline' is typeset consistently
10/18
-----
sig.c
- fix minix typo
lib/readline/history.c
- history_do_write: for portability, make sure that the offset argument
to mmap is page-aligned, since some systems (linux, macos) require it.
Report and patch from Grisha Levit <grishalevit@gmail.com>
lib/readline/util.c
- rl_tilde_expand: rearrange code to do bounds checking before data
validation when finding the end of the tilde-word to avoid
touching uninitialized data
Report and patch from Grisha Levit <grishalevit@gmail.com>
10/20
-----
doc/bash.1,doc/bashref.texi
- update word splitting section to add what IFS whitespace means and
how word splitting uses it. Based on a bug-bash discussion
10/21
-----
lib/readline/colors.c
doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi
- RL_COLOR_PREFIX_EXTENSION: remove the leading `.' again; this was
the result of a misunderstanding about how `dircolors' works
Report from Daniël Gerbrand Haasbroek <dghaasbroek@gmail.com>
lib/readline/isearch.c
- _rl_isearch_dispatch: when adding the character to the search
string, insert it as a single byte in the C locale (or if we're
not doing multibyte characters)
Report and patch from Grisha Levit <grishalevit@gmail.com>
10/23
-----
doc/bash.1,doc/bashref.texi
- SIGNALS: update section to make it clear how job control affects
SIGINT receipt and the behavior of the shell when it's waiting
for a command that receives one.
From a suggestion by Simone Robinson <robinson027@yahoo.com>
builtins/common.c
- get_job_spec: warn about deprecated notation if the job spec doesn't
have a leading `%'; code to return BAD_JOBSPEC tagged for bash-5.4
- sh_invalidjob: new convenience function to print error for invalid
job specifications
builtins/jobs.def, builtins/ kill.def, builtins/ wait.def, builtins/fg_bg.def
- handle BAD_JOBSPEC return from get_job_spec; call sh_invalidjob.
Nothing returns that yet.
builtins/kill.def
- kill_builtin: change to use common error message via sh_badpid() if
we get an argument where the first character is not a digit or `%'
builtins/jobs.def
- jobs_builtin: check for INVALID_JOB return from get_job_spec to
avoid call to get_job_by_jid
10/24
-----
error.c, error.h
- err_invalidid: common error function for invalid identifiers;
changed callers in execute_cmd.c, general.c
general.c
- valid_function_word: separated posix check against special builtin
names (flags&4) and posix check for valid identifiers (flags&1);
callers need to differentiate. This means that posix mode does not
require function names to be valid identifiers
execute_cmd.c
- execute_intern_function: don't call valid_function_word with
(flags&1) in posix mode unless POSIX_RESTRICT_FUNCNAME is defined;
call with flags&4 to keep the check against special builtin names
print_cmd.c
- print_function_def,named_function_string: don't print functions
with names that are invalid identifiers with a leading `function'
config-top.h
- POSIX_RESTRICT_FUNCNAME: placeholder, not defined by default
doc/bashref.texi
- Posix mode: remove item about function names being valid shell
identifiers
10/25
-----
aclocal.m4
- simplify the checks for the various members of struct dirent
Report and patch from Grisha Levit <grishalevit@gmail.com>
m4/strtoimax.m4
- simplify and remove redundant caching and cache check
Report and patch from Grisha Levit <grishalevit@gmail.com>
builtins/common.c
- get_exitstat: make the behavior of exit with no arguments
running in a trap action the same as return: check for any trap
(running_trap > 0) in the current execution_context. This is
POSIX interp 1602, in POSIX.1-2024
stringlib.c
- find_token_in_alist: if FLAGS is non-zero, do *not* allocate new
memory for the token. The existing behavior is to allocate memory
and return a copy of the token, and all callers pass 0
parse.y
- compoundcmd_lineno: now an array of `struct tokeninfo', which
has line number and current compound command information
- change compoundcmd_lineno[compoundcmd_top] to
compoundcmd_lineno[compoundcmd_top].lineno in all calls
- set_compoundcmd_top: in addition to assigning line number info,
assign T to compoundcmd_lineno[compoundcmd_top].token
- report_syntax_error: if we get a syntax error while looking for
shell_eof_token (comsubs), include the token we were looking for
in the error message
- report_syntax_error: if we are reporting an unexpected EOF error,
and compoundcmd_top >= 0, look up the token for the compound
command we're parsing, including `(', and change the error message
to include it
10/26
-----
Makefile.in
- PURIFY,GLOBC,GLOBO,ALLOC_FILES,LIBRARY_SOURCE: remove
- ADDON_CFLAGS,ADDON_LDDFLAGS: initialize to empty
- GRAM_H: remove from HSOURCES
- profiling-tests: use Program instead of PROGRAM
builtins/Makefile.in
- DEBUG: initialize from configure
- SYSTEM_FLAGS: remove, since it's not passed from topdir Makefile
- ADDON_CFLAGS: initialize to empty
lib/glob/Makefile.in
- ADDON_CFLAGS: initialize to empty
lib/readline/Makefile.in
- ADDON_CFLAGS: initialize to empty
- APP_CFLAGS: remove
lib/sh/Makefile.in
- DEBUG: initialize from configure
- ADDON_CFLAGS: initialize to empty
- LIBOBJDIR: initialize to empty; configure uses it in LIBOBJS
lib/tilde/Makefile.in
- ADDON_CFLAGS: initialize to empty
- CCFLAGS: add ADDON_CFLAGS, replacing ASAN_CFLAGS
support/Makefile.in
- SYSTEM_FLAGS: remove, since it's not passed from topdir Makefile
Makefiles report and patch from Grisha Levit <grishalevit@gmail.com>
version.c,shell.h
- default_compatibility_level: int variable, initialized to
DEFAULT_COMPAT_LEVEL like shell_compatibility_level
variables.c
- sv_shcompat: use default_compatibility_level instead of
DEFAULT_COMPAT_LEVEL so variables.o doesn't have to depend on
version.h
builtins/shopt.def
- set_compatibility_level: use default_compatibility_level instead
of DEFAULT_COMPAT_LEVEL so shopt.o doesn't have to depend on
version.h
- don't include version.h any more
configure.ac,Makefile.in,support/Makefile.in,doc/Makefile.in
- remove some unused variables: BASE_CFLAGS_FOR_BUILD, DEBUGGER_DIR,
INTLOBJS, TEXINDEX, TEX, MALLOC, SIGNAMES_SUPPORT
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
10/28
-----
builtins/exec.def
- exec_builtin: don't try to print an error message in the cases
where shell_execve prints one, in case we have execfail set
Report from Emanuele Torre <torreemanuele6@gmail.com>
Makefile.in
- LIBRARY_SOURCE: add back in to tags targets, add definition
Suggestion from Mike Jonkmans <bashbug@jonkmans.nl>
10/31
-----
lib/readline/search.c
- make_history_line_current: change to use the same strategy to move
to a history line as incremental search: one or more calls to
rl_get_{next,previous}_history
- dispose_saved_search_line: remove
- noninc_dosearch: no longer need to call _rl_unsave_saved_search_line
or dispose_saved_search_line; use new calling convention for
make_history_line_current
- _rl_nsearch_init: don't need to call _rl_maybe_replace_line, wait
until we move to the history line
- _rl_nsearch_dosearch: free the undo list unconditionally, since we
are committed to using the contents of rl_line_buffer as the search
string
- _rl_nsearch_dosearch: if we abort because of no search string, call
_rl_unsave_saved_search_line and let the caller clean up
- _rl_nsearch_dosearch: if the search fails, reset rl_point to the
saved point, since we will be restoring the old line
- rl_history_search_internal: don't bother to save and restore the
search line, since we don't use rl_line_buffer for anything
- rl_history_search_internal: use new calling convention for
make_history_line_current
- all these changes unify the incremental and non-incremental search
implementations
lib/readline/readline.c
- rl_initialize: reset rl_eof_found to 0 at the same time we reset
the EOF state
Report and fix from Andrew Burgess <aburgess@redhat.com> (GDB)
11/6
----
lib/readline/display.c
- rl_redisplay: if we changed screen lines during the redisplay and
we need to return to the line with the cursor, make sure to account
for differing numbers of invisible characters in the two lines
- rl_redisplay: if we need to redisplay the prompt because we moved
into a portion of it containing invisible characters while moving
to the line containing the cursor, make sure to account for the
cursor being on a line other than 0 and the prompt wrapping lines.
If it wraps, we only want to redisplay the portion after the line
wrap before the line the cursor is on
Fix for C locale issues reported by Grisha Levit <grishalevit@gmail.com>
11/7
----
lib/termcap/termcap.c
- tgetent: fix small memory leak on file open error
Makefile.in
- y.tab.h: move from CREATED_HEADERS to INSTALLED_HEADERS so we don't
clean it
- maybe-clean: slightly change the syntax of the recipe
doc/Makefile.in
- PSFILES: split into CREATED_PS and ps files from the distro
so we just remove CREATED_PS in maintainer-clean target
- PDFFILES: split into CREATED_PDF and ps files from the distro
so we just remove CREATED_PDF in maintainer-clean targets
- clean,mostlyclean: swap
- mostlyclean: don't remove Makefile
- maybe-clean: use realpath equivalent like in top-level Makefile.in
Report from Mike Jonkmans <bashbug@jonkmans.nl>
11/11
-----
Makefile.in,doc/Makefile.in,lib/glob/Makefile.in,lib/readline/Makefile.in
lib/malloc/Makefile.in.,lib/tilde/Makefile.in
- mostlyclean: swap with clean where appropriate
- add .PHONY target for clean targets where appropriate
Makefile.in,configure.ac
- STDCKDINT_H: variable for possibly-created file stdckdint.h, for
dependencies; add dependencies where appropriate
Makefile.in,doc/Makefile.in
- add various gnu-standard install targets that do nothing
11/14
-----
CHANGES,NEWS
- updated for bash-5.3-beta
11/15
-----
lib/sh/snprintf.c
- wchars: fix small memory leak by freeing lbuf if wcrtomb fails
Report from SerGoGubarev <sergeygubarev263@gmail.com>
lib/readline/complete.c
- vector_len: an inline convenience function to return the length
of an array of strings; callers are remove_duplicate_matches,
rl_old_menu_complete, rl_menu_complete
- rl_complete_internal: add `$' as a value for what_to_do that
exports a (possibly null) list of possible completions to an
application or another process by writing them, using a specific
protocol, to rl_outstream
- rl_export_completions: bindable command to perform word completion
and write the results, with other information, to rl_outstream
- _rl_export_completions: workhorse function to export the completions
Based on a patch from Matthew Tromp <matthewktromp@gmail.com>,
original request from Spencer Baugh <sbaugh@catern.com> back in 11/23
lib/readline/readline.h
- rl_export_completions: extern declaration
lib/readline/funmap.c
- export-completions: new bindable command name
doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi
- export-completions: document, including output format
11/19
-----
Makefile.in
- HYBRID_HEADERS: new variable containing header files that may appear
in the build directory or the source directory
- maybe-install-headers: rule to install header files that may appear
in the build directory or a subdirectory of it; install-headers
depends on it
- uninstall-headers: remove $(HYBRID_HEADERS); fix typo in recipe
11/21
-----
builtins/printf.def
- chk_converror: inline function to use for single place to check
for numeric overflow, change callers to use it
11/25
-----
doc/bash.1,doc/bashref.texi
- minor updates to the section on bracket expressions in pattern
matching
builtins/command.def
- update -v help string to indicate that the output is a single word
Report from Andrew Davis <addavis@gmail.com>
11/26
-----
builtins/printf.def
- chk_converr: add check for no characters being converted at all,
print same warning message as if *ep != 0. This covers the case of
an empty string argument.
Report by Paul Eggert <eggert@cs.ucla.edu>
Makefile.in,doc/Makefile.in
- uninstall: make sure the bash-specific directories created by
`make install' are emptied and removed
11/27
-----
doc/bash.1,doc/bashref.texi
lib/readline/doc/readline.3,lib/readline/doc/history.3
lib/readline/doc/rluser.texi,lib/readline/doc/rltech.texi
- another set of updates for formatting consistency, language
consistency between man pages and info files
12/1
----
lib/readline/misc.c
- rl_get_previous_history: call _rl_maybe_replace_line with arg of 1
so it clears rl_undo_list, since this may not immediately replace
rl_undo_list with something from history
Report from Grisha Levit <grishalevit@gmail.com>
12/5
----
doc/bash.1,doc/bashref.texi
lib/readline/doc/rluser.texi
- updates for active voice, future tense, formatting and fonts, edits
to Programmable Completion
Suggestions from G. Branden Robinson <g.branden.robinson@gmail.com>
12/10
-----
lib/readline/complete.c
- fnprint: make sure _rl_completion_prefix_display_length and
_rl_colored_completion_prefix are mutually exclusive, since the
callers assume they are.
bashline.c
- bash_default_completion: if we're trying to complete a glob pattern,
and rl_completion_type is '?', tell readline not to append a slash
if the pattern ends in one.
doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/rluser.texi
- completion-prefix-display-length: note that readline uses `___'
instead of an ellipsis if the filename begins with a period
All reported by Frederick Abell <fkabell3@hotmail.com>
doc/bash.1,doc/bashref.texi
- PIPESTATUS: enumerate the commands that set PIPESTATUS
From a report by Ulrich Müller <ulm@gentoo.org>
lib/readline/isearch.c
- _rl_isearch_init: change to call _rl_maybe_replace_line with arg
of 1 so rl_undo_list gets cleared (see change from 12/1)
Report from Grisha Levit <grishalevit@gmail.com>
12/13
-----
CHANGES,NEWS
- updated for bash-5.3-beta
12/15
-----
lib/readline/histexpand.c
- get_history_event: make sure we don't change history_offset whether
the search succeeds or fails, don't set it to history_length.
Callers don't expect to have the history offset changed out from
under them.
Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
12/16
-----
lib/readline/util.c
- _rl_abort_internal: make sure to clear _rl_command_to_execute
Report and patch from Grisha Levit <grishalevit@gmail.com>
tests/printf7.sub,tests/cond-regexp2.sub
- accommodate different error messages across different systems
1/2/2025
--------
tests/run-all, tests/run-minimal
- BASHOPTS: unset or unexport as appropriate, same as SHELLOPTS
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
1/9
---
subst.c
- string_extract_verbatim: take into account the fact that CTLESC can
quote multibyte characters; use ADVANCE_CHAR instead of increment
Fixes bug reported by jktseug@gmail.com
1/10
----
expr.c
- expr_bind_variable,expr_streval: suppress additional expansion if
called by the `let' builtin, whether or not array_expand_once is set
- expr_skipsubscript: suppress expansion while parsing subscripts
whether array_expand_once is set or not
Still have to change tests if this goes final
These are all conditional on shell_compatibility_level > 51
From a bug-bash post by Greg Wooledge <greg@wooledge.org>
1/14
----
lib/readline/complete.c
- _rl_export_completions: use print_filename instead of fprintf to
display the possible completions so slashes and file types can
be included
From a patch from Matthew Tromp <matthewktromp@gmail.com>
1/15
----
examples/loadables/fltexpr.c
- fltexpr: new loadable builtin to do floating-point arithmetic
expression evaluation and optionally print the result
1/16
----
builtins/printf.def
- getarg(), advancearg(): cosmetic changes to make it easier to
implement %N$ format specifiers in the future
1/18
----
subst.c
- array_length_reference: requesting the length of an element of an
unset variable using array syntax is a fatal error when `set -u'
is enabled and the subscript is not `@' or `*'.
Inspired by a report from Ian Kelling <iank@fsf.org>
1/20
----
parse.y
- decode_prompt_string: since Debian has made the spectaculary bad call
to allow arbitrary characters in usernames, protect the results of
the \u expansion in the same way as \[Ww] and \[Hh] (externally-
controlled data)
From https://savannah.gnu.org/patch/?10496
1/21
----
eval.c
- reader_loop: if we longjmp with ERREXIT, don't reset any local
function contexts in posix mode, since POSIX says to exit as if
executing the `exit builtin with no arguments'. Revision of change
from 7/2022.
From a report by Ivan Shapovalov <intelfx@intelfx.name> in 11/2024
lib/readline/display.c
- rl_redisplay: after calling update_line, when putting the cursor
where it needs to be and reprinting part of the line with the
prompt that contains invisible characters, make sure we start to
output characters at the portion in the prompt buffer that begins
on the current line and only offset by the number of invisible
characters on the current line, and set _rl_last_c_pos accordingly
in both multibyte and singlebyte locales.
Fixes bug reported by Andreas Schwab <schwab@linux-m68k.org>
1/22
----
execute_cmd.c
- execute_builtin_or_function: if we're executing the exec builtin,
and there are redirections, let exec_builtin handle disposing of
redirection_undo_list if there is no program name to execute, so
it's still there if exec returns and doesn't exit the shell.
Then we can manage disposing of exec_redirection_undo_list and
letting the redirections be undone as normal.
This is POSIX interp 1896, with modifications from
https://www.austingroupbugs.net/view.php?id=1896#c7037
builtins/exec.def
- exec_builtin: dispose of redirection_undo_list and set it to NULL
if there is no program name operand; let execute_builtin_or_function
clean it up
1/23
----
lib/readline/terminal.c
- _rl_tcgetwinsize,_rl_tcsetwinsize: function wrappers for tcgetwinsize/
tcsetwinsize with fallbacks to ioctl if those functions aren't
available
- _rl_get_screensize: use _rl_tcgetwinsize
lib/readline/rlwinsize.h
- _rl_tcgetwinsize,_rl_tcsetwinsize: extern function declarations
lib/readine/rltty.c
- set_winsize: use _rl_tcgetwinsize/_rl_tcsetwinsize
- set_winsize: if _rl_tcgetwinsize succeeds, use the values to set
readline's idea of the screen size via _rl_set_screen_size
Inspired by a discussion with Olav Mørkrid <omega@funker.no>
1/24
----
lib/readline/signals.c
- _rl_handling_signal: new private variable, set to the signal we're
currently handling in _rl_signal_handler (SIGWINCH) or
_rl_handle_signal (all others). Only valid if RL_STATE_SIGHANDLER
is set
lib/readline/rlprivate.h
- _rl_handling_signal: new extern declaration
lib/readline/rltty.c
- set_winsize: only set readline's idea of the screen size if we're
executing in a signal handler context and handling SIGTSTP and the
application has indicated that it doesn't want the environment
variables LINES and COLUMNS to have priority (rl_prefer_env_winsize)
1/30
----
jobs.c
- wait_for_single_pid: if wait_for returns -1/ECHILD, make sure to
return 257 just as if the child was not found, optionally printing
an error message if JWAIT_PERROR is supplied
From a discussion with Ian <saturns_rings@protonmail.com>
2/8
---
redir.c
- do_redirection_internal: keep track of whether the redirector fd
was active with a new variable. Not used yet, should be optimized
out.
- add_undo_fd_redirect: new undo function using r_move_input so we
don't need a dup redir and a separate close redir to undo. Not
used yet
- do_redirection_internal: only call check_bash_input if we're
creating an undo list and not running one
command.h
- OUTPUT_REDIRECT: add r_output_force
input.c
- check_bash_input: if we dup the bash input fd to another in
save_bash_input, return that fd. Continue to return -1 on error
and 0 if we don't do anything but sync
execute_cmd.c
- execute_null_command: force a subshell if any of the redirections
involve the bash input buffered fd.
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
2/10
----
examples/loadables/chmod.c
- chmod: new loadable builtin, inspired by zhixu.liu@gmail.com in
https://savannah.gnu.org/patch/?10499
2/11
----
builtins/kill.def
- kill_builtin: in posix mode, return a failure status if any of the
pid/job arguments are not found or sending the signal fails. This
is consistent with
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/kill.html#tag_20_64_14
2/12
----
braces.c
- brace_gobbler: take a new argument in which to return the type of
brace expansion (comma or sequence) we think we've found; change
all callers
- brace_expand: even if we find a BRACE_ARG_SEPARATOR, don't try to
perform expansion if brace_gobbler doesn't think we have a
BRACE_COMMA expansion
- valid_seqterm: new function, performs minimal validation on a
sequence expansion, used to skip over invalid sequence expressions
in brace_expand
- brace_expand: call valid_seqterm if brace_gobbler finds a BRACE_SEQ
expansion
Inspired by report from Robert Elz <kre@munnari.oz.au>
2/13
----
doc/bash.1,doc/bashref.texi
- clarified the handling of double quotes in EXPRESSION in
(( EXPRESSION )) and $(( EXPRESSION )) to say that only unescaped
double quotes are removed
expr.c
- expr_bind_variable,expr_streval: revert change from 1/10 that
suppresses additional expansion when called by the `let' builtin,
tag for possible inclusion in a future release when I can look
at parallel changes to ((...)) and $((...)) (and probably
declare 'a[" "]=12' or similar)
2/14
----
lib/sh/zmapfd.c,externs.h
- zmapfd: now returns ssize_t in case of large files when size_t is
larger than int
builtins/evalfile.c,builtins/help.def
- zmapfd: changed callers
print_cmd.c
- print_redirection: the default file descriptor for <> is 0
Report and fix from Emanuele Torre <torreemanuele6@gmail.com>
2/18
----
configure.ac
- check for d_type member of struct dirent for future use
2/24
----
doc/bash.1,doc/bashref.texi
- document the word expansions performed on indexed array subscripts
and assoc array keys
- document the possibility and effect of empty strings on arithmetic
evaluation for substring expansion, arithmetic expansion, operands
to the the [[ command's arithmetic operators, the expression in
the (( compound command, and indexed array subscripts
2/24
----
execute_cmd.c
- execute_command_internal: if executing a (...) subshell, make sure
to update BASH_COMMAND before exiting on an error return from the
subshell with -e set
Report from Max Bowsher <maxbowsher@gmail.com>
3/3
---
redir.c
- here_document_to_fd: if we are trying to use a pipe for a here
document, but the F_GETPIPE_SZ fcntl returns a value shorter than
the here document length, make sure to close the pipe file descriptors
builtins/ulimit.def
- pipesize: use pathconf and _PC_PIPE_BUF if available
3/8
---
braces.c
- brace_expand: make sure to call valid_seqterm with the right length
so that text[tlen] == '}'
3/10
----
builtins/help.def
- show_manpage: if the first line of long_doc doesn't contain a
newline, e.g., if it's a loadable builtin, add one so there's the
usual space between NAME and SYNOPSIS
m4/codeset.m4
- define HAVE_NL_LANGINFO
lib/sh/strftime.c
- updates for locale-awareness
3/14
----
lib/termcap/termcap.c,lib/termcap/tparam.c
- updates for ISO C
3/17
----
configure.ac
- update release to rc1, update CHANGES and NEWS
3/19
----
lib/readline/rlmbutil.h
- _rl_wcwidth: make sure wchar_t constants have an `L' prefix
3/24
----
subst.c
- function_substitute: set temporary_env to NULL (we've already
set up an unwind-protect for it) before pushing the context, so
pop_context doesn't free it out from underneath the caller.
Report from Emanuele Torre <torreemanuele6@gmail.com>
3/27
----
shell.c
- set_bash_input: if the call to with_input_from_buffered_stream does
not result in a valid buffer corresponding to the file descriptor,
print an error message and set last_command_exit_value
From a report in https://savannah.gnu.org/patch/?10512
4/3
---
lib/sh/gettimeofday.c
- updated from version in gnulib
[bash-5.3-rc1 frozen]
4/4
---
examples/loadables/fltexpr.c
- add support for function calls; support almost all math function
calls in math.h
- add support for pi, gamma, e mathematical constants
4/7
---
doc/bash.1,doc/bashref.texi
- HISTFILESIZE: note that the history file will contain complete
history entries whose lines may total slightly more than
$HISTFILESIZE if the entries contain multiple lines
From a report from Jens Schmidt <farblos@vodafonemail.de>
- export: note that you can use -f with -p to display exported functions
From a report from Duncan Roe <duncan_roe@optusnet.com.au>
builtins/history.def
- add history -d start-end to the long doc
From a report from Duncan Roe <duncan_roe@optusnet.com.au>
4/9
---
lib/readline/histfile.c
- read_history_range: changes to not skip blank lines if we are
reading a history file with multiline history entries.
From a report by Jens Schmidt <farblos@vodafonemail.de>
4/11
----
bashline.c
- attempt_shell_completion: move the check for char_is_quoted from
check_redir to the caller, set in_command_position to 0 if the
command separator is quoted
From https://savannah.gnu.org/support/?111224 david@mandelberg.org
- check_extglob: break check for extended glob out into separate
function, call from attempted_shell_completion, set in_command_position
to -1 if it returns 1, as with the old call to check_redir
4/21
----
builtins/read.def
- read_mbchar: if we read a delimiter character that makes an
incomplete multibyte character into an invalid multibyte character,
only push the delimiter back if we read that character ourselves
(i > 1).
Report from Greg Wooledge <greg@wooledge.org>
4/23
----
parse.y
- pop_delimiter: only decrement delimiter_depth if it's > 0, since
reset_parser() may have set it to 0 after the matching call to
push_delimiter
Report from Grisha Levit <grishalevit@gmail.com> based on a report
from Александр Ушаков <aushakov@astralinux.ru>
4/25
----
parse.y
- read_a_line: if the shell is interactive, and not reading from a
string, check whether a previous call to shell_getc has set
EOF_Reached and return EOF in this case, after resetting the
current token to '\n'. This makes EOFs that are not the first
character on the line `sticky' instead of just token delimiters.
From https://savannah.gnu.org/bugs/?67045
- history_delimiting_chars: if it looks like we just finished a
subshell, and the line we're adding begins with an operator that
can't follow a semicolon, return a newline
From https://savannah.gnu.org/patch/?10517
4/28
----
parse.y
- parse_arith_command: if the character after the first right paren
isn't a right paren, making the construct a nested subshell, push
that character back and return the subshell command as the current
token string, which we push onto the pushed string list. Reading
one character more can cause synchronization problems with backslash
newline, among other things.
From https://savannah.gnu.org/patch/?10517
4/29
----
builtins/evalstring.c
- parse_string: only run the top-level unwind-protects if we're
actually going to be calling jump_to_top_level(); otherwise let
xparse_dolparen take care of it
From a report by Александр Ушаков <aushakov@astralinux.ru>
5/1
---
lib/sh/zread.c
- zungetc: rework to use a local 16-byte buffer so we can push back
multiple characters whether we use read or zread
- zread/zreadretry/zreadintr/zreadc/zreadcintr/zreadn: changed to use
zpopbuf to check whether we have pushed back bytes
- zreset,zsyncfd: reset the pushback buffer indices
builtins/read.def
- read_mbchar: handle the delimiter being part of an invalid multibyte
character, not just the byte that makes the multibyte character
invalid: keep track of where the delimiter char is in the buffer and
use zungetc to push back that character and everything we read
after it so subsequent buffered (zread) or unbuffered (read) reads
will return them
5/2
---
lib/readline/display.c,lib/readline/histexpand.c,lib/readline/history.c,
lib/readline/input.c,lib/readline/search.c,lib/readline/shell.c,
lib/readline/util.c,lib/readline/readline.c,lib/readline/histfile.c
- fixes for issues (unused variables, etc.) uncovered by static
analysis
All from a report by Siteshwar Vashisht <svashisht@redhat.com>
5/16
----
lib/readline/terminal.c
- NEED_EXTERN_PC: add __gnu_hurd__ to the systems that require this
if not using ncurses; rework the structure of the defines
Report from Collin Funk <collin.funk1@gmail.com>
braces.c
- brace_gobbler: don't mark an expression as BRACE_SEQ if we've
already seen a comma and marked it as BRACE_COMMA, so we treat
it as a comma brace expansion.
From a report by Sam James <sam@gentoo.org>
support/install-sh
- new version from coreutils-git (2024-12-03.03); renamed from install.sh
aclocal.m4
- AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP: added from automake
configure.ac
- call AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP
Makefile.in
- STRIP: let configure substitute it from AC_CHECK_TOOL result
- INSTALL_STRIP_PROGRAM: let configure substitute it from
AM_PROG_INSTALL_STRIP
- install-strip: change to set INSTALL_PROGRAM=${INSTALL_STRIP_PROGRAM}
to avoid hard-coding `-s' in the recipe
All from a report by NR <nroycea+gnu@gmail.com>
5/18
----
subst.c
- param_expand: if we expand a nameref that references an unset array
variable reference, make sure we enforce `nounset', with the usual
exceptions for `@' and `*' subscripts
From a report from Emanuele Torre <torreemanuele6@gmail.com>
5/22
----
buildconf.h.in
- add additional defines for conservative ISO C/POSIX environment
- add HAVE_C_BOOL define in case someone cross-compiles with a C23
compiler
From a report by Bruce Dubbs <bdubbs@linuxfromscratch.org>
builtins/mkbuiltins.c
- include buildconf.h instead of having separate defines when
cross-compiling
6/11
----
lib/readline/terminal.c
- rework change from 5/16 to add __gnu_hurd__ to the list of systems
that don't need extern PC/UP/BC
Reported by Joel Ebel <jbebel@google.com> as a static link failure
due to multiply-defined symbols
6/12
----
general.c
- valid_function_word: back out change from 2/4/2023 that allowed
quoted characters in function names.
Inspired by discussion with Robert Elz <kre@munnari.oz.au> and
Koichi Murase <myoga.murase@gmail.com>
parse.y
- read_token_word: set dollar_present if we see <( or >), backing
out change from 2/4/2023
|