Skip to content

Commit

Permalink
Fix bug when one command or environment variable is a prefix of another.
Browse files Browse the repository at this point in the history
This bug was introduced in 09377f7.
  • Loading branch information
gwsw committed Jan 29, 2024
1 parent 4f77699 commit ee761f6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public LWCHAR get_wchar(constant char *sp)
/*
* Store a character into a UTF-8 string.
*/
public void put_wchar(char **pp, LWCHAR ch)
public void put_wchar(mutable char **pp, LWCHAR ch)
{
if (!utf_mode || ch < 0x80)
{
Expand Down
2 changes: 1 addition & 1 deletion cmdbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ public int cmd_char(char c)
/*
* Return the number currently in the command buffer.
*/
public LINENUM cmd_int(long *frac)
public LINENUM cmd_int(mutable long *frac)
{
constant char *p;
LINENUM n = 0;
Expand Down
2 changes: 1 addition & 1 deletion cvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public int * cvt_alloc_chpos(size_t len)
* Returns converted text in odst. The original offset of each
* odst character (when it was in osrc) is returned in the chpos array.
*/
public void cvt_text(char *odst, constant char *osrc, int *chpos, size_t *lenp, int ops)
public void cvt_text(mutable char *odst, constant char *osrc, mutable int *chpos, mutable size_t *lenp, int ops)
{
char *dst;
char *edst = odst;
Expand Down
3 changes: 2 additions & 1 deletion decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ static int cmd_search(constant char *cmd, constant char *table, constant char *e
* but not the end of the string in the command table.
* The user's command is incomplete.
*/
return (A_PREFIX);
if (a == A_INVALID)
a = A_PREFIX;
} else
{
/*
Expand Down
2 changes: 1 addition & 1 deletion screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,7 +2478,7 @@ static int parse_color6(constant char **ps)
* CV_4BIT: fg/bg values are OR of CV_{RGB} bits.
* CV_6BIT: fg/bg values are integers entered by user.
*/
public COLOR_TYPE parse_color(constant char *str, int *p_fg, int *p_bg)
public COLOR_TYPE parse_color(constant char *str, mutable int *p_fg, mutable int *p_bg)
{
int fg;
int bg;
Expand Down
2 changes: 1 addition & 1 deletion search.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ public void osc8_search(int search_type, constant char *param, int matches)
osc8_search_param = NULL;
if (match != 0)
{
error("OSC8 link not found", NULL_PARG);
error("OSC 8 link not found", NULL_PARG);
return;
}
jump_loc(pos, jump_sline);
Expand Down

0 comments on commit ee761f6

Please sign in to comment.