Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: date bug in zsh 3.0.5



On 30 Dec, Bousfield Peter wrote:

>  The %W prompt variable does not seem to work correctly in zsh 3.0.5

>  The century is display as :0 not 00!

The century isn't displayed at all, the years within the century is.

To fix this edit Src/utils.c and replace this

            case 'y':
                *buf++ = '0' + tm->tm_year / 10;
                *buf++ = '0' + tm->tm_year % 10;
                break;

with this

            case 'y':
                *buf++ = '0' + ( tm->tm_year / 10 ) % 10;  /* Y2K fix */
                *buf++ = '0' + tm->tm_year % 10;
                break;

This bug is fixed in version 3.1.5.

-- 
 Goran Larsson            hoh@xxxxxxxxxx
 I was an atheist,        http://home.swipnet.se/hoh/
 until I found out I was God.




Messages sorted by: Reverse Date, Date, Thread, Author