If user entered a non-existent command (e.g. because they made a
typo) there is no point in trying to complete its arguments. Skip
calling complete_match() if that's the case.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
sftp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sftp.c b/sftp.c
index 939b8dc0..70e8d344 100644
--- a/sftp.c
+++ b/sftp.c
@@ -2143,7 +2143,7 @@ complete(EditLine *el, int ch)
if (carg > 1 && line[cursor-1] != ' ')
filematch = argv[carg - 1];
- if (remote != 0 &&
+ if ((remote == REMOTE || remote == LOCAL) &&
complete_match(el, complete_ctx->conn,
*complete_ctx->remote_pathp, filematch,
remote, carg == argc, quote, terminated) != 0)
--
2.35.1
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
typo) there is no point in trying to complete its arguments. Skip
calling complete_match() if that's the case.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
sftp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sftp.c b/sftp.c
index 939b8dc0..70e8d344 100644
--- a/sftp.c
+++ b/sftp.c
@@ -2143,7 +2143,7 @@ complete(EditLine *el, int ch)
if (carg > 1 && line[cursor-1] != ' ')
filematch = argv[carg - 1];
- if (remote != 0 &&
+ if ((remote == REMOTE || remote == LOCAL) &&
complete_match(el, complete_ctx->conn,
*complete_ctx->remote_pathp, filematch,
remote, carg == argc, quote, terminated) != 0)
--
2.35.1
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev