www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/12/31/09:25:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Authentication-Warning: itservs.wilkes.edu: apache set sender to fdonahoe AT wilkes DOT edu using -f
Message-ID: <1104501860.41d55c64358f1@webmail.wilkes.edu>
Date: Fri, 31 Dec 2004 09:04:20 -0500
From: fdonahoe AT wilkes DOT edu
To: Workers List <djgpp-workers AT delorie DOT com>
Subject: Strange failure of egrep stub
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 3.2
X-Originating-IP: 146.94.1.214
Reply-To: djgpp-workers AT delorie DOT com


The following test `cond' is from texinfo-4.7.94 but it hasn't
changed from the release 4.7.

----- begin cond
#!/bin/sh
# Test conditional text.

unset TEXINFO_OUTPUT
: ${srcdir=.}

# Default Info output.
./makeinfo -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is (ifnothtml|ifinfo|ifnottex) text' cond.out >/dev/null \
  || exit 2
test `fgrep ' text.' cond.out | wc -l` -eq 3 || exit 3

# Default HTML output.
./makeinfo --no-split --html -o cond.out $srcdir/cond.txi || exit 1
egrep 'This is (html|ifhtml|ifnotinfo|ifnottex) text' cond.out \
  >/dev/null || exit 2
test `fgrep ' text.' cond.out | wc -l` -eq 4 || exit 3

# --ifhtml off, --ifinfo off, --iftex off.
./makeinfo --no-ifhtml --no-ifinfo --no-iftex -o cond.out \
  $srcdir/cond.txi || exit 1
egrep 'This is ifnot(html|info|tex) text' cond.out >/dev/null \
 || exit 2
test `fgrep ' text.' cond.out | wc -l` -eq 3 || exit 3

# Do we really need to test all the other permutations?

# --ifhtml on, --ifinfo on, --iftex on.
./makeinfo --ifhtml --ifinfo --iftex -o cond.out \
  $srcdir/cond.txi || exit 1
egrep 'This is (html|ifhtml|ifinfo|tex|iftex) text' cond.out \
  >/dev/null || exit 2
test `fgrep ' text.' cond.out | wc -l` -eq 5 || exit 3

rm -f cond.out cond.info
-----end cond

When this test in run with grep.exe from the grep251b.zip of
Nov 17, 2003 collection of utilities compiled with djgpp 2.04
beta 2 the test is passed.

However, with grep compiled with djgpp 2.04 from grep-2.5.1a.tar.gz
this test failed.

I modified the test to run makeinfo from PATH and to write to
real files rather than /dev/null.  The successful grep wrote
to cond-[1-4] while the failing grep *opened* cond-1 but wrote
*nothing* to it.

Failure at the second line under # Default info output.

The interesting part of this ...

When run from the command line the output of egrep is exactly
the same for either version of grep.

If "grep -E" replaces "egrep" both versions pass the test.

The stub "egrep.exe" remains the same when one version replaces
the other.

Andy's Nov 17. 2003 version is "unsupported coff header" to UPX
while mine is "djgpp2/coff."  And yes, I have checked.
Compressed or uncompressed, my version fails the test.

So why does the script fail?

These are the strings contained in the stub "egrep.exe."

stub.h generated from stub.asm by djasm, on Mon Nov 15 06:54:32 2004
The STUB.EXE stub loader is Copyright (C) 1993-1995 DJ Delorie. 
Permission granted to use for any purpose provided this copyright 
remains present and unmodified. 
This only applies to the stub, and not necessarily the whole program.
$Id: stub.asm built 2004-11-15 06:54:32 by djasm $
@(#) stub.asm built 2004-11-15 06:54:32 by djasm
go32stub, v 2.04T
grep
egrep
CWSDPMI.EXE
=PAu
=THu
.EXE
$PQW1
Load error: $: can't open$: not EXE$: not COFF (Check for viruses)\
$no DPMI - Get csdpmi*b.zip$no DOS memory$need DOS 3$\
can't switch mode$no DPMI selectors$no DPMI memory$

Regards,
Frank


-----------------------------------------------------------------------
This mail was sent through Wilkes Webmail: http://webmail.wilkes.edu
Wilkes Webmail is using IMP: http://horde.org/imp/

- Raw text -


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