代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From c8a79b3f43d083a70688067f095edea1a3dffb7b Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Mon, 4 Nov 2019 17:33:30 +0100
Subject: [PATCH 186/220] blscfg: Add support for sorting the plus ('+') higher
than base version
Handle plus separator. Concept is the same as tilde, except that if one of
the strings ends (base version), the other is considered as higher version.
A plus character is used for example by the Linux kernel build system to
denote that is the base version plus some changes on top of it.
Currently for example rpmvercmp("5.3.0", "5.3.0+") will return 0 even when
the two versions are not the same.
Resolves: rhbz#1767395
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
grub-core/commands/blscfg.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index d78cff7..83b33c1 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -163,8 +163,8 @@ static int vercmp(const char * a, const char * b)
/* loop through each version segment of str1 and str2 and compare them */
while (*one || *two) {
- while (*one && !grub_isalnum(*one) && *one != '~') one++;
- while (*two && !grub_isalnum(*two) && *two != '~') two++;
+ while (*one && !grub_isalnum(*one) && *one != '~' && *one != '+') one++;
+ while (*two && !grub_isalnum(*two) && *two != '~' && *two != '+') two++;
/* handle the tilde separator, it sorts before everything else */
if (*one == '~' || *two == '~') {
@@ -175,6 +175,21 @@ static int vercmp(const char * a, const char * b)
continue;
}
+ /*
+ * Handle plus separator. Concept is the same as tilde,
+ * except that if one of the strings ends (base version),
+ * the other is considered as higher version.
+ */
+ if (*one == '+' || *two == '+') {
+ if (!*one) return -1;
+ if (!*two) return 1;
+ if (*one != '+') goto_return (1);
+ if (*two != '+') goto_return (-1);
+ one++;
+ two++;
+ continue;
+ }
+
/* If we ran to the end of either, we are finished with the loop */
if (!(*one && *two)) break;
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。