diff options
author | Manuel Klimek <klimek@google.com> | 2013-03-04 20:03:38 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-03-04 20:03:38 +0000 |
commit | 0090591e505637cf2d9ea3b45768334d78d24ca2 (patch) | |
tree | b7006f301f2bd919c99b48ba65a156449b1f7ebb /lib/Format/Format.cpp | |
parent | 151b2ac8c84fe751871dcdb041efec655fab70eb (diff) |
Make sure to not split string literals at the first character.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index f7702cbd4f..2b82410cf8 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -769,10 +769,10 @@ private: StringRef::size_type getSplitPoint(StringRef Text, StringRef::size_type Offset) { StringRef::size_type SpaceOffset = Text.rfind(' ', Offset); - if (SpaceOffset != StringRef::npos) + if (SpaceOffset != StringRef::npos && SpaceOffset != 0) return SpaceOffset; StringRef::size_type SlashOffset = Text.rfind('/', Offset); - if (SlashOffset != StringRef::npos) + if (SlashOffset != StringRef::npos && SlashOffset != 0) return SlashOffset; if (Offset > 1) // Do not split at 0. |