[gnome-builder/wip/gjs-indexer-robustness: 2/2] gjs_symbols: Escape potential quotes in indexed file paths



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

    gjs_symbols: Escape potential quotes in indexed file paths

 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..6255610c6 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("'", "\\'")
         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]