代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6282c4e163751149ade6d5407229644fd41d5fbb Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@redhat.com>
Date: Thu, 7 Jan 2021 19:55:43 -0500
Subject: [PATCH 080/108] util: new function virSkipToDigit()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This function skips over the beginning of a string until it reaches a
decimal digit (0-9) or the NULL at the end of the string. The original
pointer is modified in place (similar to virSkipSpaces()).
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 0e89a7b4e0defb2b3711c1e854a51d296d7b6f7f)
---
src/libvirt_private.syms | 1 +
src/util/virstring.c | 18 ++++++++++++++++++
src/util/virstring.h | 1 +
3 files changed, 20 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 997039868e..4d54c5e42f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3172,6 +3172,7 @@ virStorageFileBackendRegister;
virSkipSpaces;
virSkipSpacesAndBackslash;
virSkipSpacesBackwards;
+virSkipToDigit;
virStrcpy;
virStringBufferIsPrintable;
virStringFilterChars;
diff --git a/src/util/virstring.c b/src/util/virstring.c
index e9e792f3bf..56c5e37def 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -817,6 +817,24 @@ virSkipSpacesAndBackslash(const char **str)
*str = cur;
}
+
+/**
+ * virSkipToDigit:
+ * @str: pointer to the char pointer used
+ *
+ * Skip over any character that is not 0-9
+ */
+void
+virSkipToDigit(const char **str)
+{
+ const char *cur = *str;
+
+ while (*cur && !g_ascii_isdigit(*cur))
+ cur++;
+ *str = cur;
+}
+
+
/**
* virTrimSpaces:
* @str: string to modify to remove all trailing spaces
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 360c68395c..878da86c33 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -117,6 +117,7 @@ int virDoubleToStr(char **strp, double number)
void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1);
void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1);
+void virSkipToDigit(const char **str) ATTRIBUTE_NONNULL(1);
void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1);
void virSkipSpacesBackwards(const char *str, char **endp)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。