Commit 95e3dc96 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Don't free() for every command checked for completion type.

Rev: src/sftp/ChangeLog:1.42
Rev: src/sftp/rl.c:1.7
parent c9e81161
2002-11-07 Pontus Skld <pont@soua.net>
* rl.c (lsftp_rl_completion): Bugfix: Don't free memory for every
command checked.
2002-07-29 Pontus Skld <pont@soua.net>
* configure.ac: Take advantage of lshg now understanding -G (pass
......
......@@ -192,7 +192,7 @@ char** lsftp_rl_completion(char* text, int start, int end)
/* If this word is at the start of the line, then it is a command to
* complete.
n */
*/
rl_completion_append_character = ' '; /* Trailing space after word */
......@@ -228,7 +228,7 @@ n */
lsftp_rl_command_generator
);
break;
case REMOTEFILE: /* Remote file or dir as argument? */
matches = RL_COMPLETION_MATCHES(
text,
......@@ -238,11 +238,11 @@ n */
case LOCALFILE:
matches = RL_COMPLETION_MATCHES(
text,
RL_FILENAME_COMPLETION_FUNCTION
);
break;
text,
RL_FILENAME_COMPLETION_FUNCTION
);
break;
default:
case NOARG: /* Doesn't take any argument? */
matches = RL_COMPLETION_MATCHES(
......@@ -252,9 +252,11 @@ n */
break;
}
free( tmp );
}
free( tmp );
if( !matches ) /* No matching command? */
{
/* No command yet given - complete command */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment