]> Nishi Git Mirror - libw3.git/commitdiff
fixing w3b
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Tue, 30 Jan 2024 15:44:21 +0000 (15:44 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Tue, 30 Jan 2024 15:44:21 +0000 (15:44 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@142 d27a3e52-49c5-7645-884c-6793ebffc270

Example/w3b/w3b.c

index 2348094de98f7895085afa2df6270b54a1ad0eb6..31535b6797c118e762f608bfec7dc98a4c7870b6 100644 (file)
@@ -65,6 +65,13 @@ void header_handler(struct W3* w3, char* key, char* value) {
        if(strcasecmp(key, "content-type") == 0) {
                if(ctype != NULL) free(ctype);
                ctype = __W3_Strdup(value);
+               int i;
+               for(i = 0; ctype[i] != 0; i++) {
+                       if(ctype[i] == ';') {
+                               ctype[i] = 0;
+                               break;
+                       }
+               }
        }
 }