forked from bminor/bash
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchangelog
4967 lines (4230 loc) · 185 KB
/
changelog
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
9/15/2016
---------
[bash-4.4 released]
9/17
----
builtins/common.c
- display_signal_list: if 0 is supplied as an argument to kill -l,
display a signal-out-of-range error. Fixes bug reported by
Martijn Dekker <[email protected]>
9/18
----
print_cmd.c
- print_heredoc_bodies: take a list of redirections, all here documents,
and print the here-document bodies including the ending delimiter,
followed by a newline
- print_redirection_list: print the heredoc headers the first time
through the list of redirections so we print them in the same left-
to-right order they're supplied; print the bodies and delimiters with
print_heredoc_bodies after we print all the redirections if we're
not printing a list of commands (printing_connection == 0). Fix for
problem reported by Isabella Parakiss <[email protected]>
- print_deferred_heredocs: don't print heredoc headers, since they're
now printed in print_redirection_list
- print_deferred_heredocs: use print_heredoc_bodies
9/20
----
builtins/mapfile.def
- readarray: update usage synopsis to include -d delim. Report and
fix from [email protected]
test.c
- test_binop: if op[0] == '-', make sure op[1] != 0 before checking
op[2] or op[3]. Fixes out-of-bounds read reported by Franco
Costantini <[email protected]>
parse.y
- cond_term: if yylval.word->word[0] == '-' make sure word[1] != 0
before checking word[2] and calling test_unop. Fixes out-of-bounds
read reported by Franco Costantini <[email protected]>
- make sure to check all instances of the return value of the
simple_command production before trying to hook redirections onto it,
since it can potentially return NULL.
Reported by Franco Costantini <[email protected]>
9/21
----
parse.y
- token_is_assignment: make sure to check that the return value from
assignment() finds the `=' we just added at index I to avoid false
positives from g=g=g=g=g=g=(). Reported by Franco Costantini
9/22
----
parse.y
- token_is_assignment: if we're not using the bash malloc (which has
guard bytes after the requested allocation size), use a new
buffer so we can make sure it's big enough to hold the current
token and at least two additional characters. Reported by
Franco Costantini <[email protected]>
9/23
----
execute_command.c
- execute_in_subshell: call without_job_control for both job control
and non-job-control builds to avoid waiting for last_made_pid
inherited from parent shell. Related to fix from 8/4 to
initialize_subshell. Fixes bug reported by Martijn Dekker
builtins/declare.def
- local_builtin: allow `local --help' to work even when not executing
a function. Suggestion from Norm Abramovitz <[email protected]>
9/25
----
builtins/printf.def
- bexpand: if passed a null or empty string, return a newly-allocated
empty string (so the return value can always be freed) instead of
NULL.
- printstr: if passed a null string, treat it as if it were an empty
string so any precision or fieldwidth arguments are handled
correctly. Report from isabella parakiss <[email protected]>
subst.c
- skip_matched_pair: make the flags argument of 1 affect whether or
not backslash can quote characters in the string, so it affects
all quoting mechanisms
arrayfunc.c
- unbind_array_element: now takes a third (flags) argument; flags&1
means to not expand an associative array index. This is only called
from a shell builtin context, which means the argument should have
already undergone word expansion, so it should be ok. Will still
be a problem for uses like "unset -v 'var[$ind]'", quoted to avoid
globbing
- valid_array_reference: pass second flags argument to skipsubscript;
still set to 0 by all callers
arrayfunc.h
- unbind_array_element: updated prototype
builtins/set.def
- unset_builtin: add third argument of 1 to unbind_array_element calls
[TEMPORARILY DISABLED]
- unset_builtin: call valid_array_reference with second arg of 1 to
handle unmatched pairs of quotes and [/]
array.c
- array_reference: optimize access locality as well as sequential
access by adding ability to start from last-accessed element and move
backwards or forwards depending on the desired index. Inspired by
report from Tom McCurdy <[email protected]> and followup from
Christian Franke <[email protected]>
variables.c
- all_array_variables: include associative arrays, not just indexed
arrays. Reported by Grisha Levit <[email protected]>
execute_cmd.c
- execute_disk_command: if we're optimizing out the fork (CMD_NO_FORK),
decrement the shell level so we don't end up incrementing it twice.
We should decrement the shell level for an implicit exec like an
explicit one. Reported by Stephane Chazelas
builtins/exec.def
- exec_builtin: don't bother to decrement the shell level if we are
already in a `(command)' subshell. Reported by Stephane Chazelas
lib/readline/macro.c
- macro_level: count of macro nesting level, maintained by
_rl_push_executing_macro and _rl_pop_executing macro
- _rl_with_macro_input: if current nesting level exceeds
MAX_MACRO_LEVEL, abort the current command line with _rl_abort_internal
and return to the top level. Reported by Christian Klomp
lib/readine/history.c
- add_history: if allocating the history list for the first time,
make sure the max history list size isn't so large that it will
cause allocation errors. Cap it at MAX_HISTORY_INITIAL_SIZE
(8192). Reported by Sean Zha <[email protected]>
jobs.c
- wait_for: if a foreground job with job control enabled is killed by a
SIGINT and sourcelevel != 0, act as if we received the SIGINT so the
file sourcing can be terminated. Reported by PePa
9/26
----
subst.c
- read_comsub: only warn once for null bytes in command substitution
output, instead of once for every null byte
arrayfunc.c
- array_variable_part: now takes a `flags' argument; changed all callers
to initially pass 0
- array_variable_name: now takes a `flags' argument; changed all callers
to initially pass 0
- array_variable_name: pass `flags' argument to skipsubscript instead
of just passing 0
arrayfunc.h
- array_variable_{name,part}: added new argument to prototypes
9/29
----
bashline.c
- bash_directory_completion_hook: don't bother to try and expand a
${ or $( that isn't complete; expand_prompt_string will complain.
Fixes reports from John Passaro <[email protected]> and
Valentin Bajrami <[email protected]>
lib/readline/history.c
- _hs_append_history_line: use a strategy that attempts to avoid
realloc copying memory to a newly-allocated block if the history
line we're appending to gets `too long' (currently 256 bytes).
We reallocate in powers of 2 starting at 512, and rely on realloc
not allocating a new block and copying into it if the size is the
same as the last call to realloc. Addresses issue raised by
Hubert Schmid <[email protected]>
trap.h
- check_signals: new extern declaration
- trapped_signal_received: new extern declaration
builtins/read.def
- read_builtin: if one of the zread* functions returns < 0 (which
usually only happens in Posix mode), make sure we call check_signals()
before eventually calling run_pending_traps() because zread() isn't
going to call it
- include trap.h for correct extern functions and variable declarations
lib/sh/zread.c
- zread: if executing a builtin, call check_signals_and_traps() for
backwards compatibility. If not, call check_signals() only, because
we don't want to run traps during, for instance, reading command
substitution output. Fixes race condition bug reported by Luiz Angelo
Daros de Luca <[email protected]>
9/30
----
subst.c
- command_substitute: reset parse_and_execute_level to 0 in the child
process, since it's independent of the other parse_and_execute
calls. Adds command substitution inside other parse_and_execute
calls optimizations to suppress forks, as suggested by
Martijn Dekker <[email protected]>
10/3
----
configure.ac
- SHOBJ_STATUS: make sure it defaults to unsupported and is substituted
if the shobj-conf script isn't run. Fixes `make install' bug with
a minimal config reported by Andrew Tomazos <[email protected]>
10/5
----
support/shobj-conf
- darwin: set compatibility_version for a shared build of the readline
library (the standalone readline distribution shares this file) to
$(SHLIB_MAJOR)$(SHLIB_MINOR). Recommendation from Max Horn
10/6
----
array.h
- array_first_index: new convenience define
array.c
- ADD_AFTER: new define, complement of ADD_BEFORE
- UNSET_LASTREF: now takes an array as an argument, prepping for move
of lastref pointer into the array struct
- array_insert: check whether we are adding at the beginning of the
array and take a fast path if so
- array_insert: use same strategy as array_reference to find the place
to insert, starting from the last-referenced element and moving
forward or back from there; use ADD_AFTER if moving backward
- array_insert: if replacing an existing element, just replace the
value with new->value instead of the entire element
- array_reference: short-circuit quickly if looking for an element
before the first assigned index
- array_reference: if we don't find the element, leave lastref pointing
to the closest element under the assumption we will be assigning or
looking for something close
- array_reference: take advantage of ordered indexes to short-circuit
when looking for element that is not set
10/7
----
array.c
- array_remove: short-circuit if asked to remove index after max
index or before first index
10/10
-----
lib/malloc/malloc.c
- internal_realloc: if we are requesting reallocation to the same size
as the block's current size, short-circuit and return `mem' right
after doing bounds check
- internal_realloc: if we are reducing the size of an allocation, and
the new size fits in the next lower bin, just keep the same block
and adjust the size, so we can avoid some copies
parse.y
- set_line_mbstate: keep track of the allocated size of
shell_input_line_property, only request reallocation if the size
increases, but don't let it get too big
10/11
-----
jobs.c
- wait_for_background_pids: make sure we wait for pid in
last_procsub_child since it's not found in any job -- still needs
more work to wait for multiple process substitutions
subst.c
- process_substitute: if make_child fails, make sure we call
restore_pipeline to undo the previous save_pipeline()
10/15
-----
subst.c
- process_substitute,command_substitute: leave subshell_level (reflected
as $BASH_SUBSHELL) intact for any exit trap instead of decrementing
it. Suggested by Martijn Dekker <[email protected]>
builtins/evalstring.c
- optimize_subshell_command: new function, framework for optimizing
out forks for command that have already forked and are executing
in a subshell. Not used yet
expr.c
- readtok: if we have a post-increment or post-decrement, and the
previous token is not a string, check whether the previous token is
a number that results from a pre-increment or pre-decrement, and
make that an error. Report from Conrad Hoffmann <[email protected]>
10/16
-----
aclocal.m4
- BASH_JOB_CONTROL_MISSING: convert from AC_TRY_RUN to AC_TRY_COMPILE
with existing set of preprocessor defines, so it can work when
cross-compiling. Suggested by Felix Janda <[email protected]>
10/19
-----
variables.c
- get_bashpid: BASHPID is no longer readonly; assignments to it are
just ignored.
doc/{bash.1,bashref.texi}
- BASHPID: note that assignments are ignored and unsetting BASHPID
causes it to lose its special properties
10/28
-----
builtins/pushd.def
- popd_builtin: make sure to check the normalized stack offset
(i.e., negatives counting back from the end of the stack) is within
bounds before trying to free that stack entry. Report from
Fernando Mu帽oz <[email protected]>
lib/readline/histfile.c
- chown: protect calls with HAVE_CHOWN. Fixes for MinGW{64,32} from
J. Peter Mugaas <[email protected]>
lib/readline/colors.c
- S_ISDIR: add define if missing
- S_ISUID, S_ISGID, S_ISLNK, S_ISSOCK: don't use unless defined.
Fixes for MinGW{64,32} from J. Peter Mugaas <[email protected]>
bashhist.c
- current_command_line_comment: set to the most recent line in a
possibly multi-line command that contains a shell comment; set in
maybe_add_history and bash_add_history to either the current
command number or -2
- maybe_add_history: set current_command_line_comment for first line
of command
- bash_add_history: chars_to_add set to "\n" if the current command line
is one greater than the previous line containing a comment
(current_command_line_comment). Fixes complaint from back in
January, 2016 from Dave Rutherford <[email protected]>
array.h
- lastref: move last-referenced pointer into each array struct, so all
arrays can have reference locality
array.c
- array_create: set lastref element to 0
- array_copy: if copying the lastref in array a, set the new lastref
in the copy to the same element
- IS_LASTREF, LASTREF_START, LASTREF, INVALIDATE_LASTREF, SET_LASTREF,
UNSET_LASTREF: change to use new array `lastref' member
pathexp.c
- quote_string_for_globbing: if quoting for a regexp, make sure to
skip and copy a leading `^' in a bracket expression, and skip and
copy a subsequent `]' (after an optional `^'), so that leading
bracket doesn't close the bracket expression. Report from
Stephane Chazelas <[email protected]>
10/29
-----
subst.c
- extract_delimited_string: add calls to CHECK_STRING_OVERRUN for
$( inside $((, nested OPENERs, nested ALT_OPENERs, and backquotes
- skip_to_delim: add calls to CHECK_STRING_OVERRUN for $(, ${,
process substitution
- extract_dollar_brace_string: add calls to CHECK_STRING_OVERRUN for
$(
- extract_dollar_brace_string: use skipsubscript to skip over the
array subscript in ${var[sub]} (non-quoted case uses string_extract,
which already uses skipsubscript). Tagged for bash-5.0
10/30
-----
variables.c
- EPOCHSECONDS: new dynamic variable, time in seconds since Unix
epoch; assignments are ignored. Can be used on systems where
strftime() doesn't support '%s'
- EPOCHREALTIME: new dynamic variable, time in seconds since Unix
epoch with microsecond granularity
doc/{bash.1,bashref.texi}
- EPOCHSECONDS documentation
- EPOCHREALTIME documentation
execute_cmd.c
- decpoint: moved to locale.c, renamed locale_decpoint; changed callers
{bashintl,externs}.h
- locale_decpoint: extern declaration or #define if support for
localeconv() not there
10/31
-----
lib/malloc/malloc.c
- posix_memalign: add new posix-mandated interface
examples/loadables/rm.c
- rm: minimal loadable builtin, removes files and directories, only
handles -r and -f options. Original from Tim Ruehsen
<[email protected]>, heavily rewritten for inclusion as loadable
examples/loadables/Makefile.in
- rm: add rules to build rm as one of the `other' targets
examples/loadables/stat.c
- stat: new loadable builtin that takes a filename and loads the info
returned by stat(2) into an associative array specified by the -A
argument (default STAT)
11/1
----
variables.c
- BASH_ARGV0: new dynamic variable, returns $0 on reference and sets
$0 on assignment. From a suggestion from Rocky Bernstein <[email protected]>
a few years ago
doc/{bash.1,bashref.texi}
- BASH_ARGV0: document
11/2
----
lib/glob/sm_loop.c
- parse_collsym: make sure to not return an out-of-bounds read if a
collating symbol is unterminated. Fixes OOB read reported by
Jerzy Kramarz <[email protected]>
- brackmatch: after incrementing p, before checking whether it's a
character range, check whether *p was NULL before the increment
and short-circuit the bracket expression if it is
jobs.c
- discard_last_procsub_child: new function, safely discards
last_procsub_child and sets it to NULL
subst.c
- process_substitute: call discard_last_procsub_child instead of
calling discard_pipeline directly. Fixes bug reported by
Christian Weisgerber <[email protected]>
11/3
----
shell.h
- EX_DISKFALLBACK: new special return status available to builtins;
means to attempt to execute a disk command with the same name as
the builtin
examples/loadables/rm.c
- if we see the -i option, return EX_DISKFALLBACK
execute_cmd.c
- execute_simple_command: if executing a builtin returns EX_DISKFALLBACK,
try running execute_disk_command instead
bashline.c
- shell_expand_line: use expand_word to expand the readline line
buffer, which allows us to pass flags with the word. If a numeric
argument is supplied, do not perform quote removal (pass
Q_HERE_DOCUMENT since here-doc quoting does the right thing) and
do not perform command or process subsitution. From a suggestion
by Dabrien 'Dabe' Murphy <[email protected]> based on an old bug-bash
discussion
subst.c
- expand_word_internal: note that we have added a quoted IFS char to
istring by setting sentinel has_quoted_ifs. Usually we only add
one if we are not going to be performing word splitting, but we
will not perform word splitting if there's no expansion, so we need
to take care of that case
- expand_word_internal: when performing final word split, if there are
no expansions but has_quoted_ifs is non-zero, call remove_quoted_ifs()
to remove any quoted ifs characters we added while processing
- remove_quoted_ifs: new function, removes CTLESC chars preceding
(single-byte) chars in IFS. Used when we are not performing word
splitting. Fixes bug reported by Martijn Dekker <[email protected]>
11/4
----
lib/readline/macro.c
- _rl_peek_macro_key: return the next character from the current
keyboard macro; the next character from the `next' keyboard macro,
if there is one, if at the end of the current macro; or 0 to
indicate that we are at the end of a keyboard macro sequence
lib/readline/rlprivate.h
- _rl_peek_macro_key: extern declaration
lib/readline/readline.c
- _rl_dispatch_subseq: add test for ESC at the end of a keyboard macro,
which should cause the keyboard timeout for ESC to kick in. The
previous test didn't run the timeout code if executing from a macro,
even if we had read the last character of the macro. Fixes bug
reported by Clark Wang <[email protected]>
lib/glob/sm_loop.c
- GMATCH: allow trailing backslash in pattern to explicitly match a
backslash that is the last character in the string. Bug report from
Stephane Chazelas <[email protected]>
11/5
----
builtins/common.c
- display_signal_list: if displaying a signal name corresponding to an
exit status > 128, don't display the SIG prefix at all. Old code
made displaying the SIG prefix dependent on JOB_CONTROL define.
Report and fix from Martijn Dekker <[email protected]>
execute_cmd.c
- execute_subshell_builtin_or_function: call without_job_control even
if JOB_CONTROL is not defined. Similar to fix from 9/23.
Report from Martijn Dekker <[email protected]>
execute_cmd.c
- execute_simple_command: free memory allocated and passed to
make_child in the child process if JOB_CONTROL is defined
- execute_command_internal: free memory allocated and passed to
make_child in the child process created to run a () subshell or a
compound command within a pipeline if JOB_CONTROL is defined
- execute_coproc: free memory allocated and passed to make_child in
the child process if JOB_CONTROL is defined
- execute_disk_command: free memory allocated and passed to
make_child in the child process if JOB_CONTROL is defined. This
series of fixes is the result of reports from
Eduardo A. Bustamante L贸pez <[email protected]>
11/6
----
lib/sh/unicode.c
- u32toutf16: fix to prevent outputting broken surrogate pairs for
Japanese locales (ja_JP.UTF-8) on cygwin (which uses UTF-16 natively).
Report and fix from Koichi MURASE <[email protected]>
builtins/trap.def
- trap_builtin: if OP is `-' (revert), set the SIGINT signal handler
to sigint_sighandler if the shell is interactive and sourcing a
file (interactive_shell && sourcelevel) or running a trap
(interactive_shell && running_trap) even if it's not currently
interactive. Report from Martijn Dekker <[email protected]>
builtins/read.def
- check for and read multibyte characters in all cases, not just when
we are reading a specific number of characters, as long as
mb_cur_max > 1
subst.c
- expand_word_internal: some improvements to code that converts istring
into a WORD_LIST * to avoid multiple allocations and copies of
istring, which is already malloc'ed memory -- reduce number of malloc
and free calls
test.c
- unary_test: make sure if we test -v array[@] or array[*] that we
free the return value from array_value
11/8
----
expr.c
- expcond: make sure to set `noeval' before reading tokens depending on
the result of the conditional test, since readtok() can evaluate
identifiers (and recursively those containing expressions). Report
and fix from Koichi MURASE <[email protected]>
builtins/evalstring.c
- should_suppress_fork: make sure to check for traps on EXIT and
ERR, since any_signals_trapped() only checks for `real' signals,
not the fake shell ones. Fixes bug reported by Werner Fink
- optimize_subshell_command: ditto
11/9
----
eval.c
- reader_loop: change so that we don't reset the SIGINT handler every
time through the command loop in an interactive shell if the signal
is trapped (as the comment noted). Reported by Report from Martijn
Dekker <[email protected]>
subst.c
- parameter_brace_{patsub,remove_pattern,transform,casemod}: save and
restore this_command_name while temporarily setting it for use in
error messages. Fixes use-after-free error reported by
Jerzy Kramarz <[email protected]>
- string_extract_verbatim: make sure when we increment i by 2 due to
a CTLESC or CTLESC-CTLNUL that we don't read past the end of the
string. This can happen if the string ends with an odd number of
CTLESC chars. Fixes oob-read error reported by
Jerzy Kramarz <[email protected]>
11/11
-----
configure.ac,aclocal.m4
- BASH_FUNC_SBRK: make sure sbrk actually works, instead of being just
a stub function like on several Linux distributions
lib/malloc/malloc.c
- malloc_usable_size: return the maximum number of bytes available for
a particular memory allocation (size of block allocated for it)
11/12
-----
configure.ac
- changes to make --enable-profiling work on Linux (-pg, no static link,
no -static in LDFLAGS)
Makefile.in
- changes to make --enable-profiling work on Linux (take
${PROFILE_FLAGS} out of BASE_CCFLAGS, add to CCFLAGS instead; add
BASE_LDFLAGS define that doesn't include -pg or -static; use
BASE_LDFLAGS in LDFLAGS; move ${PROFILE_FLAGS} and ${STATIC_LD} to
LDFLAGS)
tests/run-gprof
- changes to make profiling test suite with gprof work on Linux (set
GMON_OUT_PREFIX to handle multiple profiled processes per test;
change default filename to gmon.out from bash.gmon; look for
gprof output files in ${TMPDIR} instead of /tmp; handle multiple
profiling files starting with $GMON_OUT_PREFIX)
locale.c
- locale_isutf8: use locale_charset() if it's available and nl_langinfo
isn't
- locale_isutf8: add code to parse a locale specification and determine
whether the encoding is UTF-8 (or utf8) in the absence of
nl_langinfo and locale_charset
- set_default_locale: make sure to set locale_utf8locale early on
- locale_utf8locale: set via call to locale_isutf8 wherever LANG,
LC_ALL, or LC_CTYPE is set
11/13
-----
lib/readline/display.c
- rl_redisplay: handle report of potential integer overflow in
horizontal display mode from Mateusz Lenik <[email protected]>
lib/sh/mbschr.c
- mbschr: if in a UTF-8 locale (locale_utf8locale) and we are looking
for an ASCII character, use (essentially) strchr as a shortcut
lib/sh/shmbchar.c
- utf8_{mbstrlen,mblen,mbsmbchar,mbsnlen}: UTF-8-specific replacement
functions (should also be able to use utf8_mblen in subst.c:
string_extract_verbatim)
- mbsmbchar: if locale_utf8locale is true, call utf8_mbsmbchar
- mbsmbchar: in UTF-8 locale, use utf8_mblen instead of mbrlen (not
used if earlier shortcut taken)
lib/sh/unicode.c
- u32cconv: don't use nl_langinfo early to call u32toutf8()
- u32cconv: use locale_utf8locale to set utf8locale
- u32cconv: when initializing (u32init == 0), use locale_charset, then
nl_langinfo, then stub_charset to determine the charset
- u32cconv: even if we don't have iconv, if locale_utf8locale is non-
zero, return u32toutf8
11/15
-----
lib/readline/nls.c
- _rl_init_locale: new function, split off code that determines current
locale from _rl_init_eightbit, use it to set _rl_utf8locale
lib/readiline/rlprivate.h
- _rl_init_locale: new extern declaration
lib/readline/readline.c
- rl_initialize: if not initializing everything the first time, call
_rl_init_locale to check current locale and set _rl_utf8locale
lib/readline/text.c
- _rl_insert_char: optimize cases where we are inserting a single-byte
character in a locale with multibyte characters
- _rl_insert_char: check whether character is single byte if we know
we are in a UTF-8 locale, optimize single-byte case to avoid calls
to mbrtowc and memmove/memcpy
lib/readline/mbutil.c
- _rl_char_value: if we are in a UTF-8 locale (_rl_utf8locale) and the
current character does not have the eighth bit set ((c & 0x80) == 0),
return that char without bothering to call mbrtowc
- _rl_adjust_point: don't bother calling mbrlen if we are in a UTF-8
locale and the current character is not a multibyte character
- _rl_find_next_mbchar_internal: if we are in a UTF-8 locale, use that
to avoid calls to mbrtowc
lib/readline/display.c
- _rl_col_width: if in a UTF-8 locale, take advantage of that to avoid
calls to mbrlen and mbrtowc
- rl_redisplay: if in a UTF-8 locale, take advantage of that to avoid
calls to mbrtowc
11/17
-----
lib/readline/histlib.h
- PATTERN_SEARCH: new flag for history search interfaces, means to
search for a pattern as Posix specifies
lib/readline/histsearch.c
- history_search_internal: now takes a `flags' argument instead of just
an `anchored' argument to accommodate PATTERN_SEARCH
- _hs_history_patsearch: new internal interface to use when flags
specify PATTERN_SEARCH
lib/readline/rlprivate.h
- SF_PATTERN: new flag for non-incremental search contexts, means to
treat search string as a pattern (maps to PATTERN_SEARCH)
lib/readline/search.c
- noninc_dosearch: takes an additional `flags' argument for SF_PATTERN
- noninc_search_from_pos: takes an additional `flags' argument for
SF_PATTERN
- noninc_dosearch: pass flags argument through to noninc_search_from_pos
- _rl_nsearch_init: if we are in vi command mode, and `pchar' (key used
to invoke the search) is `?' or `/', add SF_PATTERN to the flags
to conform to Posix spec for vi-mode editing
- _rl_nsearch_dosearch: if cxt->sflags indicates that we should do a
pattern search, pass SF_PATTERN to noninc_search_from_pos
- rl_noninc_forward_search_again: if in vi command mode and key == `N',
make sure flags arg passed to noninc_dosearch includes SF_PATTERN
- rl_noninc_reverse_search_again: if in vi command mode and key == `n',
make sure flags arg passed to noninc_dosearch includes SF_PATTERN
- rl_history_search_internal: pass extra flags arg to noninc_search_from_pos
11/18
-----
lib/readline/search.c
- noninc_search_from_pos: takes a new argument, a pointer to int where
it stores the offset of the match in the history line (if non-NULL),
modified callers
- rl_history_search_internal: pass newcol pointer to
noninc_search_from_pos to avoid having to recompute the match offset
in the matching history entry
config.h.in
- define HAVE_FNMATCH if we have the fnmatch function (configure was
already checking for it)
lib/readline/histsearch.c
- _hs_history_patsearch: transform the pattern into one ending in a
`*' to avoid having to perform multiple match attempts from each
index in the history line
- history_search_internal: changes to handle pattern matching if
PATTERN_SEARCH is in the flags and HAVE_FNMATCH is defined. This
makes vi-mode history searching treat the user-specified search
string as an fnmatch pattern, as Posix requires. Fixes issue
reported by <[email protected]>
11/19
-----
builtins/shopt.def
- shopt_enable_hostname_completion: only declare this if READLINE
defined, since that's the only time it's used. Reported by
isabella parakiss <[email protected]>
11/20
-----
builtins/common.c
- display_signal_list: make `kill -l 0' print `EXIT', modifying change
from 9/17
11/21
-----
subst.c
- expand_word_internal: when the shell encounters a backslash as the
last character of the string, don't try to add a '\'0' to the end
of the string if the string is quoted, just add a <CTLESC><\> and
skip to the end of string processing. Fixes oob-read error
reported by Jerzy Kramarz <[email protected]>
test.c
- two_arguments: check argv[pos][1] before checking argv[pos][2] when
looking for a unary argument. Fixes oob-read error on single `-'
in unary operator position reported by Jerzy Kramarz
- ANDOR: check s[1] before checking s[2] in case s[1] == end of string.
Fixes oob-read error reported by Jerzy Kramarz <[email protected]>
subst.c
- command_substitute: now takes additional flags argument, changed one
caller (param_expand) to pass through PF_ASSIGNRHS flag; other callers
pass 0
- command_substitute: pass through flags argument to read_comsub
- read_comsub: now takes additional new flags argument to indicate
whether or not the word is in a context where word splitting will
eventually be performed
- read_comsub: if we are running in a context where word splitting
will not take place (PF_ASSIGNRHS), we read a CTLESC, and CTLESC is
in $IFS, add a CTLESC to make sure it gets through a round of
dequoting
11/23
-----
parse.y
- xparse_dolparen: since reset_parser frees the pushed string list,
and this is supposed to be a separate parsing context, we need to
save and restore pushed_string_list around the call to parse_string
and reset_parser. Fixes bug reported by Dan Douglas
bashhist.h
- HISTEXPAND_DEFAULT: default value of history_expansion, moved here
from flags.c
flags.[ch]
- histexp_flag: new variable, this is what set -H/set -o histexpand
sets; history_expansion set to value of this variable; defaults to 0
- history_expansion: now set to HISTEXPAND_DEFAULT
bashhist.c
- bash_history_reinit: if interact == 0, set history_expansion to the
value of histexp_flag, to allow -H option to enable history
expansion
- bash_history_reinit: if interact == 0, make sure
history_expansion_inhibited is set opposite of histexp_flag, so
enabling history expansion with -H invocation option turns off
inhibited expansion. If interactive shell, we turn it off so
history_expansion controls whether or not history expansion takes
place. In practice, this function is always called with interact == 0,
and -c command still doesn't perform history expansion
shell.c
- init_interactive: make sure histexp_flag and history_expansion are
identical in an interactive shell; allows both -H/+H option and
default compilation options (HISTEXPAND_DEFAULT) to work
11/24
-----
subst.c
- get_word_from_string: take advantage of the fact that SEPARATORS is
always a (possibly local) copy of IFS, so build a local charmap of
separators and use it instead of the (cached and possibly stale)
ifs_cmap map and isifs macro. Fixes bug with -N stripping leading
whitespace reported by Clark Wang <[email protected]>
11/25
-----
builtins/read.def
- read_builtin: make `i' volatile, since auto variables are technically
undefined after a longjmp, and a timeout on SIGALRM causes one.
Fix suggested by Dmitry Goncharov <[email protected]>
11/27
-----
parse.y
- shell_getc: if we are reading input from a string, and we get the
ending '\0', and we are not expanding an alias, return EOF right
away. It might be an eval'ed string that has a syntax error.
Fixes bug reported by Dan Douglas <[email protected]>
11/28
-----
subst.c
- expand_word_internal: if we're expanding a quoted string containing
a tilde as the first character of a word, only expand the tilde if
we're expanding an array subscript (Q_ARRAYSUB), not if we're
expanding any arithmetic expression (Q_ARITH). This fixes a
backwards compatibility issue with expressions like ~0 reported by
Bize Ma <[email protected]>
subst.c
- parameter_brace_expand_indir: if the variable is not special and
the indirect variable is unset (!variable where variable is unset),
report an error. This is a slight incompatibility with previous
versions, which did not differentiate between indirecting an unset
variable and an indirect expansion resulting in an unset variable.
Fixes omission reported by [email protected]
11/30
-----
lib/readline/doc/{rluser.texi,readline.3},doc/bash.1
- do-uppercase-version: since this doesn't actually exist, replace it
with do-lowercase-version, with the caveat that do-lowercase-version
results in undefined behavior if bound to a character that's
already lowercase. Suggested by Branden Robinson
lib/readline/doc/rluser.texi
- history-substring-search-forward: was misspelled as "substr-search";
ditto for search-backward
doc/bash.1
- history-substring-search-{backward,forward}: add documentation, text
straight from readline.3
jobs.c
- initialize_job_control: if the terminal's process group is valid,
but the shell is not the foreground process, check for terminating
signals (like SIGHUP, which the kernel would send if the process
group were orphaned) during the loop where we try to stop the shell
if it's not in the foreground. Not a perfect solution; the kernel
might not send SIGHUP
12/1
----
jobs.c
- initialize_job_control: only go through the SIGTTIN loop 16 times at
most before deciding we're in the background and probably a member of
an orphaned process group; set original_pgrp to the terminal's pgrp
(so the eventual give_terminal_to doesn't leave the terminal in the
wrong pgrp); and bail on job control initialization
tests/run-all
- unset SHELLOPTS to avoid its options `polluting' the test
environment. Suggestion from Vladimir Marek
tests/execscript
- use $PWD/exec8.sub to protect against someone who has a cd command
in his bashrc. Report from Vladimir Marek
12/2
----
shell.c
- open_shell_script: call end_job_control before exiting the shell in
case we were run as `bash -i script' and there is a problem with
executing `script'. If we don't, the terminal ends up in the wrong
process group. Fix from Clark Wang <[email protected]>
12/3
----
parse.y
- read_comsub: if we look for a character following a `<' and it's
not `<' (indicating that we don't have to read a here-document),
make sure we push that character back and go through the loop again
so we note the right word start location. Fixes bug reported by
parasite parasite <[email protected]>
subst.c
- parameter_brace_expand_indir: clean up checks for unset variables to
minimize incompatibilities with previous versions
12/5
----
lib/readline/history.c
- add_history: don't update history_length until all of the updates to
the_history are complete, so history_length is always consistent.
Report and fix from Hong Cho <[email protected]>
bashline.c
- bash_backward_shellword: fix to work better at the end of the line,
with multiple trailing whitespace characters. Inspired by report
from Kirill Timofeev <[email protected]>
Makefile.in
- bashbug: use `^' as the sed delimiter instead of `%'; some compilers
use `%' in CFLAGS. Report from Vladimir Marek
12/6
----
test.c
- test_unop: make sure op[1] != 0 before testing op[2]
- term: make sure argv[pos][1] != 0 before testing argv[pos][2]. Fixes
oob-read reported by Jerzy Kramarz <[email protected]>
12/7
----
lib/glob/glob.c
- glob_filename: assign the return value of realloc (results, ...) to
a temp pointer, so if realloc returns NULL, we make sure we free
results. Report from Kirill Timofeev <[email protected]>
12/12
-----
lib/sh/shquote.c
- sh_backslash_quote: if FLAGS&2, backslash-quote other single-byte
characters that are in the current locale's <blank> character class
builtins/printf.def
- printf_builtin: when processing the `%q' format, make sure to
backslash quote all <blank> characters by making sure that FLAGS
passed to sh_backslash_quote includes 2. Fixes issue for certain
iso-8859-1 locales where character 160 (octal 240, hex 0xa0) is a
non-breaking space. Report from Stephane Chazelas
lib/sh/eaccess.c
- sh_stat: if DEV_FD_STAT_BROKEN is defined, take /dev/fd/N and turn
it into a stat on file descriptor N, as if /dev/fd were not
available. This is the case on some old versions of SunOS. Report
and patch from Dmitry Goncharov <[email protected]>
config.h.in
- DEV_FD_STAT_BROKEN: add define
configure.ac
- --enable-dev-fd-stat-broken: new command-line option, defines
DEV_FD_STAT_BROKEN if supplied at configure time
doc/bashref.texi
- --enable-dev-fd-stat-broken: document new command-line option for
configure