[beast/win32] Escape command string before executing to allow \ within file names.
- From: Stefan Westerfeld <stw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [beast/win32] Escape command string before executing to allow \ within file names.
- Date: Sat, 5 Sep 2009 09:50:21 +0000 (UTC)
commit f9c8823db7b5163696c0a0b4ac93d91c91601169
Author: Stefan Westerfeld <stefan space twc de>
Date: Sat Sep 5 09:49:53 2009 +0200
Escape command string before executing to allow \ within file names.
Based on 010_plugin_ext_crawler.diff.
sfi/sfidl-corecxx.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/sfi/sfidl-corecxx.cc b/sfi/sfidl-corecxx.cc
index 23d282e..de4396c 100644
--- a/sfi/sfidl-corecxx.cc
+++ b/sfi/sfidl-corecxx.cc
@@ -1362,8 +1362,8 @@ public:
g_print ("{\n");
gint estatus = 0;
GError *error = NULL;
- gchar *out, *err = NULL;
- String cmd = String() + "gdk-pixbuf-csource " + "--name=local_pixstream " + ii->file;
+ gchar *out, *err = NULL, *escaped = g_strescape (ii->file.c_str(), 0);
+ String cmd = String() + "gdk-pixbuf-csource " + "--name=local_pixstream " + escaped;
g_spawn_command_line_sync (cmd.c_str(), &out, &err, &estatus, &error);
if (err && *err)
g_printerr ("gdk-pixbuf-csource: %s", err);
@@ -1374,6 +1374,7 @@ public:
ii->file.c_str(), error ? ':' : ' ', error->message);
exit (estatus & 255 ? estatus : 1);
}
+ g_free (escaped);
g_clear_error (&error);
g_free (err);
g_print (" %s\n", out);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]