* sim/ppc/emul_bugapi.c (emul_bugapi_create): quote the file
authorJerome Guitton <guitton@adacore.com>
Tue, 4 Sep 2007 09:45:06 +0000 (09:45 +0000)
committerJerome Guitton <guitton@adacore.com>
Tue, 4 Sep 2007 09:45:06 +0000 (09:45 +0000)
name property before parsing it.

sim/ppc/ChangeLog
sim/ppc/emul_bugapi.c

index 6a2fe62ccb8eb65f5f8c81f31c99329d8e741e4f..a7efe94673fc7e34d868127e24ca236c47f2a298 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-04  Jerome Guitton  <guitton@adacore.com>
+
+       * sim/ppc/emul_bugapi.c (emul_bugapi_create): quote the file
+       name property before parsing it.
+
 2006-12-21  Hans-Peter Nilsson  <hp@axis.com>
 
        * acconfig.h: Remove.
index 97028bf9de91fffc2ec8d177001bc39390f010ac..9e09d2429cee08229cd7692fa87e933d460b75da 100644 (file)
@@ -203,6 +203,7 @@ emul_bugapi_create(device *root,
 {
   device *node;
   os_emul_data *bugapi;
+  char *filename;
 
   /* check it really is for us */
   if (name != NULL
@@ -301,8 +302,12 @@ emul_bugapi_create(device *root,
                : "ppc-xcoff"));
 
   if (image != NULL)
-    tree_parse(root, "/openprom/init/load-binary/file-name \"%s",
-              bfd_get_filename(image));
+    {
+      filename = tree_quote_property (bfd_get_filename(image));
+      tree_parse(root, "/openprom/init/load-binary/file-name %s",
+                filename);
+      free (filename);
+    }
 
   return bugapi;
 }