X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66b6b04535cf261b7bae7da77332835b242abd04..794bcc2dea743ac907b839f54e451847c9ea4b72:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index f8f4989918..25935ed14f 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -110,10 +110,6 @@ // constants // ---------------------------------------------------------------------------- -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 -const off_t wxInvalidOffset = (off_t)-1; -#endif - #define _MAXPATHLEN 500 extern wxChar *wxBuffer; @@ -134,6 +130,14 @@ extern wxChar *wxBuffer; static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN]; +#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 +// +// VisualAge C++ V4.0 cannot have any external linkage const decs +// in headers included by more than one primary source +// +const off_t wxInvalidOffset = (off_t)-1; +#endif + // ============================================================================ // implementation // ============================================================================ @@ -1777,9 +1781,10 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName, #else // assume Unix const wxChar *pLastSeparator = wxStrrchr(pszFileName, wxFILE_SEP_PATH_UNIX); - if ( pDot == pszFileName ) + if ( (pDot == pszFileName) || (*(pDot - 1) == wxFILE_SEP_PATH_UNIX) ) { - // under Unix files like .profile are treated in a special way + // under Unix, dot may be (and commonly is) the first character of the + // filename, don't treat the entire filename as extension in this case pDot = NULL; } #endif // MSW/Unix