[openssh-commits] [openssh] 01/02: upstream: sftp: Don't attempt to complete arguments for

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Sep 16 13:35:29 AEST 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 590db83384f9d99fc51c84505792d26d1ef60df9
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Sep 16 03:13:34 2022 +0000

    upstream: sftp: Don't attempt to complete arguments for
    
    non-existent commands
    
    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.
    
    From Michal Privoznik
    
    OpenBSD-Commit-ID: cf39c811a68cde2aeb98fc85addea4000ef6b07a
---
 sftp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sftp.c b/sftp.c
index 939b8dc0..11ebe209 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.218 2022/06/28 06:09:14 jmc Exp $ */
+/* $OpenBSD: sftp.c,v 1.219 2022/09/16 03:13:34 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
  *
@@ -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)

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list