Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitddd87d5

Browse files
committed
Add an ugly workaround for a bug in some recent libedit versions.
Debian unstable is shipping a broken version of libedit: it de-escapeswords before passing them to the application's tab completion function,preventing us from recognizing backslash commands. Fortunately,we have enough information available to dig the original text out ofrl_line_buffer, so ignore the string argument and do that.I view this as a temporary workaround to get the affected buildfarmmembers back to green in the wake of7c01504. I hope we can getrid of it once somebody fixes Debian's libedit; hence, no back-patch,at least for now.Discussion:https://postgr.es/m/20200103110128.GA28967@msg.df7cb.de
1 parent04334fd commitddd87d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,13 @@ psql_completion(const char *text, int start, int end)
14471447
NULL
14481448
};
14491449

1450-
(void)end;/* "end" is not used */
1450+
/*
1451+
* Temporary workaround for a bug in recent (2019) libedit: it incorrectly
1452+
* de-escapes the input "text", causing us to fail to recognize backslash
1453+
* commands. So get the string to look at from rl_line_buffer instead.
1454+
*/
1455+
char*text_copy=pnstrdup(rl_line_buffer+start,end-start);
1456+
text=text_copy;
14511457

14521458
#ifdefHAVE_RL_COMPLETION_APPEND_CHARACTER
14531459
rl_completion_append_character=' ';
@@ -3859,6 +3865,7 @@ psql_completion(const char *text, int start, int end)
38593865
/* free storage */
38603866
free(previous_words);
38613867
free(words_buffer);
3868+
free(text_copy);
38623869

38633870
/* Return our Grand List O' Matches */
38643871
returnmatches;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp