X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Ffg_init.cxx;h=626f05291cba152a68244a4728efec445c2db771;hb=0c6ecd1271c68c06e736053387f25bb0ba0540e8;hp=08c79ee5c8c7f89607ec3ac7ed523297a4097532;hpb=58e0deb56b392ec4bcd90fdad1777830b5b07f60;p=flightgear.git diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 08c79ee5c..626f05291 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -37,6 +37,10 @@ #if defined( unix ) || defined( __CYGWIN__ ) # include // for gethostname() #endif +#if defined( _MSC_VER) || defined(__MINGW32__) +# include // for getcwd() +# define getcwd _getcwd +#endif // work around a stdc++ lib bug in some versions of linux, but doesn't // seem to hurt to have this here for all versions of Linux. @@ -1309,6 +1313,8 @@ bool fgInitGeneral() { } #endif + char buf[256], *cwd = getcwd(buf, 256); + fgSetString("/sim/fg-current", cwd ? cwd : ""); return true; }