Ignore:
Timestamp:
Jul 29, 2011, 2:30:58 PM (14 years ago)
Author:
dmik
Message:

Fixed a regression in r21674.

This broke the Select Directory dialog in SmartSVN/SmartGit
since GetFileAttributesEx(x:\) would returne a failure again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/oslibdos.cpp

    r21674 r21675  
    810810  // GetFileAttributesEx() does on Win32 -- instead of returning an error as
    811811  // DosQueryPathInfo() does
    812   if (pszOemName[1] == ':' && pszOemName[2] == '\0')
     812  int len = strlen(pszOemName);
     813  if (len == 2 && pszOemName[1] == ':')
    813814  {
    814815      pszOemName[2] = '\\';
    815816      pszOemName[3] = '\0';
    816817  }
    817   else
    818   {
    819       int len = strlen(pszOemName);
    820       // note: the below leaves '\' (i.e. the root dir) as is
    821       while (len > 1 && (pszOemName[len-1] == '\\' || pszOemName[len-1] == '/'))
    822           pszOemName[--len] = '\0';
     818  else if (len > 1 && (len != 3 || pszOemName[1] != ':'))
     819  {
     820      // note: len > 1 above leaves '\' (i.e. the root dir) as is
     821      // and the second condition prevents 'x:\' from being cut
     822      while (pszOemName[len-1] == '\\' || pszOemName[len-1] == '/')
     823          --len;
     824      pszOemName[len] = '\0';
    823825  }
    824826
Note: See TracChangeset for help on using the changeset viewer.