ansi files in strings

This commit is contained in:
Andrew Pamment 2018-06-08 09:27:53 +10:00
parent 772ec89da6
commit 07b5568037

View File

@ -231,13 +231,24 @@ void timer_handler(int signum) {
void s_printf(char *fmt, ...) { void s_printf(char *fmt, ...) {
char buffer[512]; char buffer[512];
int i;
int pos;
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
vsnprintf(buffer, 512, fmt, ap); vsnprintf(buffer, 512, fmt, ap);
va_end(ap); va_end(ap);
if (fmt[0] == '@' && fmt[1] == '@' && fmt[strlen(fmt)-1] == '@' && fmt[strlen(fmt)-2] == '@') {
pos = 0;
for (i=2;i<strlen(fmt) - 2;i++) {
buffer[pos++] = fmt[i];
buffer[pos] = '\0';
}
s_displayansi_pause(buffer, 0);
} else {
s_putstring(buffer); s_putstring(buffer);
}
} }
int should_convert_utf8() { int should_convert_utf8() {