Index: query.cc
===================================================================
--- query.cc	(revision 13373)
+++ query.cc	(working copy)
@@ -492,7 +492,7 @@
     }
 }
 
-static string
+string
 html_escape(const string &str)
 {
     string res;
Index: omega.cc
===================================================================
--- omega.cc	(revision 13373)
+++ omega.cc	(working copy)
@@ -346,13 +346,13 @@
 
     parse_omegascript(); 
 } catch (const Xapian::Error &e) {
-    cout << "Exception: " << e.get_msg() << endl;
+    cout << "Exception: " << html_escape(e.get_msg()) << endl;
 } catch (const std::exception &e) {
-    cout << "Exception: std::exception " << e.what() << endl;
+    cout << "Exception: std::exception " << html_escape(e.what()) << endl;
 } catch (const string &s) {
-    cout << "Exception: " << s << endl;
+    cout << "Exception: " << html_escape(s) << endl;
 } catch (const char *s) {
-    cout << "Exception: " << s << endl;
+    cout << "Exception: " << html_escape(s) << endl;
 } catch (...) {
     cout << "Caught unknown exception" << endl;
 }
Index: query.h
===================================================================
--- query.h	(revision 13373)
+++ query.h	(working copy)
@@ -45,2 +45,4 @@
 
+std::string html_escape(const std::string &str);
+
 #endif // OMEGA_INCLUDED_QUERY_H

