| 273 |  | if (!dev_view(v))       /* notify display driver */ | 
| 274 |  | goto again; | 
| 275 |  | dev_flush();            /* update screen */ | 
| 276 | < | beam_init();            /* compute new beam set */ | 
| 276 | > | beam_init(0);           /* compute new beam set */ | 
| 277 |  | for (i = 0; (dv = dev_auxview(i, res)) != NULL; i++) | 
| 278 |  | if (!beam_view(dv, res[0], res[1])) { | 
| 279 |  | if (!nhist) { | 
| 303 |  | if (fgets(cmd, sizeof(cmd), sstdin) == NULL) { | 
| 304 |  | fclose(sstdin); | 
| 305 |  | sstdin = NULL; | 
| 306 | < | return(0); | 
| 306 | > | return(-1); | 
| 307 |  | } | 
| 308 | + | if (!*cmd) | 
| 309 | + | return(DC_RESUME); | 
| 310 |  | for (args = cmd; *args && !isspace(*args); args++) | 
| 311 |  | ; | 
| 312 |  | while (isspace(*args)) | 
| 313 |  | *args++ = '\0'; | 
| 312 | – | if (!*cmd) | 
| 313 | – | return(DC_RESUME); | 
| 314 |  | if (*args && args[i=strlen(args)-1] == '\n') | 
| 315 |  | args[i] = '\0'; | 
| 316 |  | for (i = 0; i < DC_NCMDS; i++) | 
| 317 |  | if (!strcmp(cmd, cmdlist[i])) | 
| 318 |  | break; | 
| 319 |  | if (i >= DC_NCMDS) { | 
| 320 | < | sprintf(errmsg, "unknown command: %s", cmd); | 
| 321 | < | error(COMMAND, errmsg); | 
| 320 | > | dev_auxcom(cmd, args); | 
| 321 |  | return(-1); | 
| 322 |  | } | 
| 323 |  | switch (i) { | 
| 406 |  | break; | 
| 407 |  | case DS_OUTSECT: | 
| 408 |  | do_outside = 1; | 
| 409 | < | break; | 
| 409 | > | goto noargs; | 
| 410 |  | case DS_EYESEP: | 
| 411 |  | if (msg.nbytes <= 1 || (eyesepdist = atof(buf)) <= FTINY) | 
| 412 |  | error(INTERNAL, "bad eye separation from server"); | 
| 422 |  | } | 
| 423 |  | #endif | 
| 424 |  | imm_mode = msg.type==DS_STARTIMM; | 
| 425 | < | /* fall through */ | 
| 425 | > | goto noargs; | 
| 426 |  | case DS_ACKNOW: | 
| 427 |  | case DS_SHUTDOWN: | 
| 428 | < | if (msg.nbytes) { | 
| 430 | < | sprintf(errmsg, | 
| 431 | < | "unexpected body with server message %d", | 
| 432 | < | msg.type); | 
| 433 | < | error(INTERNAL, errmsg); | 
| 434 | < | } | 
| 435 | < | break; | 
| 428 | > | goto noargs; | 
| 429 |  | default: | 
| 430 |  | error(INTERNAL, "unrecognized result from server process"); | 
| 431 |  | } | 
| 432 |  | return(msg.type);               /* return message type */ | 
| 433 | + | noargs: | 
| 434 | + | if (msg.nbytes) { | 
| 435 | + | sprintf(errmsg, "unexpected body with server message %d", | 
| 436 | + | msg.type); | 
| 437 | + | error(INTERNAL, errmsg); | 
| 438 | + | } | 
| 439 | + | return(msg.type); | 
| 440 |  | readerr: | 
| 441 |  | if (feof(stdin)) | 
| 442 |  | error(SYSTEM, "server process died"); |