Use character constants instead of bare integers for escape character in strip_ansi()

Also use '\t' instead of '\011' in prepare_display().

Should be no functional changes, just looks nicer.
This commit is contained in:
Kevin Easton
2017-07-15 22:17:48 +10:00
parent df12f6860a
commit ce780c5b63

View File

@@ -468,7 +468,7 @@ char **BX_prepare_display(const char *orig_str,
break; /* case '\a' */ break; /* case '\a' */
} }
case '\011': /* TAB */ case '\t': /* TAB */
{ {
tab_cnt++; tab_cnt++;
if ((tab_max > 0) && (tab_cnt > tab_max)) if ((tab_max > 0) && (tab_cnt > tab_max))
@@ -495,7 +495,7 @@ char **BX_prepare_display(const char *orig_str,
break; break;
} }
} }
break; /* case '\011' */ break; /* case '\t' */
} }
case ND_SPACE: case ND_SPACE:
{ {
@@ -2522,7 +2522,7 @@ char *BX_strip_ansi(const char *str)
*/ */
case ('P') : case ('P') :
{ {
while (((chr = next_char()) != 0) && chr != 033) while (((chr = next_char()) != 0) && chr != '\033')
; ;
if (chr == 0) if (chr == 0)
put_back(); put_back();
@@ -2619,7 +2619,7 @@ char *BX_strip_ansi(const char *str)
* If we find a new ansi char, start all * If we find a new ansi char, start all
* over from the top and strip it out too * over from the top and strip it out too
*/ */
if (this_char() == 033) if (this_char() == '\033')
continue; continue;
/* /*