1
0
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:
hniksic 2000-11-06 13:24:57 -08:00
parent e006b1628b
commit 0e2b74ce3b
7 changed files with 66 additions and 23 deletions

View File

@ -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,

View File

@ -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 */

View File

@ -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");

View File

@ -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.

View File

@ -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

View File

@ -411,7 +411,7 @@ touch (const char *file, time_t tm)
#endif
if (utime (file, &times) == -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

View File

@ -183,6 +183,7 @@ char *xstrdup PARAMS ((const char *));
(sizevar) = do_realloc_newsize; \
} \
if (do_realloc_newsize) \
{ \
if (!allocap) \
XREALLOC_ARRAY (basevar, type, do_realloc_newsize); \
else \
@ -192,6 +193,7 @@ char *xstrdup PARAMS ((const char *));
(basevar) = drfa_new_basevar; \
allocap = 0; \
} \
} \
} while (0)
/* Free FOO if it is non-NULL. */