File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1391,13 +1391,15 @@ is_multi_sel(void)
1391
1391
static int
1392
1392
clean_rl_buffer (const char * text )
1393
1393
{
1394
+ if (!text || !* text )
1395
+ return FUNC_FAILURE ;
1396
+
1394
1397
if (rl_point != rl_end )
1395
1398
return FUNC_SUCCESS ;
1396
1399
1397
1400
/* If the previous char is not space, then a common prefix was appended:
1398
1401
* remove it. */
1399
- if (rl_end == 0
1400
- || (rl_end > 0 && rl_line_buffer && rl_line_buffer [rl_end - 1 ] != ' ' )
1402
+ if ((rl_end > 0 && rl_line_buffer && rl_line_buffer [rl_end - 1 ] != ' ' )
1401
1403
|| (rl_end >= 2 && rl_line_buffer && rl_line_buffer [rl_end - 2 ] == '\\' )) {
1402
1404
/* Find the last non-escaped space. */
1403
1405
int i = rl_end , sp = -1 ;
@@ -2059,7 +2061,7 @@ tab_complete(const int what_to_do)
2059
2061
/* Common prefix for multiple matches is appended to the input query.
2060
2062
* Let's rise a flag to know if we should reinsert the original query
2061
2063
* in case the user cancels the completion (pressing ESC). */
2062
- int common_prefix_added =
2064
+ const int common_prefix_added =
2063
2065
(fzftab == 1 && matches [1 ] && strcmp (matches [0 ], text ) != 0 );
2064
2066
#endif /* _NO_FZF */
2065
2067
You can’t perform that action at this time.
0 commit comments