[gnome-builder/wip/gjs-indexer-robustness] gjs_symbols: Escape file paths passed to js
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-builder/wip/gjs-indexer-robustness] gjs_symbols: Escape file paths passed to js
- Date: Sat,  4 Apr 2020 16:43:46 +0000 (UTC)
commit 7155ffe05c7dea88d8f77396d036bc04136548de
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]