From 7b46aa8fbb013794da87ad5325750dd5ac1a81d3 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 23 Feb 2014 12:04:56 -0500 Subject: [PATCH] Forgot in previous commit to deal with case. As I'm doing it now, it's easy to use the existing docstring routine, so I've commented out the string version of lowercase I had introduced. I've left the code in case someone else needs it later. --- src/Text3.cpp | 6 +++--- src/support/lstrings.cpp | 2 ++ src/support/lstrings.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index f54e8f4b5a..340bb9ec29 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1689,11 +1689,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // invalid after regex_match returns, since it is then // being given a temporary object. (Thanks to Georg for // figuring that out.) - regex const link_re("^([a-zA-Z]+):.*"); + regex const link_re("^([a-z]+):.*"); smatch matches; - string const c = to_utf8(content); + string const c = to_utf8(lowercase(content)); - if (content.substr(0,7) == "mailto:") { + if (c.substr(0,7) == "mailto:") { p["target"] = content; p["type"] = from_ascii("mailto:"); } else if (regex_match(c, matches, link_re)) { diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp index 2d483e6744..7af8aae34e 100644 --- a/src/support/lstrings.cpp +++ b/src/support/lstrings.cpp @@ -481,12 +481,14 @@ docstring const lowercase(docstring const & a) } +/* Uncomment here and in lstrings.h if you should need this. string const lowercase(string const & a) { string tmp(a); transform(tmp.begin(), tmp.end(), tmp.begin(), local_lowercase()); return tmp; } +*/ docstring const uppercase(docstring const & a) diff --git a/src/support/lstrings.h b/src/support/lstrings.h index 89450c706f..576a5b921d 100644 --- a/src/support/lstrings.h +++ b/src/support/lstrings.h @@ -96,8 +96,9 @@ docstring const ascii_lowercase(docstring const &); /// Changes the case of \p s to lowercase. /// Does not depend on the locale. -std::string const lowercase(std::string const & s); docstring const lowercase(docstring const & s); +// Currently unused, but the code is there if needed. +// std::string const lowercase(std::string const & s); /// Changes the case of \p s to uppercase. /// Does not depend on the locale. -- 2.39.5