[msitools] wixl-heat: escape $ in filename



commit 9273514c95e343340d18067b4f1b0905683c4dc6
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Thu Jun 1 19:09:03 2017 +0400

    wixl-heat: escape $ in filename
    
    Fixes:
    https://bugzilla.gnome.org/show_bug.cgi?id=756904
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 tools/wixl/wixl-heat.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/tools/wixl/wixl-heat.vala b/tools/wixl/wixl-heat.vala
index da570f7..b2861a4 100644
--- a/tools/wixl/wixl-heat.vala
+++ b/tools/wixl/wixl-heat.vala
@@ -26,6 +26,10 @@ bool filtered (string file) {
     return false;
 }
 
+string escape_filename(string filename) {
+    return filename.replace("$", "$$");
+}
+
 public int main (string[] args) {
 
     var cmdline = string.joinv (" ", args);
@@ -103,7 +107,7 @@ public int main (string[] args) {
                 else
                     stdout.printf (indent + "<Component Id=\"%s\" Guid=\"*\">\n".printf (id));
                 file = sourcedir + Path.DIR_SEPARATOR_S + file;
-                stdout.printf (indent + "  <File Id=\"%s\" KeyPath=\"yes\" Source=\"%s\"/>\n".printf 
(generate_id ("fil", 1, file), file));
+                stdout.printf (indent + "  <File Id=\"%s\" KeyPath=\"yes\" Source=\"%s\"/>\n".printf 
(generate_id ("fil", 1, file), escape_filename(file)));
                 stdout.printf (indent + "</Component>\n");
             }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]