]> Nishi Git Mirror - libw3.git/commitdiff
w3b
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 2 Feb 2024 05:28:49 +0000 (05:28 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 2 Feb 2024 05:28:49 +0000 (05:28 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@159 d27a3e52-49c5-7645-884c-6793ebffc270

Example/w3b/w3b.c
W3Version.h.p

index 5797e7d308ca5c9d7d3e30181c24e0630cf9d8cc..7b01c35443b53710807fbbc80d48eb1fe8ce3bb4 100644 (file)
@@ -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);
index 2a5028fef526c72317d2b81b1defb1b6262a3801..4165329a239bd62c3ec34dfd1791defd9ac941b8 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "2.2F" \
+#define LIBW3_VERSION "2.2G" \
 SUFFIX
 
 #ifdef __cplusplus