Re: [pcre-dev] Porting PCRE to z/OS - current status 07/29/2…

Kezdőlap
Üzenet törlése
Szerző: Philip Hazel
Dátum:  
Címzett: Ze'ev Atlas
CC: pcre exim
Tárgy: Re: [pcre-dev] Porting PCRE to z/OS - current status 07/29/2012
On Sun, 29 Jul 2012, Ze'ev Atlas wrote:

> When I let it read from stdin (SYSIN) and write to stdout (SYSPRINT) I
> get the results only ([i.e. position or "no match" ] correct or
> incorrect), most of them are in new lines as they should, but the
> image of the input is not printed. When I read an actual phisical file
> and output to an actual phisical file, the image of the input is
> printed as a one long line (wrapped around) but no result is printed.


That is correct behaviour of pcretest, because when its input is sysin,         
it thinks it is operating interactively, so it does not show the input.         


I suspect the problem is in the way your C library handles newlines
and/or record endings. My recollection from my days as an MVS programmer
is that this is not straightforward. I see from the pcretest.c file that
an output file is opened with mode "wb", i.e. "binary". Maybe if you
change this to just "w" it might behave differently. The output mode is
held in a macro called OUTPUT_MODE, defined separately for Windows and
non-Windows (though the same value is used for both for OUTPUT_MODE).
There is also INPUT_MODE, which is set non-binary for Windows and binary
for everything else.

Philip

--
Philip Hazel