Skip to content

Commit

Permalink
Branch around Juce Path Space bug
Browse files Browse the repository at this point in the history
Juce path process open has a bug where they double protect
spaces in path names. Branch around this and also report it
on juce forums.

Closes surge-synthesizer#4820
  • Loading branch information
baconpaul committed Aug 21, 2021
1 parent 4ec43ef commit e12d336
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/gui/SurgeGUIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#include "juce_core/juce_core.h"

#include <cctype>
#if LINUX
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#endif

namespace Surge
{
Expand Down Expand Up @@ -67,7 +71,19 @@ void openFileOrFolder(const std::string &f)

if (path.isDirectory())
{
// See this for why we branch out linux here
// https://forum.juce.com/t/linux-spaces-in-path-startasprocess-and-process-opendocument/47296
#if LINUX
if (vfork() == 0)
{
if (execlp("xdg-open", "xdg-open", f.c_str(), (char *)nullptr) < 0)
{
_exit(0);
}
}
#else
path.startAsProcess();
#endif
}
else
{
Expand Down

0 comments on commit e12d336

Please sign in to comment.