[Libreoffice-commits] dev-tools.git: clang/Makefile clang/rename.cxx
Miklos Vajna
vmiklos at collabora.co.uk
Sat Jan 30 08:39:56 PST 2016
clang/Makefile | 2 +-
clang/rename.cxx | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit ea1081107321a1d81f5f2560614fb078955addc5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Jan 30 17:39:28 2016 +0100
clang: check for empty columns in rename
diff --git a/clang/Makefile b/clang/Makefile
index 527e480..828ea71 100644
--- a/clang/Makefile
+++ b/clang/Makefile
@@ -2,7 +2,7 @@ CLANGDEFS=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
CLANGWARNS=-Werror -Wall -Wno-missing-braces -Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunused-macros -Wshadow -Woverloaded-virtual
CLANGFLAGS = $(CLANGDEFS) $(CLANGWARNS) -g -std=c++11
CLANGLIBS = -lLLVMSupport -lclangAST -lclangBasic -lclangFrontend -lclangRewrite -lclangTooling
-ifneq (GCOV,)
+ifneq ($(GCOV),)
CLANGFLAGS += --coverage
endif
diff --git a/clang/rename.cxx b/clang/rename.cxx
index fa8f40d..942e76f 100644
--- a/clang/rename.cxx
+++ b/clang/rename.cxx
@@ -429,15 +429,17 @@ static void parseCsv(const std::string& rCsv, std::map<std::string, std::string>
{
std::stringstream ss(aLine);
std::string aOldName;
- if (!std::getline(ss, aOldName, ','))
+ std::getline(ss, aOldName, ',');
+ if (aOldName.empty())
{
- std::cerr << "parseCsv: first std::getline() failed for line '" << aLine << "'" << std::endl;
+ std::cerr << "parseCsv: first column is empty for line '" << aLine << "'" << std::endl;
return;
}
std::string aNewName;
- if (!std::getline(ss, aNewName, ','))
+ std::getline(ss, aNewName, ',');
+ if (aNewName.empty())
{
- std::cerr << "parseCsv: second std::getline() failed for line '" << aLine << "'" << std::endl;
+ std::cerr << "parseCsv: second column is empty for line '" << aLine << "'" << std::endl;
return;
}
rNameMap[aOldName] = aNewName;
More information about the Libreoffice-commits
mailing list