Skip to content

Commit 0eb8d5e

Browse files
committed
Fix Windows/Linux problem when opening a patch with spaces in the path
1 parent 48d74fe commit 0eb8d5e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Source/Standalone/PlugDataApp.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,12 @@ class PlugDataApp final : public JUCEApplication {
8282
}
8383
bool moreThanOneInstanceAllowed() override
8484
{
85-
#if JUCE_WINDOWS
86-
return false; // On windows, file opening doesn't work correctly without it
87-
#else
8885
return true;
89-
#endif
9086
}
9187

9288
void fileOpened(String const& commandLine) const
9389
{
94-
auto const tokens = StringArray::fromTokens(commandLine, " ", "\"");
90+
auto const tokens = StringArray::fromTokens(commandLine, true);
9591
auto const file = File(tokens[0].unquoted());
9692
if (file.existsAsFile()) {
9793
if (file.hasFileExtension("pd")) {
@@ -197,7 +193,7 @@ class PlugDataApp final : public JUCEApplication {
197193
arg = arg.trim().unquoted().trim();
198194

199195
if (OSUtils::isFileFast(arg)) {
200-
fileOpened(arg);
196+
fileOpened(arg.quoted());
201197
}
202198
}
203199
#endif

0 commit comments

Comments
 (0)