소스 검색

Remove shortpath-related code from ExpandWildcards

Laszlo Csomor 6 년 전
부모
커밋
a700fc7aeb
1개의 변경된 파일0개의 추가작업 그리고 36개의 파일을 삭제
  1. 0 36
      src/google/protobuf/io/io_win32.cc

+ 0 - 36
src/google/protobuf/io/io_win32.cc

@@ -370,8 +370,6 @@ ExpandWildcardsResult ExpandWildcards(
     return ExpandWildcardsResult::kSuccess;
   }
 
-#ifdef SUPPORT_LONGPATHS
-
   wstring wpath;
   if (!as_windows_path(path.c_str(), &wpath)) {
     return ExpandWildcardsResult::kErrorInputPathConversion;
@@ -412,40 +410,6 @@ ExpandWildcardsResult ExpandWildcards(
   } while (::FindNextFileW(handle, &metadata));
   FindClose(handle);
   return matched;
-
-#else  // not SUPPORT_LONGPATHS
-
-  static const string kDot = ".";
-  static const string kDotDot = "..";
-  WIN32_FIND_DATAA metadata;
-  HANDLE handle = ::FindFirstFileA(path.c_str(), &metadata);
-  if (handle == INVALID_HANDLE_VALUE) {
-    // The pattern does not match any files (or directories).
-    return ExpandWildcardsResult::kErrorNoMatchingFile;
-  }
-
-  string::size_type pos = path.find_last_of("\\/");
-  string dirname;
-  if (pos != string::npos) {
-    dirname = path.substr(0, pos + 1);
-  }
-
-  ExpandWildcardsResult matched = ExpandWildcardsResult::kErrorNoMatchingFile;
-  do {
-    // Ignore ".", "..", and directories.
-    if ((metadata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0
-        && kDot != metadata.cFileName && kDotDot != metadata.cFileName) {
-      matched = ExpandWildcardsResult::kSuccess;
-      if (!dirname.empty()) {
-        consume(dirname + metadata.cFileName);
-      } else {
-        consume(metadata.cFileName);
-      }
-    }
-  } while (::FindNextFileA(handle, &metadata));
-  FindClose(handle);
-  return matched;
-#endif  // SUPPORT_LONGPATHS
 }
 
 namespace strings {