]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
implementation of the range insert for wxStringArray (patch 975003)
[wxWidgets.git] / src / common / filename.cpp
index 5bebeedae0ff0eb549e2c5686a70204d8bd0164b..a74aa0fa4b33dd5a2fb7cd66ee15591866e38b27 100644 (file)
@@ -163,7 +163,8 @@ public:
                      filename,                      // name
                      mode == Read ? GENERIC_READ    // access mask
                                   : GENERIC_WRITE,
-                     0,                             // no sharing
+                     FILE_SHARE_READ |              // sharing mode
+                     FILE_SHARE_WRITE,              // (allow everything)
                      NULL,                          // no secutity attr
                      OPEN_EXISTING,                 // creation disposition
                      0,                             // no flags
@@ -1675,18 +1676,17 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
     size_t posLastDot = fullpath.find_last_of(wxFILE_SEP_EXT);
     size_t posLastSlash = fullpath.find_last_of(sepPath);
 
+    // check whether this dot occurs at the very beginning of a path component
     if ( (posLastDot != wxString::npos) &&
-            ((format == wxPATH_UNIX) || (format == wxPATH_VMS)) )
-    {
-        if ( (posLastDot == 0) ||
-             (fullpath[posLastDot - 1] == sepPath[0u] ) )
+         (posLastDot == 0 ||
+            IsPathSeparator(fullpath[posLastDot - 1]) ||
+            (format == wxPATH_VMS && fullpath[posLastDot - 1] == _T(']'))) )
         {
-            // under Unix and VMS, dot may be (and commonly is) the first
+            // dot may be (and commonly -- at least under Unix -- is) the first
             // character of the filename, don't treat the entire filename as
             // extension in this case
             posLastDot = wxString::npos;
         }
-    }
 
     // if we do have a dot and a slash, check that the dot is in the name part
     if ( (posLastDot != wxString::npos) &&