[lttoolbox] 02/02: Add PCRE workaround helper patch
Tino Didriksen
tinodidriksen-guest at moszumanska.debian.org
Tue Oct 28 08:24:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
tinodidriksen-guest pushed a commit to branch master
in repository lttoolbox.
commit b7bbd0b30869188109a8a5a0afa863bec0faddaa
Author: Tino Didriksen <mail at tinodidriksen.com>
Date: Tue Oct 28 08:22:21 2014 +0000
Add PCRE workaround helper patch
---
debian/patches/lttoolbox_01_string_io.diff | 75 ++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 76 insertions(+)
diff --git a/debian/patches/lttoolbox_01_string_io.diff b/debian/patches/lttoolbox_01_string_io.diff
new file mode 100644
index 0000000..27643fc
--- /dev/null
+++ b/debian/patches/lttoolbox_01_string_io.diff
@@ -0,0 +1,75 @@
+diff --git a/lttoolbox/compression.cc b/lttoolbox/compression.cc
+index b30a5e6..736ee49 100644
+--- a/lttoolbox/compression.cc
++++ b/lttoolbox/compression.cc
+@@ -252,6 +252,7 @@ Compression::multibyte_read(istream &input)
+ return result;
+ }
+
++
+ void
+ Compression::wstring_write(wstring const &str, FILE *output)
+ {
+@@ -272,6 +273,30 @@ Compression::wstring_read(FILE *input)
+ {
+ retval += static_cast<wchar_t>(Compression::multibyte_read(input));
+ }
++
++ return retval;
++}
++
++void
++Compression::string_write(string const &str, FILE *output)
++{
++ Compression::multibyte_write(str.size(), output);
++ for(unsigned int i = 0, limit = str.size(); i != limit; i++)
++ {
++ Compression::multibyte_write(static_cast<int>(str[i]), output);
++ }
++}
++
++string
++Compression::string_read(FILE *input)
++{
++ string retval = "";
++
++ for(unsigned int i = 0, limit = Compression::multibyte_read(input);
++ i != limit; i++)
++ {
++ retval += static_cast<char>(Compression::multibyte_read(input));
++ }
+
+ return retval;
+ }
+diff --git a/lttoolbox/compression.h b/lttoolbox/compression.h
+index 6b534e1..f5c3b7c 100644
+--- a/lttoolbox/compression.h
++++ b/lttoolbox/compression.h
+@@ -92,9 +92,26 @@ public:
+ * This method reads a wide string from the input stream.
+ * @see wstring_write()
+ * @param input the input stream.
+- * @return the wide string readed.
++ * @return the wide string read.
+ */
+ static wstring wstring_read(FILE *input);
++
++ /**
++ * This method allows to write a plain string to an output stream
++ * using its UCSencoding as integer.
++ * @see string_read()
++ * @param str the string to write.
++ * @param output the output stream.
++ */
++ static void string_write(string const &str, FILE *output);
++
++ /**
++ * This method reads a plain string from the input stream.
++ * @see string_write()
++ * @param input the input stream.
++ * @return the string read.
++ */
++ static string string_read(FILE *input);
+ };
+
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..41bbdf7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+lttoolbox_01_string_io.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lttoolbox.git
More information about the debian-science-commits
mailing list