I also looked into this, I think Gustaf must be right. The reason is
that the AOLserver C code passes in the format string, which is clearly
correct. %d is the zero padded day number [01-31]. After the call, the
modified buffer is sent back as-is, so the bug isn't in AOLserver. 

The good news, if there is any here is that to set the time formats, you
only need to adjust the LC_TIME database, using localedef or locale-gen.
Here is a somewhat helpful link:

http://www.regatta.cs.msu.su/doc/usr/share/man/info/ru_RU/a_doc_lib/files/aixfiles/LC_TIME.htm


Aside from this issue, the code has obvious limitations built into the
design, at least ns_parsehttptime. For some reason, ns_parsehttptime
uses a return value of 0 to indicate failure. Probably a value of NULL
should have been used instead. However, this will only be a problem if
we need to maintain documents created in 1970. 

The other issue is that ns_parsehttptime, which is based upon RFC 1123,
should be somewhat forgiving in parsing the time components. It clearly
fails when the day number is 1-9 with a leading blank space. Probably
the MakeNum API helper should be modified to test the result ranges for
each number, and somehow provide feedback on how much  buffer was
consumed. 

tom jackson

On Mon, 2009-05-11 at 09:02 +0200, Gustaf Neumann wrote:
> Dear Alexey,
> 
>  From the output, i start to believe that the setting of
> LANG/LOCALE is not the problem, but i am getting the
> suspicion that there is a bug in the c-library of your
> operating system. What operating system do you use?
> 
> Rationale: aolserver uses strftime(..., ..., "... %d ...", ...)
> to format the day of month. Since strftime() is defined
> in the C-library, the bug should be there.
> 
> -gustaf neumann
> 
> Alexey Pechnikov schrieb:
> > Hello!
> >
> > On Sunday 10 May 2009 23:42:08 Tom Jackson wrote:
> >   
> >> I wonder if you have to set this before your start nstclsh?
> >>     
> >
> > $ LANG="en_US.UTF-8" nstclsh
> > % ns_httptime 0
> > Thu, 1 Jan 1970 00:00:00 GMT
> >
> >   
> >> You might also see what my replacement proc produces, or just try in
> >> nstclsh:
> >>     
> >
> > $ nstclsh
> > % set seconds 0
> > 0
> > % clock format $seconds -format "%a, %d %b %Y %H:%M:%S %Z" -gmt 3
> > Thu, 01 Jan 1970 00:00:00 GMT
> >
> >   
> >> But I just noticed something strange:
> >>
> >> % ns_parsehttptime [ns_httptime 0] 
> >> invalid time: Thu, 01 Jan 1970 00:00:00 GMT
> >> % ns_parsehttptime "Thu, 01 Jan 1970 00:00:00 GMT"
> >> invalid time: Thu, 01 Jan 1970 00:00:00 GMT
> >> % ns_parsehttptime "Thu, 1 Jan 1970 00:00:00 GMT"
> >> invalid time: Thu, 1 JAn 1970 00:00:00 GMT
> >>
> >> On the last one, notice that the month gets converted to JAn. 
> >>     
> >
> > Hm, I'm get the same result for my ru_RU.UTF-8 locale.
> >
> > Best regards, Alexey Pechnikov.
> > http://pechnikov.tel/
> >
> >
> > --
> > AOLserver - http://www.aolserver.com/
> >
> > To Remove yourself from this list, simply send an email to 
> > <[email protected]> with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave the 
> > Subject: field of your email blank.
> >   
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to 
> <[email protected]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field of your email blank.
> 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to