fix for -c command ending with backslash; fix several small memory leaks; fix several uninitialized variables; compgen -V fix

This commit is contained in:
Chet Ramey
2023-06-26 16:23:10 -04:00
parent 293916f885
commit 81f7b44564
16 changed files with 133 additions and 18 deletions
+1 -1
View File
@@ -2868,7 +2868,7 @@ rl_menu_complete (int count, int ignore)
if (rl_completion_query_items > 0 && match_list_size >= rl_completion_query_items)
{
rl_ding ();
FREE (matches);
_rl_free_match_list (matches);
matches = (char **)0;
full_completion = 1;
return (0);
+1
View File
@@ -249,6 +249,7 @@ rl_gather_tyi (void)
struct timeval timeout;
#endif
result = -1;
chars_avail = 0;
input = 0;
tty = fileno (rl_instream);
+1 -1
View File
@@ -779,7 +779,7 @@ _rl_read_bracketed_paste_prefix (int c)
pbpref = BRACK_PASTE_PREF; /* XXX - debugging */
if (c != pbpref[0])
return (0);
pbuf[ind = 0] = c;
pbuf[ind = 0] = key = c;
while (ind < BRACK_PASTE_SLEN-1 &&
(RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) &&
_rl_pushed_input_available () == 0 &&
+5 -1
View File
@@ -55,7 +55,11 @@ anonopen (const char *name, int flags, char **fn)
/* "Names do not affect the behavior of the file descriptor." */
fd = memfd_create ("anonopen", 0);
if (fd >= 0)
return fd;
{
if (fn)
*fn = 0;
return fd;
}
/* If memfd_create fails, we fall through to the unlinked-regular-file
implementation. */
#endif