delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/25/22:39:18

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199910260238.TAA01488@cascadia.a42.com>
From: Aharon Robbins <arnold AT skeeve DOT com>
Date: Sun, 24 Oct 1999 08:56:43 +0200
To: bug-gnu-utils AT gnu DOT org, cygwin AT sourceware DOT cygnus DOT com, dwyatt AT sunflower DOT com
Subject: Re: Date bug affecting gawk-3.0.4 on Cygwin32
Status: RO

Greetings.  Re this:

> From: "Doug Wyatt" <dwyatt AT sunflower DOT com>
> To: cygwin AT sourceware DOT cygnus DOT com, bug-gnu-utils AT gnu DOT org
> Date: Sat, 16 Oct 1999 20:14:16 -0500
> Subject: Date bug affecting gawk-3.0.4 on Cygwin32
>
> Hi,
>
> I just built gawk-3.0.4 under Cygwin32.  It passed all but two of the
> tests.  Poundbang failed because 'gawk' is really 'gawk.exe' - no
> problem.
>
> Strftime() failed because Cygwin /bin/date generates 2 spaces
> before the year [Sat Oct 16 04:19:02  1999].

This is the key.  What in fact is happening is that it is leaving
out the timezone, or rather, using an empty timezone name (compare the
output on a Unix system).

> Gawk's print and
> printf( "%s\n", $0 ) tend to truncate space separators to a single
> space.

Only when the record is modified, then it is rebuilt using just a
single space separator.  Thus, when $3 is reassigned, the record
is rebuilt.

> But, under Cygwin strftime() outputs 2 spaces before the
> year as does /bin/date,

Gawk uses the system's strftime, if there is one, so this isn't suprising.

Here is a workaround for the test that should allow things to work
on cygwin.  I don't have access to such right now, so I can't test it,
but this fix continues to work on my Linux system.  This applies
to test/Makefile.in in the gawk dist.

In the meantime, it'd be good if the Cygnus folks can get their
code to return a timezone name.

Enjoy,

Arnold Robbins
----------------------------------------
*** ../../gawk-3.0.4/test/Makefile.in	Tue May 25 06:37:41 1999
--- Makefile.in	Sun Oct 24 08:45:13 1999
***************
*** 217,223 ****
  	@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
  	date | $(AWK) '{ $$3 = sprintf("%02d", $$3 + 0) ; \
  	print > "strftime.ok" ; \
! 	print strftime() > "'_$@'" }'
  	$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
  
  litoct::
--- 217,224 ----
  	@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
  	date | $(AWK) '{ $$3 = sprintf("%02d", $$3 + 0) ; \
  	print > "strftime.ok" ; \
! 	$$0 = strftime() ; $$NF = $$NF ; \
! 	print > "'_$@'" }'
  	$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
  
  litoct::
--
Aharon (Arnold) Robbins		arnold AT skeeve DOT com  [ <<=== NOTE: NEW ADDRESS!! ]
P.O. Box 354		Home Phone: +972  8 979-0381	Fax: +1 603 761-6761
Nof Ayalon		Cell Phone: +972 51  297-545	(See www.efax.com)
D.N. Shimshon 99784	Laundry increases exponentially in the
ISRAEL			number of children. -- Miriam Robbins


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019