Problem with PD ksh, want sdb(1) manpage

Leslie Mikesell les at chinet.chi.il.us
Mon Dec 17 09:53:06 AEST 1990


In article <1990Dec16.143234.21154 at lth.se> bengtl at maths.lth.se (Bengt Larsson) writes:
>Help! I've tried to compile the PD ksh posted to alt.sources a while ago.
>This is on a 3B2, SYSV.3.0.

>The problem is: ksh doesn't seem to recognize end-of-file, neither from
>the terminal, a file, or a file included with the "." command. It just
>hangs. Otherwise ksh seems to work :-)

I haven't tried to compile that particular source, but I've seen the problem
dozens of times before.  This is a symptom of reading into a character
variable with (f)getc which returns an int, or storing in a character
variable before testing against EOF.  On the 3B2, chars default to unsigned
so EOF (defined as -1) never matches what is stored in an unsigned character.
Lint should find this sort of thing, although it may not be obvious from the
lint output what the problem really is.

Les Mikesell
  les at chinet.chi.il.us



More information about the Alt.sources.d mailing list