代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/less 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 90d9d12ba9d3818a0074f33c5153b577d07aa8fd Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Tue, 16 Jan 2024 18:14:33 -0800
Subject: [PATCH] Implement osc8_open().
---
filename.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/filename.c b/filename.c
index 672dc94..5d7a5ef 100644
--- a/filename.c
+++ b/filename.c
@@ -136,7 +136,7 @@ static int metachar(char c)
/*
* Insert a backslash before each metacharacter in a string.
*/
-public char * shell_quote(constant char *s)
+public char * shell_quoten(constant char *s, size_t slen)
{
constant char *p;
char *np;
@@ -151,7 +151,7 @@ public char * shell_quote(constant char *s)
* Determine how big a string we need to allocate.
*/
len = 1; /* Trailing null byte */
- for (p = s; *p != '\0'; p++)
+ for (p = s; p < s + slen; p++)
{
len++;
if (*p == openquote || *p == closequote)
@@ -181,7 +181,7 @@ public char * shell_quote(constant char *s)
* We can't quote a string that contains quotes.
*/
return (NULL);
- len = (int) strlen(s) + 3;
+ len = slen + 3;
}
/*
* Allocate and construct the new string.
@@ -189,10 +189,11 @@ public char * shell_quote(constant char *s)
newstr = np = (char *) ecalloc(len, sizeof(char));
if (use_quotes)
{
- SNPRINTF3(newstr, len, "%c%s%c", openquote, s, closequote);
+ SNPRINTF4(newstr, len, "%c%.*s%c", openquote, (int) slen, s, closequote);
} else
{
- while (*s != '\0')
+ constant char *es = s + slen;
+ while (s < es)
{
if (metachar(*s))
{
@@ -209,6 +210,11 @@ public char * shell_quote(constant char *s)
return (newstr);
}
+public char * shell_quote(char *s)
+{
+ return shell_quoten(s, strlen(s));
+}
+
/*
* Return a pathname that points to a specified file in a specified directory.
* Return NULL if the file does not exist in the directory.
--
2.43.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。