Re: vfs bug



Hi!

> I just found a bug in mc vfs code. It appears when parsing ftp listing 
> containing files such "2000 bla-bla".
> (Yes, i know, spaces are bad).
> The bug is that vfs_parse_filedate tries to interprete first word of 
> file ("2000") as year.
> I suggest this patch, but not sure, please fix me if i wrong (made 
> against today cvs version)

Unfortunately, this can't be solved this easily. Apparently some servers
put year there, and some dont.
								Pavel

> diff -ru3 mc-4.5.55/vfs/vfs.c mc-4.5.55.new/vfs/vfs.c
> --- mc-4.5.55/vfs/vfs.c Sun Aug 19 20:11:39 2001
> +++ mc-4.5.55.new/vfs/vfs.c     Sat Aug 10 21:12:05 2002
> @@ -1592,8 +1592,8 @@
>             idx++;
> 
>         /* This is a special case for ctime() or Mon DD YYYY hh:mm */
> -       if(is_num (idx) && (columns[idx+1][0]) &&
> -           ((got_year |= is_year(columns[idx], &tim)) || 
> is_time(columns[idx], &tim)))
> +       if(is_num (idx) && (columns[idx+1][0]) && !got_year &&
> +           is_time(columns[idx], &tim))
>                 idx++; /* time & year or reverse */
>         } /* only time or date */
>      }
> 
> 
> _______________________________________________
> Mc-devel mailing list
> Mc-devel gnome org
> http://mail.gnome.org/mailman/listinfo/mc-devel

-- 
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]