[gnome-builder/gnome-builder-3-36] gjs_symbols: Escape file paths passed to js



commit 84ac66bf969f665fa907edde9f3f365792f53a19
Author: Patrick Griffis <tingping tingping se>
Date:   Sat Apr 4 09:36:13 2020 -0700

    gjs_symbols: Escape file paths passed to js

 src/plugins/gjs-symbols/gjs_symbols.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/plugins/gjs-symbols/gjs_symbols.py b/src/plugins/gjs-symbols/gjs_symbols.py
index b96de08cc..e8998def2 100644
--- a/src/plugins/gjs-symbols/gjs_symbols.py
+++ b/src/plugins/gjs-symbols/gjs_symbols.py
@@ -264,7 +264,7 @@ class GjsSymbolProvider(Ide.Object, Ide.SymbolResolver):
     @staticmethod
     def _get_launcher(context, file_):
         file_path = file_.get_path()
-        script = JS_SCRIPT % file_path
+        script = JS_SCRIPT % file_path.replace('\\', '\\\\').replace("'", "\\'")
         unsaved_file = Ide.UnsavedFiles.from_context(context).get_unsaved_file(file_)
 
         if context.has_project():


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