[BACK]Return to readline.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libedit

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libedit/readline.c between version 1.142 and 1.143

version 1.142, 2017/09/01 10:19:10 version 1.143, 2017/09/05 18:07:59
Line 290  rl_initialize(void)
Line 290  rl_initialize(void)
         if (tcgetattr(fileno(rl_instream), &t) != -1 && (t.c_lflag & ECHO) == 0)          if (tcgetattr(fileno(rl_instream), &t) != -1 && (t.c_lflag & ECHO) == 0)
                 editmode = 0;                  editmode = 0;
   
         e = el_init(rl_readline_name, rl_instream, rl_outstream, stderr);          e = el_init_internal(rl_readline_name, rl_instream, rl_outstream,
               stderr, fileno(rl_instream), fileno(rl_outstream), fileno(stderr),
               NO_RESET);
   
         if (!editmode)          if (!editmode)
                 el_set(e, EL_EDITMODE, 0);                  el_set(e, EL_EDITMODE, 0);
Line 386  rl_initialize(void)
Line 388  rl_initialize(void)
         _resize_fun(e, &rl_line_buffer);          _resize_fun(e, &rl_line_buffer);
         _rl_update_pos();          _rl_update_pos();
   
           tty_end(e);
   
         return 0;          return 0;
 }  }
   
Line 410  readline(const char *p)
Line 414  readline(const char *p)
                 rl_did_startup_hook = 1;                  rl_did_startup_hook = 1;
                 (*rl_startup_hook)(NULL, 0);                  (*rl_startup_hook)(NULL, 0);
         }          }
           tty_init(e);
   
   
         rl_done = 0;          rl_done = 0;
   
         (void)setjmp(topbuf);          (void)setjmp(topbuf);
           buf = NULL;
   
         /* update prompt accordingly to what has been passed */          /* update prompt accordingly to what has been passed */
         if (rl_set_prompt(prompt) == -1)          if (rl_set_prompt(prompt) == -1)
                 return NULL;                  goto out;
   
         if (rl_pre_input_hook)          if (rl_pre_input_hook)
                 (*rl_pre_input_hook)(NULL, 0);                  (*rl_pre_input_hook)(NULL, 0);
Line 443  readline(const char *p)
Line 449  readline(const char *p)
   
                 buf = strdup(ret);                  buf = strdup(ret);
                 if (buf == NULL)                  if (buf == NULL)
                         return NULL;                          goto out;
                 lastidx = count - 1;                  lastidx = count - 1;
                 if (buf[lastidx] == '\n')                  if (buf[lastidx] == '\n')
                         buf[lastidx] = '\0';                          buf[lastidx] = '\0';
Line 453  readline(const char *p)
Line 459  readline(const char *p)
         history(h, &ev, H_GETSIZE);          history(h, &ev, H_GETSIZE);
         history_length = ev.num;          history_length = ev.num;
   
   out:
           tty_end(e);
         return buf;          return buf;
 }  }
   

Legend:
Removed from v.1.142  
changed lines
  Added in v.1.143

CVSweb <webmaster@jp.NetBSD.org>