Mail Archives: djgpp/2003/05/08/12:05:43
> Date: Thu, 08 May 2003 14:14:17 +0200
> From: Manuel Collado <m DOT collado AT aaron DOT ls DOT fi DOT upm DOT es>
> Newsgroups: comp.os.msdos.djgpp
>
> F:\PRUEBAS\gawkbug>cat gawkbug.bat
> @echo off
> echo aaaaaaaaaaaaaaaaaaaaaaa > out.txt
> gawk -f bbbb >> out.txt
> echo -----------------------
> type out.txt
> echo -----------------------
> gawk --version
>
> F:\PRUEBAS\gawkbug>gawkbug
> -----------------------
> bbbb <======== overwritten
> aaaaaaaaaaaaaaaaa
> -----------------------
> GNU Awk 3.1.1
> Copyright (C) 1989, 1991-2002 Free Software Foundation....
>
>
> F:\PRUEBAS\gawkbug>gawkbug
> -----------------------
> aaaaaaaaaaaaaaaaaaaaaaa
> bbbb <======== appended
> -----------------------
> GNU Awk 3.0.6
> Copyright (C) 1989, 1991-2000 Free Software Foundation....
Thanks. This seems to be a convincing argument in favor of some
problem with redirected handles.
> > Redirection from the command line has nothing to do with Gawk (or any
> > DJGPP program). The redirection is done by the shell you are using,
> > either Bash or CMD.EXE. It's possible that CMD.EXE from NT4 has
> > problems with redirection when it runs DOS programs (I think I've
> > heard in the past a couple of reports along these lines, but I'm not
> > sure).
>
> Yes, this is what puzzles me. But the fact is that gawk 3.0.6 behaves
> correctly. And also other DJGPP ported utilities that write to stdout.
>
> Thinking about possible causes, I'm considering the following possibilities:
>
> - The ported gawk 3.1.1 code makes some test on the stdout handler and
> resets the file pointer in some circumstances.
>
> - The same action is performed at the library level.
Then how come the same Gawk works with Bash as the shell?
Perhaps the redirected handle is set up by CMD.EXE so that the
overwriting results? I'm just stabbing in the dark here...
> Before looking at the sources or further investigation, I would like to
> know if there is a way to know which library version has been used to
> build each particular version of gawk.
It's not easy. Try "strings gawk.exe" and look at the string "DJGPP
libc". But some people have their libraries patched without updating
the library version string...
> I could also try to rebuild gawk from the sources. But in that case I
> would like to use exactly the same library version.
You could use stock v2.03 and the alpha version of v2.04, and compare
the results.
- Raw text -