Skip to content

Commit

Permalink
oops, I made a mistake in readline
Browse files Browse the repository at this point in the history
Change-Id: Id9f9f89dfa7ec9e7bdf37a99dadc468dcab54023
  • Loading branch information
cooljeanius committed Oct 27, 2023
1 parent f895613 commit ac28b50
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/apple-gdb-1824-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- run: cd src && make all-libdecnumber
- run: cd src && make all-mmalloc
- run: cd src && make configure-readline
- run: cd src && make configure-gdb
- run: cd src && for dir in libtool_gnu sim utils tcl expect dejagnu itcl tk libgui; do if test -e ${dir}/configure; then make configure-${dir}; elif test -d ${dir}; then ls ${dir}/configure*; else echo "skipping configuring in ${dir}"; fi; done
- run: cd src && for dir in sim utils tcl expect dejagnu itcl tk libgui; do if test -e ${dir}/Makefile; then make -C ${dir}; elif test -d ${dir}; then ls ${dir}/Makefile*; else echo "skipping ${dir}"; fi; done
- run: cd src && make all-gdb
Expand Down
1 change: 1 addition & 0 deletions src/bfd/po/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bfd.pot linguist-generated
2 changes: 1 addition & 1 deletion src/bfd/po/bfd.pot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/readline/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ rl_redisplay(void)
}

lb_botlin = (int)newlines;
inv_botlin = lb_botlin;
if (inv_botlin != lb_botlin)
inv_botlin = lb_botlin;
CHECK_INV_LBREAKS();
inv_lbreaks[newlines + 1] = out;
cursor_linenum = lb_linenum;
Expand Down
14 changes: 7 additions & 7 deletions src/readline/histexpand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,23 +1201,23 @@ get_history_word_specifier(char *spec, char *from, int *caller_index)
/* `%' is the word last searched for. */
if (spec[i] == '%')
{
*caller_index = i + 1;
return (search_match ? savestring (search_match) : savestring (""));
*caller_index = (i + 1);
return (search_match ? savestring(search_match) : savestring(""));
}

/* `*' matches all of the arguments, but not the command. */
if (spec[i] == '*')
{
*caller_index = i + 1;
result = history_arg_extract (1, '$', from);
return (result ? result : savestring (""));
*caller_index = (i + 1);
result = history_arg_extract(1, '$', from);
return (result ? result : savestring(""));
}

/* `$' is last arg. */
if (spec[i] == '$')
{
*caller_index = i + 1;
return (history_arg_extract ('$', '$', from));
*caller_index = (i + 1);
return (history_arg_extract('$', '$', from));
}

/* Try to get FIRST and LAST figured out. */
Expand Down
6 changes: 5 additions & 1 deletion src/readline/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,9 @@ _rl_insert_char(int count, int c)
rl_insert_text(string);
free(string);

#ifdef HANDLE_MULTIBYTE
(void)incoming_length;
#endif /* HANDLE_MULTIBYTE */
return 0;
}

Expand Down Expand Up @@ -717,7 +719,7 @@ _rl_insert_char(int count, int c)
free(string);
incoming_length = 0;
stored_count = 0;
#else /* !HANDLE_MULTIBYTE */
#else /* !HANDLE_MULTIBYTE: */
char str[1024 + 1];

for (i = 0; i < 1024; i++)
Expand All @@ -732,7 +734,9 @@ _rl_insert_char(int count, int c)
}
#endif /* !HANDLE_MULTIBYTE */

#ifdef HANDLE_MULTIBYTE
(void)incoming_length;
#endif /* HANDLE_MULTIBYTE */
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/readline/tilde.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ tilde_expand(const char *string)
result_index = result_size = 0UL;
/* looks like this was supposed to be an assignment after all; doing it
* as an equality comparison causes result to be used uninitialized: */
if ((result = strchr(string, '~')))
result = (char *)xmalloc(result_size = (strlen(string) + 16UL));
if ((result = strchr(string, '~')) && result)
result = (char *)xmalloc(result_size = (strlen(string) + 16UL + result_size));
else
result = (char *)xmalloc(result_size = (strlen(string) + 1UL));
result = (char *)xmalloc(result_size = (strlen(string) + 1UL + result_size));

/* Scan through STRING expanding tildes as we come to them. */
while (1)
Expand Down

0 comments on commit ac28b50

Please sign in to comment.