File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -373,8 +373,13 @@ void initializePaths()
373
373
// TODO: Get path of executable. This assumes working directory is bin/
374
374
dstream<<" WARNING: Relative path not properly supported on this platform"
375
375
<<std::endl;
376
- path_share = std::string (" .." );
377
- path_user = std::string (" .." );
376
+
377
+ /* scriptapi no longer allows paths that start with "..", so assuming that
378
+ the current working directory is bin/, strip off the last component. */
379
+ char *cwd = getcwd (NULL , 0 );
380
+ pathRemoveFile (cwd, ' /' );
381
+ path_share = std::string (cwd);
382
+ path_user = std::string (cwd);
378
383
379
384
#endif
380
385
@@ -477,7 +482,7 @@ void initializePaths()
477
482
478
483
path_user = std::string (getenv (" HOME" )) + " /Library/Application Support/" + PROJECT_NAME;
479
484
480
- #elif defined(__FreeBSD__)
485
+ #else // FreeBSD, and probably many other POSIX-like systems.
481
486
482
487
path_share = STATIC_SHAREDIR;
483
488
path_user = std::string (getenv (" HOME" )) + " /." + PROJECT_NAME;
You can’t perform that action at this time.
0 commit comments