Subject: bug#12177: mdate-sh scriptversion=2009-04-28.21; # UTC

From: Stefano Lattarini <[email-masked]>
Date: Sun, 12 Aug 2012 10:56:19 +0200

Hi Doug, thanks for the report.

On 08/11/2012 02:59 AM, doug wrote:
> This file is found in make-3.82 and autotools packages.
>
Which Automake version?

> It runs forever some systems.
>
Not anymore, since Ralf Wildenhues fixed it two years ago (2010-08-21)
with commit v1.11-188-gb268a1f "Improve robustness of mdate-sh script":

    Improve robustness of mdate-sh script.

    * lib/mdate-sh: Sanitize zsh behavior on startup, to ensure
    $ls_command is word-split properly upon invocation.
    (error): New function.
    (main): Use it.  Improve error checking to avoid endless loop
    in case $ls_command gave bogus output.  Fix eval quotation.
    * tests/mdate6.test: New test, to expose eval quotation error.
    * tests/Makefile.am: Update.

The script will still experience an error, though (which is better
than an endless loop).

> Note below:
> 
> # TIME_STYLE="posix-long-iso" echo x`/home/doug/gentoo/bin/ls -L -d -n /` 
> xdrwxr-xr-x 22 0 0 512 July 24 01:43 /
>                        ^^^^
>
What happens if TIME_STYLE is simply unset?

> Now look at line 114
> 
>     Jul) month=July; nummonth=7;;
> 
> July will never match Jul and so the loop is infinite.
> 
> Regards
> - Doug

Thanks,
  Stefano