summaryrefslogtreecommitdiffstats
path: root/lib/Basic/Version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Basic/Version.cpp')
-rw-r--r--lib/Basic/Version.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp
index 98cf42b..4d90305 100644
--- a/lib/Basic/Version.cpp
+++ b/lib/Basic/Version.cpp
@@ -40,15 +40,15 @@ llvm::StringRef getClangRepositoryPath() {
}
std::string getClangRevision() {
-#ifndef SVN_REVISION
- // Subversion was not available at build time?
- return "";
-#else
- std::string revision;
- llvm::raw_string_ostream OS(revision);
- OS << strtol(SVN_REVISION, 0, 10);
- return revision;
+#ifdef SVN_REVISION
+ if (SVN_REVISION[0] != '\0') {
+ std::string revision;
+ llvm::raw_string_ostream OS(revision);
+ OS << strtol(SVN_REVISION, 0, 10);
+ return revision;
+ }
#endif
+ return "";
}
std::string getClangFullRepositoryVersion() {
OpenPOWER on IntegriCloud