From f01899f18a63003a7875f91ffd401ff536de2a60 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 25 Sep 2014 06:45:25 +0000 Subject: [PATCH] ide/Builders: Quoting path now removes trailing '/', '\\' git-svn-id: svn://ultimatepp.org/upp/trunk@7725 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Builders/CppBuilder.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/uppsrc/ide/Builders/CppBuilder.cpp b/uppsrc/ide/Builders/CppBuilder.cpp index d13ccff8a..e1aab53a3 100644 --- a/uppsrc/ide/Builders/CppBuilder.cpp +++ b/uppsrc/ide/Builders/CppBuilder.cpp @@ -106,14 +106,21 @@ String CppBuilder::GetHostPathShort(const String& path) const return path; } +String TrimSlash(String s) +{ + while(findarg(*s.Last(), '/', '\\') >= 0) + s.Trim(s.GetCount() - 1); + return s; +} + String CppBuilder::GetHostPathQ(const String& path) const { - return '\"' + GetHostPath(path) + '\"'; + return '\"' + TrimSlash(GetHostPath(path)) + '\"'; } String CppBuilder::GetHostPathShortQ(const String& path) const { - return '\"' + GetHostPathShort(path) + '\"'; + return '\"' + TrimSlash(GetHostPathShort(path)) + '\"'; } String CppBuilder::GetLocalPath(const String& path) const