diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2019-10-23 09:25:09 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2019-10-23 09:25:09 +0000 |
commit | 66a0a541d83acb73b22c9133a9c86175019b6f48 (patch) | |
tree | fc53fb15c40e692b13441b75f78c3b2262710f37 /testing/snapper/regex.patch | |
parent | f62f9a1c3c80c60a5caba0beeb77d2f30689e38e (diff) | |
download | aports-66a0a541d83acb73b22c9133a9c86175019b6f48.tar.bz2 aports-66a0a541d83acb73b22c9133a9c86175019b6f48.tar.xz |
testing/snapper: upgrade to 0.8.5
Diffstat (limited to 'testing/snapper/regex.patch')
-rw-r--r-- | testing/snapper/regex.patch | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/testing/snapper/regex.patch b/testing/snapper/regex.patch deleted file mode 100644 index 97dc7fa4af..0000000000 --- a/testing/snapper/regex.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/snapper/AsciiFile.cc.orig -+++ b/snapper/AsciiFile.cc -@@ -211,7 +211,7 @@ - - string line = key + "=\"" + value + "\""; - -- Regex rx('^' + Regex::ws + key + '=' + "(['\"]?)([^'\"]*)\\1" + Regex::ws + '$'); -+ Regex rx('^' + Regex::ws + key + '=' + "(\"[^'\"]*\"|'[^'\"]*'|[^'\"]*)" + Regex::ws + '$'); - - vector<string>::iterator it = find_if(lines(), regex_matches(rx)); - if (it == lines().end()) -@@ -226,12 +226,15 @@ - bool - SysconfigFile::getValue(const string& key, string& value) const - { -- Regex rx('^' + Regex::ws + key + '=' + "(['\"]?)([^'\"]*)\\1" + Regex::ws + '$'); -+ Regex rx('^' + Regex::ws + key + '=' + "(\"[^'\"]*\"|'[^'\"]*'|[^'\"]*)" + Regex::ws + '$'); - - if (find_if(lines(), regex_matches(rx)) == lines().end()) - return false; - -- value = rx.cap(2); -+ value = rx.cap(1); -+ if (!value.empty() && (value.front() == '"' || value.front() == '\'')) { -+ value = std::string(value.begin() + 1, value.end() - 1); -+ } - y2mil("key:" << key << " value:" << value); - return true; - } -@@ -295,12 +298,18 @@ - { - map<string, string> ret; - -- Regex rx('^' + Regex::ws + "([0-9A-Z_]+)" + '=' + "(['\"]?)([^'\"]*)\\2" + Regex::ws + '$'); -+ Regex rx('^' + Regex::ws + "([0-9A-Z_]+)" + '=' + "(\"[^'\"]*\"|'[^'\"]*'|[^'\"]*)" + Regex::ws + '$'); - - for (vector<string>::const_iterator it = Lines_C.begin(); it != Lines_C.end(); ++it) - { - if (rx.match(*it)) -- ret[rx.cap(1)] = rx.cap(3); -+ { -+ string value = rx.cap(2); -+ if (!value.empty() && (value.front() == '"' || value.front() == '\'')) { -+ value = std::string(value.begin() + 1, value.end() - 1); -+ } -+ ret[rx.cap(1)] = value; -+ } - } - - return ret; |