代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/less 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9b718ada456d49c795278328ed9d4d6f7f19686d Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Wed, 13 Jan 2021 14:25:21 -0800
Subject: [PATCH] Make histpattern return negative value to indicate error.
Avoid "Pattern not found" message after "Invalid pattern".
---
search.c | 13 ++++++++++++---------
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/search.c b/search.c
index 43b90a5..1165ba3 100644
--- a/search.c
+++ b/search.c
@@ -1413,7 +1413,7 @@ hist_pattern(search_type)
return (0);
if (set_pattern(&search_info, pattern, search_type) < 0)
- return (0);
+ return (-1);
#if HILITE_SEARCH
if (hilite_search == OPT_ONPLUS && !hide_hilite)
@@ -1446,7 +1446,7 @@ chg_caseless(VOID_PARAM)
* Regenerate the pattern using the new state.
*/
clear_pattern(&search_info);
- hist_pattern(search_info.search_type);
+ (void) hist_pattern(search_info.search_type);
}
}
@@ -1474,10 +1474,13 @@ search(search_type, pattern, n)
* A null pattern means use the previously compiled pattern.
*/
search_type |= SRCH_AFTER_TARGET;
- if (!prev_pattern(&search_info) && !hist_pattern(search_type))
+ if (!prev_pattern(&search_info))
{
- error("No previous regular expression", NULL_PARG);
- return (-1);
+ int r = hist_pattern(search_type);
+ if (r == 0)
+ error("No previous regular expression", NULL_PARG);
+ if (r <= 0)
+ return (-1);
}
if ((search_type & SRCH_NO_REGEX) !=
(search_info.search_type & SRCH_NO_REGEX))
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。