From c131be91a9fbafb5ca9198a5026ce0e7aab4c7b8 Mon Sep 17 00:00:00 2001 From: nishi Date: Fri, 2 Feb 2024 05:28:49 +0000 Subject: [PATCH] w3b git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@159 d27a3e52-49c5-7645-884c-6793ebffc270 --- Example/w3b/w3b.c | 10 ++++++++++ W3Version.h.p | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Example/w3b/w3b.c b/Example/w3b/w3b.c index 5797e7d..7b01c35 100644 --- a/Example/w3b/w3b.c +++ b/Example/w3b/w3b.c @@ -344,6 +344,16 @@ void render_site() { style = false; if(ctype != NULL && strcasecmp(ctype, "text/html") == 0) { W3_Tag_Parse(databuf, datalen, html_handler, text_handler); + }else{ + int i; + for(i = 0; i < datalen; i++){ + if(databuf[i] == '\n'){ + if(nl >= start && (nl - start) <= termh - 1) write(1, databuf + i, 1); + nl++; + }else if(nl >= start && (nl - start) <= termh - 1){ + write(1, databuf + i, 1); + } + } } char* seq = malloc(1024); sprintf(seq, "\x1b[1;%dH", termw - strlen(titlebuf != NULL ? titlebuf : "No title") - 1); diff --git a/W3Version.h.p b/W3Version.h.p index 2a5028f..4165329 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.2F" \ +#define LIBW3_VERSION "2.2G" \ SUFFIX #ifdef __cplusplus -- 2.43.0