From 35373cf7af1d120e06ae142f55e1c06e652de745 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Wed, 23 Sep 2020 12:19:07 -0400
Subject: [PATCH] Fixes openpanel unable to open a custom path on windows

*Addresses issue #449
---
 pd/nw/pdgui.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 7e90a2594..f23126326 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -5668,6 +5668,9 @@ function file_dialog(cid, type, target, start_path) {
     // it just doesn't work. So this requires us to have the parent <span>
     // around the <input>. Then when we change the innerHTML of the span the
     // new value for nwworkingdir magically works.
+    if(nw_os_is_windows) {
+        start_path = start_path.replace(/\//g, '\\');
+    }
     dialog_options = {
         style: "display: none;",
         type: "file",
-- 
GitLab