+2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * utils.c (read_file): Don't use wgint for file size; LFS won't
+ work since the file is mmap'ed as a whole.
+
+ * options.h: Don't include stdio.h.
+
+ * log.c: Ditto.
+
+ * init.c: Disambiguate assignment from non-zero test to avoid
+ Borland C warning.
+
+ * http.c (response_new): Don't needlessly post-increment count.
+
+ * hash.c: Include stdio.h.
+
+ * gnu-md5.h: Don't include stdio.h.
+
+ * getopt.h (struct option): Always use const.
+
+ * ftp.c (getftp): Avoid unnecessary assignment to RES to avoid
+ Borland C warning.
+
+ * ftp-ls.c: Disambiguate assignment from non-zero test to avoid
+ Borland C warning.
+
+ * cmpt.c (strptime_internal): Don't initialize rp_backup when
+ !_NL_CURRENT to avoid Borland C warning.
+
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (fopen_excl): Fix parse error when O_BINARY is
struct tm *tm;
enum locale_status *decided;
{
+#ifdef _NL_CURRENT
const char *rp_backup;
+#endif
int cnt;
size_t val;
int have_I, is_pm;
start_over:
#endif
+#ifdef _NL_CURRENT
/* Make back up of current processing pointer. */
rp_backup = rp;
+#endif
switch (*fmt++)
{
dir = l = NULL;
/* Line loop to end of file: */
- while ((line = read_whole_line (fp)))
+ while ((line = read_whole_line (fp)) != NULL)
{
len = clean_line (line);
/* Skip if total... */
This tactic is quite dubious when it comes to
internationalization issues (non-English month names), but it
works for now. */
- while ((tok = strtok (NULL, " ")))
+ while ((tok = strtok (NULL, " ")) != NULL)
{
--next;
if (next < 0) /* a month name was not encountered */
dir = l = NULL;
/* Line loop to end of file: */
- while ((line = read_whole_line (fp)))
+ while ((line = read_whole_line (fp)) != NULL)
{
len = clean_line (line);
l->next = NULL;
}
- xfree(line);
+ xfree (line);
}
fclose(fp);
/* Skip empty line. */
line = read_whole_line (fp);
- if (line)
- xfree (line);
+ xfree_null (line);
/* Skip "Directory PUB$DEVICE[PUB]" */
line = read_whole_line (fp);
- if (line)
- xfree (line);
+ xfree_null (line);
/* Skip empty line. */
line = read_whole_line (fp);
- if (line)
- xfree (line);
+ xfree_null (line);
/* Line loop to end of file: */
- while ((line = read_whole_line (fp)))
+ while ((line = read_whole_line (fp)) != NULL)
{
char *p;
i = clean_line (line);
/* Fourth/Third column: Time hh:mm[:ss] */
tok = strtok (NULL, " ");
if (tok == NULL) continue;
- hour = min = sec = 0;
+ min = sec = 0;
p = tok;
hour = atoi (p);
for (; *p && *p != ':'; ++p);
char *line;
/* The lines are being read with read_whole_line because of
no-buffering on opt.lfile. */
- while ((line = read_whole_line (fp)))
+ while ((line = read_whole_line (fp)) != NULL)
{
logprintf (LOG_ALWAYS, "%s\n", escnonprint (line));
xfree (line);
return RETRBADPATTERN;
}
}
- res = RETROK;
if (start)
{
/* Just get everything. */
con.rs = ST_UNIX;
con.id = NULL;
con.proxy = proxy;
- res = RETROK; /* in case it's not used */
/* If the file name is empty, the user probably wants a directory
index. We'll provide one, properly HTML-ized. Unless
struct option
{
-#if __STDC__
const char *name;
-#else
- char *name;
-#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
#ifndef _MD5_H
#define _MD5_H 1
-#include <stdio.h>
-
#if defined HAVE_LIMITS_H || _LIBC
# include <limits.h>
#endif
extern void *md5_read_ctx PARAMS ((const struct md5_ctx *ctx, void *resbuf));
+#if 0 /* Unused in Wget */
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
extern int md5_stream PARAMS ((FILE *stream, void *resblock));
+#endif
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
# include <limits.h>
#endif
+#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
while (*hdr == ' ' || *hdr == '\t');
}
DO_REALLOC (resp->headers, size, count + 1, const char *);
- resp->headers[count++] = NULL;
+ resp->headers[count] = NULL;
return resp;
}
int flags;
/* Whether authorization has been already tried. */
- int auth_tried_already = 0;
+ int auth_tried_already;
/* Whether our connection to the remote host is through SSL. */
int using_ssl = 0;
proxy ? "Proxy" : "HTTP");
contlen = -1;
contrange = 0;
- type = NULL;
- statcode = -1;
*dt &= ~RETROKF;
head = fd_read_http_head (sock);
static int
extract_header_attr (const char *au, const char *attr_name, char **ret)
{
- const char *cp, *ep;
-
- ep = cp = au;
+ const char *ep;
+ const char *cp = au;
if (strncmp (cp, attr_name, strlen (attr_name)) == 0)
{
}
enable_tilde_expansion = 1;
ln = 1;
- while ((line = read_whole_line (fp)))
+ while ((line = read_whole_line (fp)) != NULL)
{
char *com, *val;
int comind, status;
FILE *fp;
check_redirect_output ();
- if (!(fp = get_log_fp ()))
+ if ((fp = get_log_fp ()) == NULL)
return;
CHECK_VERBOSE (o);
#ifdef WINDOWS
/* Drop extension (typically .EXE) from executable filename. */
- windows_main_junk (&argc, (char **) argv, (char **) &exec_name);
+ windows_main (&argc, (char **) argv, (char **) &exec_name);
#endif
/* Set option defaults; read the system wgetrc and ~/.wgetrc. */
break;
case OPT_FUNCALL:
{
- void (*func) PARAMS ((void)) = opt->data;
+ void (*func) PARAMS ((void)) = (void (*) PARAMS ((void))) opt->data;
func ();
}
break;
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
-/* Needed for FDP. */
-#include <stdio.h>
-
struct options
{
int verbose; /* Are we verbose? */
int
make_directory (const char *directory)
{
- int quit = 0;
- int i;
- int ret = 0;
+ int i, ret, quit = 0;
char *dir;
/* Make a copy of dir, to be able to write to it. Otherwise, the
{
int fd;
struct file_memory *fm;
- wgint size;
+ long size;
int inhibit_close = 0;
/* Some magic in the finest tradition of Perl and its kin: if FILE
struct file_memory {
char *content;
- wgint length;
+ long length;
int mmap_p;
};