PR lib/54067: Only quote the completion matches if we are doing filename
completion. If the user supplies a value for the
attempted_completion_function parameter then we cannot be sure if the
completion is for filename or something else. In such a case don't attempt to
quote the completion matches.
Perform quoting of filename completions when there are multiple matches as
well. Quoting of special characters in filename completion was implemented
for the single match case. This enables it for multiple matches as well.
This required unescaping escape sequences generated during last completion
in order to find the word to complete. While there, also update the test to
include cases for multiple matches.
PR/54117: Fix memory overrun: Account for the closing quote in memory
allocation if quoted.
PR/52359: When resizing because of a signal save and restore the cursor
position, since it does not change.
PR lib/54131 - declare the loop variable outside the for loop
PR/54400: out-of-bounds read in libedit c_delbefore
PR/54399: Uninitialized memory access in libedit history. Initialize the
buffer using calloc. While here change all malloc(a * sizeof(b)) to
Put the NULL check immediately after the allocation in hist_init()
PR/54415: libedit stats completions for non-file completions. Use the proper
completion function and account for the character appended by the function
when computing the number of columns.
Increment offset when adding an element to history to keep it aligned with
the last element entered.
PR lib/54510: Fix file completion inside quotes which broke with the second
change in this list. While there also fix handling character appending in
file completions when inside quotes. For example when inside a quote, if the
completion is a directory then append a '/' but don't close the quote. On the
other hand when inside a quote if the completion is a file name and it is the
only match then we can close the quote.
Fix type of MB_FILL_CHAR and remove cast for it in terminal.c.
Change strncpy to either memcpy (when we know the len), or strlcpy.