[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] Win-dos GAWK and BINMODE bug

From: Stepan Kasal
Subject: [patch] Win-dos GAWK and BINMODE bug
Date: Wed, 18 Sep 2002 12:55:08 +0200
User-agent: Mutt/

In recent postings to comp.lang.awk (under subjects
        "awk on windows 2000" and
        "Win-dos GAWK and BINMODE (Was: Re: awk on windows 2000)"
the following bug report has appeared:

From: address@hidden (Richard Ivarson)
Date: 17 Sep 2002 13:17:33 -0700


The program:

  BINMODE = "w"
  printf("%c", 10) > "Testfile.bin"  # is the same: printf("\n") ...

should produce a file "Testfile.bin" containing only one char---'\n'.

In most win32 ports (eg. from http://unxutils.sourceforge.net),
it produces '\r\n' though.

The Gnuwin32 port works correctly.
(The status of Cygwin port is unclear to me (Stepan Kasal).)

The patch can be extracted from file gawk-3.1.0_GNUWIN32.diffs
from gawk-3.1.0-2-src.zip from http://gnuwin32.sourceforge.net.

I've made it relative to 3.1.1 (attached to this bug report).

Have a nice day,

diff -urpN gawk-3.1.1.p3/io.c gawk-3.1.1/io.c
--- gawk-3.1.1.p3/io.c  Mon Sep 16 10:07:23 2002
+++ gawk-3.1.1/io.c     Wed Sep 18 12:31:57 2002
@@ -135,7 +135,7 @@ extern NODE **fields_arr;
 static jmp_buf filebuf;                /* for do_nextfile() */
-#if defined(MSDOS) || defined(OS2) || defined(__EMX__)
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__EMX__)
 static const char *
 binmode(char *mode)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]