Commit Diff


commit - 4ed3dce4a39b7c7a138f507565be0e892082863d
commit + 4c9b5bd42a49733fa228b2f478c242d3c45d780a
blob - a66aa6c48f21c53ab3bcf2dc0177fd50aae0dcf2
blob + b9aaab8a1db0dda67324e25e2634cf638026f330
--- kamiftp/rl.c
+++ kamiftp/rl.c
@@ -327,6 +327,9 @@ ftp_completion(const char *text, int start, int end)
 
 	/* don't fall back on the default completion system by default */
 	rl_attempted_completion_over = 1;
+
+	/* append a space after selecting a command */
+	rl_completion_append_character = ' ';
 
 	if ((line = rl_copy_text(0, start)) == NULL)
 		return NULL;
@@ -336,6 +339,9 @@ ftp_completion(const char *text, int start, int end)
 	if (argno == 0)
 		return rl_completion_matches(text, ftp_cmdname_generator);
 
+	/* but not for file completions */
+	rl_completion_append_character = '\0';
+
 	switch (cmdtype) {
 	case CMD_BELL:
 	case CMD_HEXDUMP: