Alexander Pyhalov via illumos-discuss <[email protected]> wrote:
> Hello.
>
> While debugging one strange issue (gftp doesn't show file names on OI),
> I've found the following difference in locale behavior between OI
> Hipster and Solaris (snv 97).
>
> The following program:
>
> #include <stdio.h>
> #include <time.h>
> #include <libintl.h>
> #include <locale.h>
>
> int main()
> {
> struct tm curtime;
> char *str="Feb 6 16:38 .",*tmppos,*format;
>
> setlocale(LC_ALL,"en_US.UTF-8");
>
> // format = dcgettext ("SUNW_OST_OSCMD", " %b %e %Y ", LC_TIME);
> format= dcgettext ("SUNW_OST_OSCMD", " %b %e %H:%M ", LC_TIME);
> if (format && *format == ' ')
> format++;
> tmppos = strptime (str, format, &curtime);
> // tmppos = strptime (str, "%b %e %H:%M", &curtime);
>
> printf("tmppos=%s",tmppos);
> return 0;
> }
>
> On OI prints:
> tmppos=.
>
> On Solaris:
> tmppos= .
>
> Note the space.
>
> Who is correct? Is it worth filing a bug?
I would say that "tmppos" must not starte with the space as the return from
strptime() is a ptr to the first unconverted char.
Oracle did introduce a lot of changes in strptime() since snv97, it the problem
is still in Oracle Solaris, it makes sense to report as Oracle should be
currently prepared to work on strptime() as we recently discussed strptime() in
the POSIX teleconferences.
Jörg
--
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin
[email protected] (work) Blog:
http://schily.blogspot.com/
URL: http://cdrecord.org/private/
http://sourceforge.net/projects/schilytools/files/'
-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com