From 11903063211dc368d03f52e090e52ab18ebe3f47 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 27 Jan 2011 13:44:12 +0000 Subject: Implemented mkdir as an internal command --- tools/mhmake/src/fileinfo.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools/mhmake/src/fileinfo.h') diff --git a/tools/mhmake/src/fileinfo.h b/tools/mhmake/src/fileinfo.h index 1d70f0df1..b658ac677 100644 --- a/tools/mhmake/src/fileinfo.h +++ b/tools/mhmake/src/fileinfo.h @@ -189,11 +189,16 @@ public: { return QuoteFileName(m_AbsFileName); } +#ifdef WIN32 +#define MINPATHLENGTH 3 // The smallest dir name in windows is 3, e.g. "c:\" +#else +#define MINPATHLENGTH 1 // The smallest dir name in linux is 1, e.g. "/" +#endif void SetFullFileName(const string &strAbsName) { m_AbsFileName=UnquoteFileName(strAbsName); - // If the last char is path sep strip it - if (!m_AbsFileName.empty() && m_AbsFileName[m_AbsFileName.length()-1]==OSPATHSEP) + // If the last char is path sep strip it, except for the smallest dir name + if (m_AbsFileName.length()>MINPATHLENGTH && m_AbsFileName[m_AbsFileName.length()-1]==OSPATHSEP) m_AbsFileName.resize(m_AbsFileName.length()-1); } -- cgit v1.2.3