Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 425938e

Browse files
committed
Merge branch '4292_autocomplete_slashes'
* 4292_autocomplete_slashes: Ticket #4292: fix redundant back slashes for autocomplete.
2 parents 49e2535 + 2ee620f commit 425938e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/widget/input_complete.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,9 +1367,8 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
13671367

13681368
g_free (state.word);
13691369

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

13811380
p = *m;
1382-
*m = str_shell_escape (*m);
1381+
/* Escape only '?', '*', and '&' symbols as described in the
1382+
manual page (see a11995e12b88285e044f644904c306ed6c342ad0). */
1383+
*m = str_escape (*m, -1, "?*&", TRUE);
13831384
g_free (p);
13841385
}
13851386
}

0 commit comments

Comments
 (0)