On Sun, 2012-11-11 at 18:04 +0100, ThorstenB wrote:
> If anyone was interested/able to fix the support for relative paths on 
> Windows, please implement "SGPath::realpath" in simgear/misc/sg_path.cxx:
> 

Hi Thorsten,

re: std::string SGPAth::realpath() const

That's strange no one has done this for WIN32 ;=()

Do NOT know about the MAC, but WIN32 has always, 
ALWAYS had, in <stdlib.h> -

 char *_fullpath( char *absPath, const 
    char *relPath, size_t maxlength );

So that gives something very similar to realpath()...

#if defined(_WIN32)
   // with absPath NULL, will allocate, and ignore length
   char *buf = _fullpath( NULL, path.c_str(), _MAX_PATH );
   if (!buf) {
      SG_LOG(... as per unix  ...);
      return path; // failed, return path as is
   }
   std::string p(buf);
   free(buf); // was allocated using malloc(), so
   return p;
#elsif defined(_APPLE_) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1050)
   return path;
#else
   // current unix code
   ...
#endif

And although I do not have a lot of experience with 
Cygwin I understand it knows how to convert a DOS/
Windows path to its unix kludge, /c/..., so do not 
need to do anything special... but maybe...

But this is all aside from the possible 'bug' 
Jon is pointing out...

HTH,

Regards,
Geoff.



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to