summaryrefslogtreecommitdiffstats
path: root/src/disk_interface.cc
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2012-01-23 20:42:50 (GMT)
committerPeter Kuemmel <syntheticpp@gmx.net>2012-01-23 20:42:50 (GMT)
commitff7f0587dfc90bc2bc80365eff80f2a0835b791e (patch)
tree3f3ebf950e5361c031629b6ecd1bbb7a22672d22 /src/disk_interface.cc
parent133cba3f664b82be9dbeeff151f7cfb4b1065242 (diff)
downloadNinja-ff7f0587dfc90bc2bc80365eff80f2a0835b791e.zip
Ninja-ff7f0587dfc90bc2bc80365eff80f2a0835b791e.tar.gz
Ninja-ff7f0587dfc90bc2bc80365eff80f2a0835b791e.tar.bz2
no error code about too long file names on Windows
Diffstat (limited to 'src/disk_interface.cc')
-rw-r--r--src/disk_interface.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index 4e10f4e..6a14069 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -67,6 +67,12 @@ bool DiskInterface::MakeDirs(const string& path) {
TimeStamp RealDiskInterface::Stat(const string& path) {
#ifdef _WIN32
+ // MSDN: "Naming Files, Paths, and Namespaces"
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
+ if (!path.empty() && path[0] != '\\' && path.size() > MAX_PATH) {
+ Error("Stat(%s): Filename longer than %i characters", path.c_str(), MAX_PATH);
+ return -1;
+ }
_WIN32_FILE_ATTRIBUTE_DATA attrs;
if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &attrs)) {
DWORD err = GetLastError();