Re: vfs.c "Could not parse"



Christian Gennerat wrote:

> "Andrew V. Samoilov" a .crit :
>
> > > The table in
> > > static int
> > > is_month (char *str, struct tm *tim)
> > > {
> > >     static char *month = "JanFebMarAprMayJunJulAugSepOctNovDec";
> > >
> > > is obviously an English table, and is good for most servers.
> >
> > Some time ago we discussed this.  Then extended ftpfs URL with
> > locale specifiacation was proposed.  But it does not cure if you
> > have not required locale installed on your system.
> >
> > Another way is to add possibility learn ftpfs about such locales.
> > But it seems noone in the team has wish and time (in such order)
> > to implement this feature.
>
> Is there something about this in the FTP spec ?
>

No. And it is a root of many problems.

> I have solved the problem by commenting the line
> #LC_TIME=fr.ISO8859-15
> in the solaris machine (general environment).

Not all of us is system administrators.  And as a rule I had such
problems with ftp servers in other countries.


>
> I looked in my linux box:
> When I do "ls -la" in a console, I have the "french" date
> When ProFTP does "ls -la", it prints the "international" date.
> So I think that Solaris FTP has to do:
> setenv LC_ALL=C; ls -la $dir

No, ftpd/inetd must be invoked with English/C/POSIX locale.


> It is easier to do than a code like this in vfs.c
> /* Month name */
> if(is_month(p, &tim)
> #IFDEF ACCEPT_TIME_FR
>  ||is_month_fr(p, &tim)
> #ENDIF
> #IFDEF ACCEPT_TIME_RU
>  ||is_month_ru(p, &tim)
> #ENDIF
>     ){
>
> and it can be very long...
>

No, I suggest to initialize month/day string/array with
appropriative localized months/days on each non-english ftpfs
connection. And is_month can accept this string/array as
second parameter.


> and is_month_fr will accept "jan f.v mars avr mai juin juil"
> on some locales (Solaris), or "jan f.v mar avr mai jun jul"
> on others.

I think month names must be 3 character long.

Regards,
Andrew.






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