Path: utzoo!utdoe!ontmoh!attcan!utgpu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!uwm.edu!ux1.cso.uiuc.edu!midway!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: alt.sources.d Subject: Re: Problem with PD ksh, want sdb(1) manpage Keywords: sdb, ksh, ksh-pd Message-ID: <1990Dec16.225306.25523@chinet.chi.il.us> Date: 16 Dec 90 22:53:06 GMT References: <1990Dec16.143234.21154@lth.se> Organization: Chinet - Public Access UNIX Lines: 18 In article <1990Dec16.143234.21154@lth.se> bengtl@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@chinet.chi.il.us