From 64fd3f50f9026f73dfd3b4b515c5cf39c3d29184 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 6 Aug 2018 11:22:55 -0230 Subject: [PATCH] For FSNodeUNIX, use actual symlink name instead of underlying name (fixes #325), --- Changes.txt | 7 +++++-- src/unix/FSNodePOSIX.cxx | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Changes.txt b/Changes.txt index 0a0fe01cc..d2619c8aa 100644 --- a/Changes.txt +++ b/Changes.txt @@ -52,8 +52,11 @@ * Fixed emulator crash when starting SaveKey ROMs from commandline with SaveKey messages enabled. - * Fixed missing TV format update in frame stats dialog when switching display - type. + * Fixed missing TV format update in frame stats dialog when switching + display type. + + * For UNIX systems: in the ROM launcher, when using symlinks use the + symlink pathname instead of the underlying filesystem pathname. * Updated PAL palette. diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index 8cdff324f..7a68dcad5 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -63,10 +63,13 @@ FilesystemNodePOSIX::FilesystemNodePOSIX(const string& p, bool verify) _path.replace(0, 1, home); } - // Get absolute path - char buf[MAXPATHLEN]; - if(realpath(_path.c_str(), buf)) - _path = buf; + // Get absolute path (only used for relative directories) + if(_path[0] == '.') + { + char buf[MAXPATHLEN]; + if(realpath(_path.c_str(), buf)) + _path = buf; + } _displayName = lastPathComponent(_path);