From 567ffaecb936a12f2cd61787aa0f114ff7df4628 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 19 Oct 2010 15:10:01 +0000 Subject: [PATCH] FetchNaturalChunk() needs to use isspace() just as NaturalCompare does when retrieving number chunks. Otherwise we wind up with an infinite loop if a number chunk is preceded by another whitespace char such as \t. Fixes a hang observed on Clemens' mail store. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39011 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/Utilities.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/tracker/Utilities.h b/src/kits/tracker/Utilities.h index a8cd8492e4..bbb654959d 100644 --- a/src/kits/tracker/Utilities.h +++ b/src/kits/tracker/Utilities.h @@ -212,9 +212,9 @@ FetchNaturalChunk(natural_chunk& chunk, const char* source) return pos; } - // skip leading zeros and spaces + // skip leading zeros and whitespace characters int32 skip = 0; - while (source[0] == '0' || source[0] == ' ') { + while (source[0] == '0' || isspace(source[0])) { source++; skip++; }