From 6a89c7b94486aae7bf8fae883f33c6906a8e4022 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 31 May 2001 01:44:26 +0000 Subject: Using explicit set of whitespace characters to avoid calling isspace with value that may be out of allowed range. --- src/DocumentAccessor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/DocumentAccessor.cxx b/src/DocumentAccessor.cxx index 4cb90c3e4..c187f2a44 100644 --- a/src/DocumentAccessor.cxx +++ b/src/DocumentAccessor.cxx @@ -170,7 +170,8 @@ int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnI *flags = spaceFlags; indent += SC_FOLDLEVELBASE; // if completely empty line or the start of a comment... - if (isspace(ch) || (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)) ) + if ((ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') || + (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)) ) return indent | SC_FOLDLEVELWHITEFLAG; else return indent; -- cgit v1.2.3