|
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
#
|
|
# Filename: package/.../musl/0003-fix-at-the-start-of-a-complete-BRE.patch
|
|
# Copyright (C) 2016 The OpenSDE Project
|
|
#
|
|
# More information can be found in the files COPYING and README.
|
|
#
|
|
# This patch file is dual-licensed. It is available under the license the
|
|
# patched project is licensed under, as long as it is an OpenSource license
|
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
|
|
# of the GNU General Public License as published by the Free Software
|
|
# Foundation; either version 2 of the License, or (at your option) any later
|
|
# version.
|
|
# --- SDE-COPYRIGHT-NOTE-END ---
|
|
|
|
From 29b13575376509bb21539711f30c1deaf0823033 Mon Sep 17 00:00:00 2001
|
|
From: Szabolcs Nagy <nsz@port70.net>
|
|
Date: Mon, 29 Feb 2016 16:36:25 +0000
|
|
Subject: [PATCH] fix ^* at the start of a complete BRE
|
|
|
|
This is a workaround to treat * as literal * at the start of a BRE.
|
|
|
|
Ideally ^ would be treated as an anchor at the start of any BRE
|
|
subexpression and similarly $ would be an anchor at the end of any
|
|
subexpression. This is not required by the standard and hard to do
|
|
with the current code, but it's the existing practice. If it is
|
|
changed, * should be treated as literal after such anchor as well.
|
|
---
|
|
src/regex/regcomp.c | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c
|
|
index 7a2864c..5fad98b 100644
|
|
--- a/src/regex/regcomp.c
|
|
+++ b/src/regex/regcomp.c
|
|
@@ -994,6 +994,10 @@ static reg_errcode_t tre_parse(tre_parse_ctx_t *ctx)
|
|
if (*s=='\\')
|
|
s++;
|
|
|
|
+ /* handle ^* at the start of a complete BRE. */
|
|
+ if (!ere && s==ctx->re+1 && s[-1]=='^')
|
|
+ break;
|
|
+
|
|
/* extension: multiple consecutive *+?{,} is unspecified,
|
|
but (a+)+ has to be supported so accepting a++ makes
|
|
sense, note however that the RE_DUP_MAX limit can be
|
|
--
|
|
2.7.2
|
|
|