summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 305f45f)
raw | patch | inline | side by side (parent: 305f45f)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 30 Mar 2007 22:28:34 +0000 (22:28 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 30 Mar 2007 22:28:34 +0000 (22:28 +0000) |
src/extension/parameter.cpp | patch | blob | history |
index 7183b977811b9d6668ae3c56ef9c0b9631072e7a..3dc0842ecc6ceb2316dc7cdd8153472d4471622c 100644 (file)
* Author:
* Ted Gould <ted@gould.cx>
*
- * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
+ * Copyright (C) 2006-2007 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) 2005-2006 Author
*
* Released under GNU GPL, read the file 'COPYING' for more information
# include "config.h"
#endif
+#ifdef linux
+# define ESCAPE_DOLLAR_COMMANDLINE
+#endif
#include <gtkmm/adjustment.h>
#include <gtkmm/box.h>
Glib::ustring *
ParamString::string (void)
{
+ gchar * esc = g_strescape(_value, NULL);
+ Glib::ustring escaped(esc);
+ g_free(esc);
+
+#ifdef ESCAPE_DOLLAR_COMMANDLINE // escape the dollar sign
+ Glib::ustring::iterator i;
+ for (i = escaped.begin(); i != escaped.end(); ++i) {
+ if ( *i == '$') {
+ i = escaped.insert(i, '\\');
+ i++;
+ }
+ }
+#endif
+
Glib::ustring * mystring = new Glib::ustring("");
*mystring += "\"";
- *mystring += _value;
+ *mystring += escaped;
*mystring += "\"";
+
return mystring;
}