Skip to content

Commit

Permalink
Merge branch '4292_autocomplete_slashes'
Browse files Browse the repository at this point in the history
* 4292_autocomplete_slashes:
  Ticket #4292: fix redundant back slashes for autocomplete.
  • Loading branch information
aborodin committed May 19, 2024
2 parents 49e2535 + 2ee620f commit 425938e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/widget/input_complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,9 +1367,8 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)

g_free (state.word);

if (matches != NULL &&
(flags & (INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_SHELL_ESC)) !=
(INPUT_COMPLETE_FILENAMES | INPUT_COMPLETE_SHELL_ESC))
if (matches != NULL && (flags & INPUT_COMPLETE_FILENAMES) != 0 &&
(flags & INPUT_COMPLETE_SHELL_ESC) == 0)
{
/* FIXME: HACK? INPUT_COMPLETE_SHELL_ESC is used only in command line. */
char **m;
Expand All @@ -1379,7 +1378,9 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
char *p;

p = *m;
*m = str_shell_escape (*m);
/* Escape only '?', '*', and '&' symbols as described in the
manual page (see a11995e12b88285e044f644904c306ed6c342ad0). */
*m = str_escape (*m, -1, "?*&", TRUE);
g_free (p);
}
}
Expand Down

0 comments on commit 425938e

Please sign in to comment.