Re: tzset(3) calls before new localtime_r(3) calls

2019-06-17 Fir de Conversatie 'Tom Ryder' via vim_dev
On Mon, Jun 17, 2019 at 09:47:35AM +1200, Tom Ryder wrote: On Sun, Jun 16, 2019 at 03:32:30PM +0200, Bram Moolenaar wrote: Just add it as a global function, without "static". Then update the prototype in src/proto/evalfunc.pro. You can do it automatically if you have cproto, but it's easy

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-16 Fir de Conversatie 'Tom Ryder' via vim_dev
On Sun, Jun 16, 2019 at 03:32:30PM +0200, Bram Moolenaar wrote: Just add it as a global function, without "static". Then update the prototype in src/proto/evalfunc.pro. You can do it automatically if you have cproto, but it's easy enough to do manually. OK, I will do that. Sorry you had to

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-16 Fir de Conversatie Bram Moolenaar
Tom Ryder wrote: > On Sat, Jun 15, 2019 at 04:06:17PM +0200, Bram Moolenaar wrote: > >I rather not add a new file, this can go into evalfunc.c. That file is > >getting a bit big, I'll probably move some things out of there later. > > I had considered that, but localtime()/localtime_r() is

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-15 Fir de Conversatie 'Tom Ryder' via vim_dev
On Sat, Jun 15, 2019 at 04:06:17PM +0200, Bram Moolenaar wrote: I rather not add a new file, this can go into evalfunc.c. That file is getting a bit big, I'll probably move some things out of there later. I had considered that, but localtime()/localtime_r() is called in two other contexts

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-15 Fir de Conversatie Bram Moolenaar
Dominique wrote: > Bram Moolenaar wrote: > > > Tom Ryder wrote: > > > > > Hello Vim developers; attached is a suggested patch for correcting > > > a problem I noticed with time zones and Vim's strftime() function since > > > v8.1.1313, with an accompanying test. > > > > > > I was not sure how

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-15 Fir de Conversatie Bram Moolenaar
Tom Ryder wrote: > On Fri, Jun 14, 2019 at 12:43:32PM +1200, Tom Ryder via vim_dev wrote: > >On Thu, Jun 13, 2019 at 08:40:27PM +0200, Bram Moolenaar wrote: > >>Can you make a patch that adds a function to call localtime_r() and > >>keeps the current value of $TZ, and calls tzset() only when

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-15 Fir de Conversatie Dominique Pellé
Bram Moolenaar wrote: > Tom Ryder wrote: > > > Hello Vim developers; attached is a suggested patch for correcting > > a problem I noticed with time zones and Vim's strftime() function since > > v8.1.1313, with an accompanying test. > > > > I was not sure how best to do this portably, but I hope

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-15 Fir de Conversatie 'Tom Ryder' via vim_dev
On Fri, Jun 14, 2019 at 12:43:32PM +1200, Tom Ryder via vim_dev wrote: On Thu, Jun 13, 2019 at 08:40:27PM +0200, Bram Moolenaar wrote: Can you make a patch that adds a function to call localtime_r() and keeps the current value of $TZ, and calls tzset() only when it changes? Yes, I think so.

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-13 Fir de Conversatie 'Tom Ryder' via vim_dev
On Thu, Jun 13, 2019 at 08:40:27PM +0200, Bram Moolenaar wrote: Can you make a patch that adds a function to call localtime_r() and keeps the current value of $TZ, and calls tzset() only when it changes? Yes, I think so. I'll attempt that later today. Thanks. -- Tom Ryder

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-13 Fir de Conversatie Bram Moolenaar
Tom Ryder wrote: > Hi Bram, thanks for looking at the issue. > > On Wed, Jun 12, 2019 at 07:34:36PM +0200, Bram Moolenaar wrote: > >I would guess that localtime() always sets the variables, while > >localtime_r() is not guaranteed to do that. But it does NOT say that > >calling tzset()

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-12 Fir de Conversatie 'Tom Ryder' via vim_dev
Hi Bram, thanks for looking at the issue. On Wed, Jun 12, 2019 at 07:34:36PM +0200, Bram Moolenaar wrote: I would guess that localtime() always sets the variables, while localtime_r() is not guaranteed to do that. But it does NOT say that calling tzset() before localtime_r() is required to

Re: tzset(3) calls before new localtime_r(3) calls

2019-06-12 Fir de Conversatie Bram Moolenaar
Tom Ryder wrote: > Hello Vim developers; attached is a suggested patch for correcting > a problem I noticed with time zones and Vim's strftime() function since > v8.1.1313, with an accompanying test. > > I was not sure how best to do this portably, but I hope that the patch > description

tzset(3) calls before new localtime_r(3) calls

2019-06-12 Fir de Conversatie 'Tom Ryder' via vim_dev
Hello Vim developers; attached is a suggested patch for correcting a problem I noticed with time zones and Vim's strftime() function since v8.1.1313, with an accompanying test. I was not sure how best to do this portably, but I hope that the patch description and the diff that corrects the