]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: backout r1.243 (fix for fatal during tab-completion with
authordjm@openbsd.org <djm@openbsd.org>
Thu, 2 Oct 2025 04:23:11 +0000 (04:23 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 2 Oct 2025 09:04:38 +0000 (19:04 +1000)
some multibyte sequences) as it breaks the common case for tab completion.

Will deal with it properly after release.

OpenBSD-Commit-ID: 196d00f5ff19579214de45357f16a1fb2d624be1

sftp.c

diff --git a/sftp.c b/sftp.c
index bdcf977080f2ea8aa63b16ab049d965833575223..3b505eea23db83b0a6edd2941945a81e384602be 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.244 2025/09/30 00:06:06 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.245 2025/10/02 04:23:11 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *
@@ -1868,7 +1868,6 @@ complete_ambiguous(const char *word, char **list, size_t count)
 
        if (count > 0) {
                u_int y, matchlen = strlen(list[0]);
-               u_int itemlen = matchlen, wordlen = strlen(word);
 
                /* Find length of common stem */
                for (y = 1; list[y]; y++) {
@@ -1881,10 +1880,6 @@ complete_ambiguous(const char *word, char **list, size_t count)
                        matchlen = x;
                }
 
-               for (; matchlen > wordlen; matchlen--)
-                       if (mblen(list[0] + matchlen, itemlen - matchlen) >= 0)
-                               break;
-
                if (matchlen > strlen(word)) {
                        char *tmp = xstrdup(list[0]);