/[LeafOK_CVS]/lbbs/src/io.c
ViewVC logotype

Diff of /lbbs/src/io.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.48 by sysadm, Fri Jun 27 13:01:24 2025 UTC Revision 1.51 by sysadm, Wed Jul 2 09:07:35 2025 UTC
# Line 265  int igetch(int timeout) Line 265  int igetch(int timeout)
265                  flags = fcntl(STDIN_FILENO, F_GETFL, 0);                  flags = fcntl(STDIN_FILENO, F_GETFL, 0);
266                  fcntl(STDIN_FILENO, F_SETFL, flags | O_NONBLOCK);                  fcntl(STDIN_FILENO, F_SETFL, flags | O_NONBLOCK);
267    
268                  for (loop = 1; loop && !SYS_server_exit;)                  for (loop = 1; loop && pos >= len && !SYS_server_exit;)
269                  {                  {
270                          if (SSH_v2 && ssh_channel_is_closed(SSH_channel))                          if (SSH_v2 && ssh_channel_is_closed(SSH_channel))
271                          {                          {
# Line 377  int igetch(int timeout) Line 377  int igetch(int timeout)
377          {          {
378                  unsigned char c = buf[pos++];                  unsigned char c = buf[pos++];
379    
380                    // Convert \r\n to \r
381                    if (c == CR && pos < len && buf[pos] == LF)
382                    {
383                            pos++;
384                    }
385    
386                    // Convert single \n to \r
387                    if (c == LF)
388                    {
389                            c = CR;
390                    }
391    
392                  if (c == KEY_CONTROL)                  if (c == KEY_CONTROL)
393                  {                  {
394                          if (in_control == 0)                          if (in_control == 0)


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1