From 595346f1ac8dfb0eb226fe58a75e5ef5a27eac49 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 20 Jan 2008 12:55:24 +0000 Subject: [PATCH] Small code's simplifying: use issoftcr() in span*() functions --- golded3/geprot.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/golded3/geprot.h b/golded3/geprot.h index 3c4db1b..9e0d901 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -498,31 +498,24 @@ void edit_addressbook(GMsg* msg); // ------------------------------------------------------------------ // SOFTCR management +// Detects SoftCR only if DispsoftCR is ON inline bool issoftcr(char c) { return not WideDispsoftcr and (c == SOFTCR); } - +// Skip spaces and SoftCRs (if DispsoftCR is ON) inline char *spanspaces(const char *str) { - if (WideDispsoftcr) - while(isspace(*str) and (*str != CR)) - str++; - else - while((isspace(*str) and (*str != CR)) or (*str == SOFTCR)) + while ( (isspace(*str) and (*str != CR)) or issoftcr(*str) ) str++; return (char *)str; } - +// Skip LineFeeds and SoftCRs (if DispsoftCR is ON) inline char *spanfeeds(const char *str) { - if (WideDispsoftcr) - while(*str == LF) - str++; - else - while((*str == LF) or (*str == SOFTCR)) + while ( (*str == LF) or issoftcr(*str) ) str++; return (char *)str; }