From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BD6A4138334 for ; Wed, 9 Jan 2019 17:50:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7F3E3E0DD4; Wed, 9 Jan 2019 17:50:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4681CE0DD4 for ; Wed, 9 Jan 2019 17:50:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A1D2E335CFF for ; Wed, 9 Jan 2019 17:50:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 396EF459 for ; Wed, 9 Jan 2019 17:50:30 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1547056224.8dd00bb17128098d6ac2f4c43ccd797519340e9f.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/files/, app-shells/bash/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-shells/bash/bash-5.0.ebuild app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch X-VCS-Directories: app-shells/bash/ app-shells/bash/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 8dd00bb17128098d6ac2f4c43ccd797519340e9f X-VCS-Branch: master Date: Wed, 9 Jan 2019 17:50:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 61e8a4d0-4ffd-4140-a6f8-b43625db0b6d X-Archives-Hash: 73437a1bad7a508da0c1a9fe35036285 commit: 8dd00bb17128098d6ac2f4c43ccd797519340e9f Author: Lars Wendler gentoo org> AuthorDate: Wed Jan 9 17:50:01 2019 +0000 Commit: Lars Wendler gentoo org> CommitDate: Wed Jan 9 17:50:24 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dd00bb1 app-shells/bash: Fixed weird insert of backslashes Package-Manager: Portage-2.3.54, Repoman-2.3.12 Signed-off-by: Lars Wendler gentoo.org> app-shells/bash/bash-5.0.ebuild | 2 + .../files/bash-5.0-glob-pattern-backslash.patch | 133 +++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/app-shells/bash/bash-5.0.ebuild b/app-shells/bash/bash-5.0.ebuild index dcfccc608f9..9dd564847ad 100644 --- a/app-shells/bash/bash-5.0.ebuild +++ b/app-shells/bash/bash-5.0.ebuild @@ -97,6 +97,8 @@ src_prepare() { sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die touch -r . doc/* + eapply -p0 "${FILESDIR}"/${P}-glob-pattern-backslash.patch + eapply_user } diff --git a/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch b/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch new file mode 100644 index 00000000000..40379b3d4cc --- /dev/null +++ b/app-shells/bash/files/bash-5.0-glob-pattern-backslash.patch @@ -0,0 +1,133 @@ +*** ../bash-5.0/bashline.c 2018-11-27 13:20:16.000000000 -0500 +--- bashline.c 2019-01-09 09:44:26.000000000 -0500 +*************** +*** 232,235 **** +--- 232,236 ---- + static int bash_possible_command_completions __P((int, int)); + ++ static int completion_glob_pattern __P((const char *)); + static char *glob_complete_word __P((const char *, int)); + static int bash_glob_completion_internal __P((int)); +*************** +*** 1742,1746 **** + /* This could be a globbing pattern, so try to expand it using pathname + expansion. */ +! if (!matches && glob_pattern_p (text)) + { + matches = rl_completion_matches (text, glob_complete_word); +--- 1743,1747 ---- + /* This could be a globbing pattern, so try to expand it using pathname + expansion. */ +! if (!matches && completion_glob_pattern (text)) + { + matches = rl_completion_matches (text, glob_complete_word); +*************** +*** 1851,1855 **** + } + +! globpat = glob_pattern_p (hint_text); + + /* If this is an absolute program name, do not check it against +--- 1852,1856 ---- + } + +! globpat = completion_glob_pattern (hint_text); + + /* If this is an absolute program name, do not check it against +*************** +*** 3714,3717 **** +--- 3715,3773 ---- + } + ++ static int ++ completion_glob_pattern (string) ++ const char *string; ++ { ++ register int c; ++ char *send; ++ int open; ++ ++ DECLARE_MBSTATE; ++ ++ open = 0; ++ send = string + strlen (string); ++ ++ while (c = *string++) ++ { ++ switch (c) ++ { ++ case '?': ++ case '*': ++ return (1); ++ ++ case '[': ++ open++; ++ continue; ++ ++ case ']': ++ if (open) ++ return (1); ++ continue; ++ ++ case '+': ++ case '@': ++ case '!': ++ if (*string == '(') /*)*/ ++ return (1); ++ continue; ++ ++ case '\\': ++ if (*string == 0) ++ return (0); ++ } ++ ++ /* Advance one fewer byte than an entire multibyte character to ++ account for the auto-increment in the loop above. */ ++ #ifdef HANDLE_MULTIBYTE ++ string--; ++ ADVANCE_CHAR_P (string, send - string); ++ string++; ++ #else ++ ADVANCE_CHAR_P (string, send - string); ++ #endif ++ } ++ return (0); ++ } ++ + static char *globtext; + static char *globorig; +*************** +*** 3878,3882 **** + } + +! if (t && glob_pattern_p (t) == 0) + rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */ + FREE (t); +--- 3934,3938 ---- + } + +! if (t && completion_glob_pattern (t) == 0) + rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */ + FREE (t); +*** ../bash-5.0/lib/glob/glob_loop.c 2018-12-31 13:35:15.000000000 -0500 +--- lib/glob/glob_loop.c 2019-01-09 09:44:36.000000000 -0500 +*************** +*** 55,59 **** + + case L('\\'): +- #if 0 + /* Don't let the pattern end in a backslash (GMATCH returns no match + if the pattern ends in a backslash anyway), but otherwise return 1, +--- 55,58 ---- +*************** +*** 61,69 **** + and it can be removed. */ + return (*p != L('\0')); +- #else +- /* The pattern may not end with a backslash. */ +- if (*p++ == L('\0')) +- return 0; +- #endif + } + +--- 60,63 ----