1 Star 0 Fork 38

zhaomengmeng/bash

forked from src-openEuler/bash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-changes-for-quoting-special-and-multibyte-characters.patch 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
wangyuhang 提交于 2024-04-26 17:15 . sync patches from bash community
From 8418224f32f4dda85019cae063370c18bbd2d036 Mon Sep 17 00:00:00 2001
From: Chet Ramey <[email protected]>
Date: Tue, 25 Jul 2023 10:18:35 -0400
Subject: [PATCH] changes for quoting special and multibyte characters in glob
patterns; changes to filename unicode normalization on macOS for globbing and
filename completion; send SIGCONT unconditionally to just-restarted job in
fg/bg
Conflict:partial round, only added function bashline_set_filename_hooks for this round
Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=8418224f32f4dda85019cae063370c18bbd2d036
---
bashline.c | 13 +++++++++++++
bashline.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/bashline.c b/bashline.c
index a0e9044..4799de2 100644
--- a/bashline.c
+++ b/bashline.c
@@ -3257,6 +3257,19 @@ restore_directory_hook (hookf)
rl_directory_rewrite_hook = hookf;
}
+/* Set the readline hooks that affect how directories and filenames are
+ converted. Extern so other parts of the shell can use. */
+void
+bashline_set_filename_hooks (void)
+{
+ /* Tell the completer that we might want to follow symbolic links or
+ do other expansion on directory names. */
+ set_directory_hook ();
+
+ rl_filename_rewrite_hook = bash_filename_rewrite_hook;
+ rl_filename_stat_hook = bash_filename_stat_hook;
+}
+
/* Check whether not DIRNAME, with any trailing slash removed, exists. If
SHOULD_DEQUOTE is non-zero, we dequote the directory name first. */
static int
diff --git a/bashline.h b/bashline.h
index 48c9fec..7dfa913 100644
--- a/bashline.h
+++ b/bashline.h
@@ -53,6 +53,7 @@ extern int unbind_unix_command PARAMS((char *));
extern char **bash_default_completion PARAMS((const char *, int, int, int, int));
+extern void bashline_set_filename_hooks (void);
extern void set_directory_hook PARAMS((void));
/* Used by programmable completion code. */
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mmzzmm/bash.git
[email protected]:mmzzmm/bash.git
mmzzmm
bash
bash
master

搜索帮助