Mail Archives: djgpp/2003/05/08/08:15:10
Eli Zaretskii wrote:
[snip]
> Then please show an example of this bug that doesn't use command-line
> argument quoting.
F:\PRUEBAS\gawkbug>cat bbbb
BEGIN { print "bbbb" }
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....
>
>
>>Apparently it may be an issue related to how the externally redirected
>>stdout handler is passed to gawk. And using bash or the native command
>>shell makes a difference.
>>
>>For DJGPP gawk 3.1.1 on WinNT 4.0, what I find is that any redirection
>>of the form
>>
>> gawk ..... >> outfile
>>
>>always overwrites outfile from the beginning, but preserving the non
>>overwritten contents.
>
>
> 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.
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.
I could also try to rebuild gawk from the sources. But in that case I
would like to use exactly the same library version.
Thanks for your time.
--
To reply by e-mail, please remove the extra dot
in the given address: m.collado -> mcollado
- Raw text -