This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Date bug affecting gawk-3.0.4 on Cygwin32


Greetings.  Re this:

> From: "Doug Wyatt" <dwyatt@sunflower.com>
> To: cygwin@sourceware.cygnus.com, bug-gnu-utils@gnu.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@skeeve.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]