X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b12915c104de03c9fd5102404e35051e9b8609a8..3d62dcb6b571cdcc0748f1f91223713755f54abc:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 6a63712481..a9fda2f4ac 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1040,3 +1040,37 @@ wxString wxGetHomeDir() return home; } + +#if 0 + +wxString wxGetCurrentDir() +{ + wxString dir; + size_t len = 1024; + bool ok; + do + { + ok = getcwd(dir.GetWriteBuf(len + 1), len) != NULL; + dir.UngetWriteBuf(); + + if ( !ok ) + { + if ( errno != ERANGE ) + { + wxLogSysError(_T("Failed to get current directory")); + + return wxEmptyString; + } + else + { + // buffer was too small, retry with a larger one + len *= 2; + } + } + //else: ok + } while ( !ok ); + + return dir; +} + +#endif // 0