ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdisp.c
(Generate patch)

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.22 by gregl, Tue Jan 6 05:26:20 1998 UTC vs.
Revision 3.23 by gregl, Thu Jan 8 21:19:05 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 159 | Line 159 | disp_wait()                    /* wait for more input */
159          n = odev.ifd+1;
160          if (sstdin != NULL) {
161                  FD_SET(fileno(sstdin), &readset);
162 +                FD_SET(fileno(sstdin), &errset);
163                  if (fileno(sstdin) >= n)
164                          n = fileno(sstdin) + 1;
165          }
# Line 173 | Line 174 | disp_wait()                    /* wait for more input */
174                  flgs |= RDY_SRV;
175          if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset))
176                  flgs |= RDY_DEV;
177 <        if (sstdin != NULL && FD_ISSET(fileno(sstdin), &readset))
177 >        if (sstdin != NULL && (FD_ISSET(fileno(sstdin), &readset) ||
178 >                                FD_ISSET(fileno(sstdin), &errset)))
179                  flgs |= RDY_SIN;
180          return(flgs);
181   }
# Line 281 | Line 283 | int
283   usr_input()                     /* get user input and process it */
284   {
285          VIEW    vparams;
286 <        char    cmd[128];
286 >        char    cmd[256];
287          register char   *args;
288          register int    i;
289  
290 <        if (fgets(cmd, sizeof(cmd), sstdin) == NULL)
291 <                return(DC_QUIT);
290 >        if (fgets(cmd, sizeof(cmd), sstdin) == NULL) {
291 >                fclose(sstdin);
292 >                sstdin = NULL;
293 >                return(0);
294 >        }
295          for (args = cmd; *args && !isspace(*args); args++)
296                  ;
297          while (isspace(*args))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines