src/console/conio.c
static void
delchr(int del, char *curline, int line_len)
{
   int i, cnt;

   if (cp > cl || del == 0) {
      return;
   }
   while (del-- && cl > 0) {
      cnt = char_count(cp, curline);
      if ((i=cl-cp-cnt) > 0) {
         memcpy(&curline[cp], &curline[cp+cnt], i);
      }
      cl -= cnt;
      curline[cl] = EOS;
      t_clrline(0, t_width);
      i = 0;
      while (cl > cp) {
         forward(curline, line_len);
         i++;
      }
      while (i--) {
         backup(curline);
      }
   }
}
/* Delete the character under the cursor */
Delete the character under the cursor
Delete the character under the cursor
static void
delchr(int del, char *curline, int line_len)
{
   int i, cnt;
   if (cp > cl || del == 0) {
      return;
   }
   while (del-- && cl > 0) {
      cnt = char_count(cp, curline);
      if ((i=cl-cp-cnt) > 0) {
         memcpy(&curline[cp], &curline[cp+cnt], i);
      }
      cl -= cnt;
      curline[cl] = EOS;
      t_clrline(0, t_width);
      i = 0;
      while (cl > cp) {
         forward(curline, line_len);
         i++;
      }
      while (i--) {
         backup(curline);
      }
   }
}
static void delchr ( int del , char * curline , int line_len ) { int i , cnt ; if ( cp > cl || del == 0 ) { return ; } while ( del -- && cl > 0 ) { cnt = char_count ( cp , curline ) ; if ( ( i = cl - cp - cnt ) > 0 ) { memcpy ( & curline [ cp ] , & curline [ cp + cnt ] , i ) ; } cl -= cnt ; curline [ cl ] = EOS ; t_clrline ( 0 , t_width ) ; i = 0 ; while ( cl > cp ) { forward ( curline , line_len ) ; i ++ ; } while ( i -- ) { backup ( curline ) ; } } }
Delete the character under the cursor
Delete the character under the cursor