mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Check for do_realloc_newsize in loop condition because we're no longer
setting SIZEVAR here.
This commit is contained in:
parent
d015d3cbd3
commit
b4e6054de9
@ -1,8 +1,7 @@
|
|||||||
2001-06-18 Hrvoje Niksic <hniksic@arsdigita.com>
|
2001-06-26 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* recur.c (convert_all_links): Make sure "../" stuff is properly
|
* wget.h (DO_REALLOC_FROM_ALLOCA): Check for do_realloc_newsize in
|
||||||
handled in cur_url->url before we hand it over to convert_links.
|
loop condition because we're no longer setting SIZEVAR here.
|
||||||
(register_download): Canonicalize URL before storing it.
|
|
||||||
|
|
||||||
2001-06-26 Hrvoje Niksic <hniksic@arsdigita.com>
|
2001-06-26 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
|
10
src/wget.h
10
src/wget.h
@ -231,20 +231,20 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
|
|||||||
{ \
|
{ \
|
||||||
/* Avoid side-effectualness. */ \
|
/* Avoid side-effectualness. */ \
|
||||||
long do_realloc_needed_size = (needed_size); \
|
long do_realloc_needed_size = (needed_size); \
|
||||||
long do_realloc_newsize = 0; \
|
long do_realloc_newsize = (sizevar); \
|
||||||
while ((sizevar) < (do_realloc_needed_size)) { \
|
while (do_realloc_newsize < do_realloc_needed_size) { \
|
||||||
do_realloc_newsize = 2*(sizevar); \
|
do_realloc_newsize <<= 1; \
|
||||||
if (do_realloc_newsize < 16) \
|
if (do_realloc_newsize < 16) \
|
||||||
do_realloc_newsize = 16; \
|
do_realloc_newsize = 16; \
|
||||||
} \
|
} \
|
||||||
if (do_realloc_newsize) \
|
if (do_realloc_newsize != (sizevar)) \
|
||||||
{ \
|
{ \
|
||||||
if (!allocap) \
|
if (!allocap) \
|
||||||
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
|
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
void *drfa_new_basevar = xmalloc (do_realloc_newsize); \
|
void *drfa_new_basevar = xmalloc (do_realloc_newsize); \
|
||||||
memcpy (drfa_new_basevar, basevar, sizevar); \
|
memcpy (drfa_new_basevar, basevar, (sizevar)); \
|
||||||
(basevar) = drfa_new_basevar; \
|
(basevar) = drfa_new_basevar; \
|
||||||
allocap = 0; \
|
allocap = 0; \
|
||||||
} \
|
} \
|
||||||
|
Loading…
Reference in New Issue
Block a user