diff options
author | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:30:48 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:30:48 +0000 |
commit | 90171f125f36488dc08f5cfe0b0d4b78d995f08d (patch) | |
tree | e65a38bd8ba391fc800cecc896379a7fb76a0608 /plugins/MirOTR/ekhtml/src | |
parent | 190307ca7aee92d6b862db0bf78cde10acfc95d0 (diff) |
MirOTR: updated ekhtml from 0.3.2 to 0.3.3-pre (Git 0092d9d), this fixes a memory leak and improves attribute parsing
git-svn-id: http://svn.miranda-ng.org/main/trunk@12448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/ekhtml/src')
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml.c | 6 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_comment.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_data.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_endtag.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_mktables.c | 7 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_special.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_starttag.c | 4 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/ekhtml_util.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/src/hash.c | 35 |
9 files changed, 20 insertions, 42 deletions
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml.c b/plugins/MirOTR/ekhtml/src/ekhtml.c index f3697469f6..012a543b91 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -279,7 +279,7 @@ ekhtml_parser_startendcb_add(ekhtml_parser_t *parser, const char *tag, } - newtag = _strdup(tag); + newtag = strdup(tag); for(cp=newtag; *cp; cp++) *cp = toupper(*cp); @@ -357,7 +357,7 @@ void ekhtml_parser_destroy(ekhtml_parser_t *ekparser){ ekhtml_string_t *key = (ekhtml_string_t *)hnode_getkey(hn); ekhtml_tag_container *cont = hnode_get(hn); - hash_scan_delete(ekparser->startendcb, hn); + hash_scan_delfree(ekparser->startendcb, hn); free((char *)key->str); free(key); free(cont); diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_comment.c b/plugins/MirOTR/ekhtml/src/ekhtml_comment.c index e37cc487b5..50ae59c1a9 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_comment.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_comment.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_data.c b/plugins/MirOTR/ekhtml/src/ekhtml_data.c index 2b1d6c8a19..b5c85984c9 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_data.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_data.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c b/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c index f7095dcdfe..55ac3ce8f3 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_endtag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c index 9a8dea2a03..412b313467 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,7 +69,8 @@ static EKHTML_CHARMAP_TYPE valid_attrvalue(char in){ in == '%' || in == '?' || in == '!' || in == '&' || in == '(' || in == ')' || in == '#' || in == '=' || in == '~' || in == ']' || in == '*' || in == '@' || - in == '$' || in == '_') + in == '$' || in == '_' || in == ',' || in == ';' || + in == '|') return 1; return 0; } @@ -110,7 +111,7 @@ static void print_charmap(char *name, EKHTML_CHARMAP_TYPE (*cmap_func)(char)){ int ch; char sbuf[256]; - sprintf_s(sbuf, 256, "0x%%0%dx ", EKHTML_CHARMAP_LEN * 2); + sprintf(sbuf, "0x%%0%dx ", EKHTML_CHARMAP_LEN * 2); printf("#ifdef EKHTML_USE_TABLES\n"); printf("const %s %s[256] = {\n", EKHTML_CHARMAP_TYPE_S, name); for(ch=0; ch < 256; ch++){ diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_special.c b/plugins/MirOTR/ekhtml/src/ekhtml_special.c index f43a62dac4..910919c3d8 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_special.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_special.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c b/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c index cfd3ea4fd4..d0770851cf 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_starttag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -237,6 +237,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data, attr->val.str = NULL; attr->val.len = 0; attr->isBoolean = 1; + attr->quoteChar = '\0'; attr->next = NULL; startstate->mode = EKHTML_STMODE_GETNAME; startstate->curattr = attr; @@ -310,6 +311,7 @@ char *ekhtml_parse_starttag(ekhtml_parser_t *parser, void **state_data, startstate->curattr->val.str++; /* Skip the quote */ startstate->mode = EKHTML_STMODE_GETVALUE; startstate->quote = *workp; + startstate->curattr->quoteChar = *workp; workp++; } else if(!(EKCMap_CharMap[(unsigned char)*workp] & EKHTML_CHAR_ATTRVALUE)) diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_util.c b/plugins/MirOTR/ekhtml/src/ekhtml_util.c index 0bc5c1dfac..d4b3883d50 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_util.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/src/hash.c b/plugins/MirOTR/ekhtml/src/hash.c index 95651d4e76..dd469b273b 100644 --- a/plugins/MirOTR/ekhtml/src/hash.c +++ b/plugins/MirOTR/ekhtml/src/hash.c @@ -14,19 +14,20 @@ * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * - * $Id: hash.c,v 1.1 2002/09/17 02:49:36 jick Exp $ - * $Name: EKHTML_RELEASE_0_3_2 $ + * $Id$ + * $Name$ */ #include <stdlib.h> #include <stddef.h> #include <assert.h> #include <string.h> +#include "ekhtml_config.h" #define HASH_IMPLEMENTATION #include "hash.h" #ifdef KAZLIB_RCSID -static const char rcsid[] = "$Id: hash.c,v 1.1 2002/09/17 02:49:36 jick Exp $"; +static const char rcsid[] = "$Id$"; #endif #define INIT_BITS 6 @@ -60,33 +61,7 @@ static void hnode_free(hnode_t *node, void *context); static hash_val_t hash_fun_default(const void *key); static int hash_comp_default(const void *key1, const void *key2); -int hash_val_t_bit; - -/* - * Compute the number of bits in the hash_val_t type. We know that hash_val_t - * is an unsigned integral type. Thus the highest value it can hold is a - * Mersenne number (power of two, less one). We initialize a hash_val_t - * object with this value and then shift bits out one by one while counting. - * Notes: - * 1. HASH_VAL_T_MAX is a Mersenne number---one that is one less than a power - * of two. This means that its binary representation consists of all one - * bits, and hence ``val'' is initialized to all one bits. - * 2. While bits remain in val, we increment the bit count and shift it to the - * right, replacing the topmost bit by zero. - */ - -static void compute_bits(void) -{ - hash_val_t val = HASH_VAL_T_MAX; /* 1 */ - int bits = 0; - - while (val) { /* 2 */ - bits++; - val >>= 1; - } - - hash_val_t_bit = bits; -} +static const int hash_val_t_bit = EKHTML_HASH_BITS; /* * Verify whether the given argument is a power of two. |