Hello, giuseppe wrote a patch for 1.10.1.beta1. Full report can be viewed here: http://bugs.debian.org/319088
-------- Weitergeleitete Nachricht --------
> Von: giuseppe bonacci <[EMAIL PROTECTED]>
> Antwort an: giuseppe bonacci <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED]
> An: Debian Bug Tracking System <[EMAIL PROTECTED]>
> Betreff: Bug#319088: wget: don't rely on exactly one blank char
> between size and month
> Datum: Wed, 20 Jul 2005 10:26:20 +0200
>
> Package: wget
> Version: 1.10-3+1.10.1beta1
> Followup-For: Bug #319088
>
>
> A better patch is the following, that drops the assumption that there
> is exactly one blank char between size and month (implicit in the
> statement "char *t = tok - 2;").
>
> As far as I know, strtok() modifies the string
> "1234 aaa bbb@" (where @ stands for \0, for clarity)
> so that when tok points to "aaa" the string looks like
> "1234@ aaa@ bbb@",
> and (tok - 2) points to "", which is not useful for backtracking.
> I think the best way to access the previous token is ... keeping a pointer
> to it.
> g.b.
>
>
> --- wget-1.10/src/ftp-ls.c.orig 2005-05-12 18:24:33.000000000 +0200
> +++ wget-1.10/src/ftp-ls.c 2005-07-20 09:53:30.206791032 +0200
> @@ -110,7 +110,7 @@
> struct tm timestruct, *tnow;
> time_t timenow;
>
> - char *line, *tok; /* tokenizer */
> + char *line, *tok, *ptok; /* tokenizer */
> struct fileinfo *dir, *l, cur; /* list creation */
>
> fp = fopen (file, "rb");
> @@ -201,7 +201,9 @@
> This tactic is quite dubious when it comes to
> internationalization issues (non-English month names), but it
> works for now. */
> - while ((tok = strtok (NULL, " ")) != NULL)
> + ptok = line;
> + while (ptok = tok,
> + (tok = strtok(NULL, " ")) != NULL)
> {
> --next;
> if (next < 0) /* a month name was not encountered */
> @@ -217,9 +219,7 @@
>
> /* Back up to the beginning of the previous token
> and parse it with str_to_wgint. */
> - char *t = tok - 2;
> - while (t > line && ISDIGIT (*t))
> - --t;
> + char *t = ptok;
> if (t == line)
> {
> /* Something has gone wrong during parsing. */
>
> -- System Information:
> Debian Release: testing/unstable
> APT prefers testing
> APT policy: (500, 'testing')
> Architecture: i386 (i686)
> Shell: /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.8-2-686-smp
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
>
> Versions of packages wget depends on:
> ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries
> an
> ii libssl0.9.7 0.9.7e-3 SSL shared libraries
>
> wget recommends no packages.
>
> -- no debconf information
>
--
Noèl Köthe <noel debian.org>
Debian GNU/Linux, www.debian.org
signature.asc
Description: This is a digitally signed message part
