forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openwrt#22197 from oskarirauta/zsh
zsh: use libpcre2 instead of libpcre
- Loading branch information
Showing
6 changed files
with
1,069 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
utils/zsh/patches/001-50658-test-Enable-to-switch-between-C-UTF-8-locales-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
From 1b421e4978440234fb73117c8505dad1ccc68d46 Mon Sep 17 00:00:00 2001 | ||
From: Jun-ichi Takimoto <[email protected]> | ||
Date: Mon, 26 Sep 2022 10:52:50 +0900 | ||
Subject: [PATCH] 50658 + test: Enable to switch between C/UTF-8 locales in | ||
PCRE | ||
|
||
--- | ||
ChangeLog | 5 +++++ | ||
Src/Modules/pcre.c | 10 ++-------- | ||
Test/V07pcre.ztst | 11 +++++++++++ | ||
3 files changed, 18 insertions(+), 8 deletions(-) | ||
|
||
# diff --git a/ChangeLog b/ChangeLog | ||
# index 48c65d01b..77345c050 100644 | ||
# --- a/ChangeLog | ||
# +++ b/ChangeLog | ||
# @@ -1,3 +1,8 @@ | ||
# +2022-09-26 Jun-ichi Takimoto <[email protected]> | ||
# + | ||
# + * 50658 + test: Src/Modules/pcre.c, Test/V07pcre.ztst: Enable to | ||
# + switch between C/UTF-8 locales in PCRE | ||
# + | ||
# 2022-09-25 Peter Stephenson <[email protected]> | ||
|
||
# * 50648: Functions/Misc/zcalc: Julian Prein: Use ZCALC_HISTFILE | ||
--- a/Src/Modules/pcre.c | ||
+++ b/Src/Modules/pcre.c | ||
@@ -47,8 +47,6 @@ zpcre_utf8_enabled(void) | ||
#if defined(MULTIBYTE_SUPPORT) && defined(HAVE_NL_LANGINFO) && defined(CODESET) | ||
static int have_utf8_pcre = -1; | ||
|
||
- /* value can toggle based on MULTIBYTE, so don't | ||
- * be too eager with caching */ | ||
if (have_utf8_pcre < -1) | ||
return 0; | ||
|
||
@@ -56,15 +54,11 @@ zpcre_utf8_enabled(void) | ||
return 0; | ||
|
||
if ((have_utf8_pcre == -1) && | ||
- (!strcmp(nl_langinfo(CODESET), "UTF-8"))) { | ||
- | ||
- if (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre)) | ||
+ (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) { | ||
have_utf8_pcre = -2; /* erk, failed to ask */ | ||
} | ||
|
||
- if (have_utf8_pcre < 0) | ||
- return 0; | ||
- return have_utf8_pcre; | ||
+ return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), "UTF-8")); | ||
|
||
#else | ||
return 0; | ||
--- a/Test/V07pcre.ztst | ||
+++ b/Test/V07pcre.ztst | ||
@@ -174,3 +174,14 @@ | ||
echo $match[2] ) | ||
0:regression for segmentation fault, workers/38307 | ||
>test | ||
+ | ||
+ LANG_SAVE=$LANG | ||
+ [[ é =~ '^.\z' ]]; echo $? | ||
+ LANG=C | ||
+ [[ é =~ '^..\z' ]]; echo $? | ||
+ LANG=$LANG_SAVE | ||
+ [[ é =~ '^.\z' ]]; echo $? | ||
+0:swich between C/UTF-8 locales | ||
+>0 | ||
+>0 | ||
+>0 |
Oops, something went wrong.