GNU bug report logs - #23600
25.1.50; encode-time returns wrong result

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Sun, 22 May 2016 22:12:01 UTC

Severity: normal

Found in version 25.1.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: kzhr <at> d1.dion.ne.jp, 23600 <at> debbugs.gnu.org
Subject: bug#23600: 25.1.50; encode-time returns wrong result
Date: Sat, 04 Jun 2016 18:51:50 +0300
> Cc: 23600 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Wed, 1 Jun 2016 01:19:50 -0700
> 
> +  if (strncmp (str, "TZ=<", 4) == 0)
> +    {
> +      /* MS-Windows does not support POSIX.1-2001 angle-bracket TZ
> +	 abbreviation syntax.  Convert to POSIX.1-1988 syntax if possible,
> +	 and to the undocumented placeholder "ZZZ" otherwise.  */
> +      bool supported_abbr = true;
> +      for (char *p = str + 4; *p; p++)
> +	{
> +	  if (('0' <= *p && *p <= '9') || *p == '-' || *p == '+')
> +	    supported_abbr = false;
> +	  else if (*p == '>')
> +	    {
> +	      ptrdiff_t abbrlen;
> +	      if (supported_abbr)
> +		{
> +		  abbrlen = p - (str + 4);
> +		  memmove (str + 3, str + 4, abbrlen);
> +		}
> +	      else
> +		{
> +		  abbrlen = 3;
> +		  memset (str + 3, 'Z', abbrlen);
> +		}
> +	      memmove (str + 3 + abbrlen, p + 1, strlen (p));
> +	      break;
> +	    }

Do callers of putenv expect the argument to be destroyed?

Thanks.




This bug report was last modified 9 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.