aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fpcmp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-13 21:48:43 +0000
committerChris Lattner <sabre@nondot.org>2004-04-13 21:48:43 +0000
commit6de6a0a6f018fa0dbf117155614e742f2bd2750b (patch)
tree7d3f5408d5f3dded3dc462fc375c1276ae803836 /utils/fpcmp
parentc78c0e4c06e3d6b37cfd7ba8b5f8462d4740bf5c (diff)
downloadexternal_llvm-6de6a0a6f018fa0dbf117155614e742f2bd2750b.zip
external_llvm-6de6a0a6f018fa0dbf117155614e742f2bd2750b.tar.gz
external_llvm-6de6a0a6f018fa0dbf117155614e742f2bd2750b.tar.bz2
Fix bug, add support for +/-
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/fpcmp')
-rw-r--r--utils/fpcmp/fpcmp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/fpcmp/fpcmp.cpp b/utils/fpcmp/fpcmp.cpp
index ae5667a..3df0fa5 100644
--- a/utils/fpcmp/fpcmp.cpp
+++ b/utils/fpcmp/fpcmp.cpp
@@ -56,7 +56,7 @@ static bool isNumberChar(char C) {
switch (C) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- case '.':
+ case '.': case '+': case '-':
case 'e':
case 'E': return true;
default: return false;
@@ -64,7 +64,7 @@ static bool isNumberChar(char C) {
}
static char *BackupNumber(char *Pos, char *FirstChar) {
- while (Pos < FirstChar && isNumberChar(Pos[-1]))
+ while (Pos > FirstChar && isNumberChar(Pos[-1]))
--Pos;
return Pos;
}