List:MySQL++« Previous MessageNext Message »
From:Andrew Sayers Date:July 2 2007 1:31am
Subject:Re: Bug: char[]s not escaped
View as plain text  
Alternatively, here's a better-formatted patch that doesn't send
programs into an infinite recursion:

diff -ruN mysql++-2.2.3/lib/manip.h mysql++-modified/lib/manip.h
--- mysql++-2.2.3/lib/manip.h	2007-04-17 16:12:54.000000000 +0100
+++ mysql++-modified/lib/manip.h	2007-07-02 02:21:58.000000000 +0100
@@ -170,6 +170,18 @@
 	return operator <<(o, const_cast<const char* const&>(in));
 }
 
+inline std::ostream& operator <<(quote_type1 o,
+		char in[])
+{
+	return operator <<(o, static_cast<const char* const&>(in));
+}
+
+inline std::ostream& operator <<(quote_type1 o,
+		const char in[])
+{
+	return operator <<(o, const_cast<char* const&>(in));
+}
+
 
 template <>
 inline std::ostream& operator <<(quote_type1 o,
@@ -540,6 +552,18 @@
 	return operator <<(o, const_cast<const char* const&>(in));
 }
 
+inline std::ostream& operator <<(escape_type1 o,
+		char in[])
+{
+	return operator <<(o, static_cast<const char* const&>(in));
+}
+
+inline std::ostream& operator <<(escape_type1 o,
+		const char in[])
+{
+	return operator <<(o, const_cast<char* const&>(in));
+}
+
 
 /// \enum do_nothing_type0
 /// \anchor do_nothing_manip
Thread
Bug: char[]s not escapedAndrew Sayers2 Jul
  • Re: Bug: char[]s not escapedAndrew Sayers2 Jul
    • Re: Bug: char[]s not escapedWarren Young2 Jul
    • Re: Bug: char[]s not escapedJonathan Wakely4 Jul
      • Re: Bug: char[]s not escapedWarren Young6 Jul
        • Re: Bug: char[]s not escapedJonathan Wakely7 Jul