Description
Reported by jeningar on 2014-09-23 10:37 UTC
Hi Steve, hi Gerwin,
using the skeleton.nested, the resulting program showed the following behaviour:
echo "list sessions;" | sdmsh
hangs forever. But
echo "list sessions;" > /tmp/x
sdmsh < /tmp/x
teminates as should be.
After merging the skeleton.default and skeleton.nested this erroneous behaviour vanished.
Diffing the old and new skeleton.nested shows (< == new; > == old):
[ronald@cheetah shell]$ diff skeleton.nested* | more
39c39
<
---
>
169c169
< while (numRead == 0) { // bug #130 discussion; while is better than if
---
> if (numRead == 0) {
403,409d402
< // cached fields:
< int zzCurrentPosL;
< int zzMarkedPosL;
< int zzEndReadL = zzEndRead;
< char [] zzBufferL = zzBuffer;
< char [] zzCMapL = ZZ_CMAP;
<
413c406,411
< zzMarkedPosL = zzMarkedPos;
---
> // cached fields:
> int zzCurrentPosL;
> int zzMarkedPosL = zzMarkedPos;
> int zzEndReadL = zzEndRead;
> char [] zzBufferL = zzBuffer;
> char [] zzCMapL = ZZ_CMAP;
The HUGE difference is that the variables (notably zzEndReadL) aren't initialized by skeleton.default in every iteration of the while loop.
During the merge I wondered why there are two skeletons in the first place. Those who don't want to read from multiple streams just don't call yypushStream() and friends. One skeleton would be more than enough (and a link for backward compatibility).
for the sake of completeness I attached the new skeleton.nested.
Regards,
Ronald