mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Commit "minor fixes".
This commit is contained in:
parent
e006b1628b
commit
0e2b74ce3b
@ -1,3 +1,20 @@
|
||||
2000-11-05 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||
|
||||
* wget.h (DO_REALLOC_FROM_ALLOCA): Use braces to disambiguate
|
||||
`if'.
|
||||
|
||||
2000-11-05 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||
|
||||
* url.c (construct): Insert unneeded initialization for the
|
||||
compiler to shut up.
|
||||
|
||||
* config.h.in: Define _XOPEN_SOURCE to 500 to get the prototype
|
||||
for strptime() (*duh*). Define _SVID_SOURCE to get S_IFLNK which
|
||||
otherwise gets lost when you define _XOPEN_SOURCE.
|
||||
|
||||
* utils.c (touch): Include the file name in the error message.
|
||||
From Debian.
|
||||
|
||||
2000-11-05 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||
|
||||
* log.c (logvprintf): Use vsnprintf() in all cases. If necessary,
|
||||
|
@ -194,4 +194,20 @@ char *alloca ();
|
||||
/* Define to 1 if ANSI function prototypes are usable. */
|
||||
#undef PROTOTYPES
|
||||
|
||||
/* Debian says:
|
||||
|
||||
to get prototype for strptime, we need this (taken from lftp)
|
||||
#ifdef __linux__
|
||||
#define __USE_XOPEN 1
|
||||
#endif
|
||||
|
||||
But I don't think that's right. The __USE_XOPEN thing is an
|
||||
internal glibc2 thing that gets defined in features.h. From
|
||||
reading that file carefully, I think we need something like this
|
||||
incantation. Without testing it, I can only hope that this won't
|
||||
screw things up on other, non-glibc2 systems. */
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#define _SVID_SOURCE
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
@ -960,7 +960,14 @@ File `%s' already there, will not retrieve.\n"), u->local);
|
||||
_wasn't_ specified last time, or the server contains files called
|
||||
*.orig, -N will be back to not operating correctly with -k. */
|
||||
{
|
||||
/* Would a single s[n]printf() call be faster? */
|
||||
/* Would a single s[n]printf() call be faster? --dan
|
||||
|
||||
It wouldn't. sprintf() is horribly slow. At one point I
|
||||
profiled Wget, and found that a measurable and
|
||||
non-negligible amount of time was lost calling sprintf()
|
||||
in url.c. Replacing sprintf with inline calls to
|
||||
strcpy() and long_to_string() made a difference.
|
||||
--hniksic */
|
||||
strcpy(filename_plus_orig_suffix, u->local);
|
||||
strcpy(filename_plus_orig_suffix + filename_len, ".orig");
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Messages logging.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Wget.
|
||||
|
||||
|
@ -1395,7 +1395,8 @@ construct (const char *url, const char *sub, int subsize, int no_proto)
|
||||
"/qux/xyzzy", our result should be
|
||||
"http://host/qux/xyzzy". */
|
||||
int span;
|
||||
const char *slash, *start_insert;
|
||||
const char *slash;
|
||||
const char *start_insert = NULL; /* for gcc to shut up. */
|
||||
const char *pos = url;
|
||||
int seen_slash_slash = 0;
|
||||
/* We're looking for the first slash, but want to ignore
|
||||
|
@ -411,7 +411,7 @@ touch (const char *file, time_t tm)
|
||||
#endif
|
||||
|
||||
if (utime (file, ×) == -1)
|
||||
logprintf (LOG_NOTQUIET, "utime: %s\n", strerror (errno));
|
||||
logprintf (LOG_NOTQUIET, "utime(%s): %s\n", file, strerror (errno));
|
||||
}
|
||||
|
||||
/* Checks if FILE is a symbolic link, and removes it if it is. Does
|
||||
|
40
src/wget.h
40
src/wget.h
@ -173,25 +173,27 @@ char *xstrdup PARAMS ((const char *));
|
||||
DO_REALLOC. */
|
||||
#define DO_REALLOC_FROM_ALLOCA(basevar, sizevar, needed_size, allocap, type) do \
|
||||
{ \
|
||||
/* Avoid side-effectualness. */ \
|
||||
long do_realloc_needed_size = (needed_size); \
|
||||
long do_realloc_newsize = 0; \
|
||||
while ((sizevar) < (do_realloc_needed_size)) { \
|
||||
do_realloc_newsize = 2*(sizevar); \
|
||||
if (do_realloc_newsize < 16) \
|
||||
do_realloc_newsize = 16; \
|
||||
(sizevar) = do_realloc_newsize; \
|
||||
} \
|
||||
if (do_realloc_newsize) \
|
||||
if (!allocap) \
|
||||
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
|
||||
else \
|
||||
{ \
|
||||
void *drfa_new_basevar = xmalloc (do_realloc_newsize); \
|
||||
memcpy (drfa_new_basevar, basevar, sizevar); \
|
||||
(basevar) = drfa_new_basevar; \
|
||||
allocap = 0; \
|
||||
} \
|
||||
/* Avoid side-effectualness. */ \
|
||||
long do_realloc_needed_size = (needed_size); \
|
||||
long do_realloc_newsize = 0; \
|
||||
while ((sizevar) < (do_realloc_needed_size)) { \
|
||||
do_realloc_newsize = 2*(sizevar); \
|
||||
if (do_realloc_newsize < 16) \
|
||||
do_realloc_newsize = 16; \
|
||||
(sizevar) = do_realloc_newsize; \
|
||||
} \
|
||||
if (do_realloc_newsize) \
|
||||
{ \
|
||||
if (!allocap) \
|
||||
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
|
||||
else \
|
||||
{ \
|
||||
void *drfa_new_basevar = xmalloc (do_realloc_newsize); \
|
||||
memcpy (drfa_new_basevar, basevar, sizevar); \
|
||||
(basevar) = drfa_new_basevar; \
|
||||
allocap = 0; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Free FOO if it is non-NULL. */
|
||||
|
Loading…
Reference in New Issue
Block a user