代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/less 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 756acc92c9d6bea9929d9105207e081054be05fb Mon Sep 17 00:00:00 2001
From: Mark Nudelman <[email protected]>
Date: Mon, 6 Nov 2023 11:44:08 -0800
Subject: [PATCH] Some constifying.
---
filename.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/filename.c b/filename.c
index a8726dc..672dc94 100644
--- a/filename.c
+++ b/filename.c
@@ -136,12 +136,13 @@ static int metachar(char c)
/*
* Insert a backslash before each metacharacter in a string.
*/
-public char * shell_quote(char *s)
+public char * shell_quote(constant char *s)
{
- char *p;
+ constant char *p;
+ char *np;
char *newstr;
int len;
- char *esc = get_meta_escape();
+ constant char *esc = get_meta_escape();
int esclen = (int) strlen(esc);
int use_quotes = 0;
int have_quotes = 0;
@@ -185,7 +186,7 @@ public char * shell_quote(char *s)
/*
* Allocate and construct the new string.
*/
- newstr = p = (char *) ecalloc(len, sizeof(char));
+ newstr = np = (char *) ecalloc(len, sizeof(char));
if (use_quotes)
{
SNPRINTF3(newstr, len, "%c%s%c", openquote, s, closequote);
@@ -198,12 +199,12 @@ public char * shell_quote(char *s)
/*
* Add the escape char.
*/
- strcpy(p, esc);
- p += esclen;
+ strcpy(np, esc);
+ np += esclen;
}
- *p++ = *s++;
+ *np++ = *s++;
}
- *p = '\0';
+ *np = '\0';
}
return (newstr);
}
--
2.43.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。