Revision 568d9c9f client/birdcl/client.c

View differences:

client/birdcl/client.c
36 36
extern char *server_path;
37 37
extern int server_fd;
38 38

  
39
extern int nstate;
39
extern int cstate;
40 40
extern int num_lines, skip_input, interactive;
41 41

  
42 42
static int term_lns=25;
......
123 123
      return;
124 124
    }
125 125

  
126
  if (!init_cmd && once && (nstate == STATE_CMD_USER))
126
  if (!init_cmd && once && (cstate == STATE_PROMPT))
127 127
    {
128 128
      /* Initial command is finished and we want to exit */
129 129
      cleanup();
......
332 332

  
333 333
      if (x[4] == ' ')
334 334
      {
335
        nstate = STATE_CMD_USER;
335
        cstate = STATE_PROMPT;
336 336
        skip_input = 0;
337 337
        return;
338 338
      }
......
362 362
    {
363 363
      FD_ZERO(&select_fds);
364 364

  
365
      if (nstate != STATE_CMD_USER)
365
      if (cstate != STATE_CMD_USER)
366 366
        FD_SET(server_fd, &select_fds);
367 367

  
368
      if (nstate != STATE_CMD_SERVER)
368
      if (cstate != STATE_CMD_SERVER)
369 369
        {
370 370
          FD_SET(0, &select_fds);
371 371
          if (interactive)

Also available in: Unified diff