replace isblank - gramscii - A simple editor for ASCII box-and-arrow charts DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 6bf74b8e63315aeeac6fe4307e9e2679d334aca3 DIR parent f813572a98e71ca4ea6be99196c60618cc45836c HTML Author: KatolaZ <katolaz@freaknet.org> Date: Mon, 5 Aug 2019 07:52:47 +0100 replace isblank Diffstat: M screen.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- DIR diff --git a/screen.c b/screen.c @@ -10,6 +10,12 @@ /*** screen management functions ***/ +/*** _isblank ***/ + +int _isblank(int c){ + return c==32 || c==9 ? 1 : 0; +} + /*** Status bar ***/ @@ -161,7 +167,7 @@ void erase_blank_lines(int y1, int y2){ for (; y1 <= y2; y1++){ j = screen.l[y1].lst; - while (j>=0 && isblank(screen.l[y1].s[j])) + while (j>=0 && _isblank(screen.l[y1].s[j])) j--; if (j<0){ screen.l[y1].lst = -1; @@ -430,12 +436,12 @@ void find_nonblank_rect(int *x1, int *y1, int *x2, int *y2){ if (i < *y1) *y1 = i; j = 0; - while((j <= screen.l[i].lst) && isblank(first=screen.l[i].s[j])) + while((j <= screen.l[i].lst) && _isblank(first=screen.l[i].s[j])) j++; if (j < *x1) *x1 = j; j = screen.l[i].lst; - while(isblank(screen.l[i].s[j])) + while(_isblank(screen.l[i].s[j])) j--; if (j > *x2) *x2 = j;