[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / ftp

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

Diff for /src/usr.bin/ftp/main.c between version 1.90.2.6 and 1.90.2.7

version 1.90.2.6, 2005/07/24 10:22:41 version 1.90.2.7, 2005/07/24 10:29:36
Line 1 
Line 1 
 /*      $NetBSD$        */  /*      $NetBSD$        */
   
 /*-  /*-
  * Copyright (c) 1996-2004 The NetBSD Foundation, Inc.   * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
  * All rights reserved.   * All rights reserved.
  *   *
  * This code is derived from software contributed to The NetBSD Foundation   * This code is derived from software contributed to The NetBSD Foundation
Line 645  cmdscanner(void)
Line 645  cmdscanner(void)
                                         fprintf(ttyout, "%s ", p);                                          fprintf(ttyout, "%s ", p);
                                 (void)fflush(ttyout);                                  (void)fflush(ttyout);
                         }                          }
                         if (fgets(line, sizeof(line), stdin) == NULL) {                          num = getline(stdin, line, sizeof(line), NULL);
                           switch (num) {
                           case -1:        /* EOF */
                           case -2:        /* error */
                                 if (fromatty)                                  if (fromatty)
                                         putc('\n', ttyout);                                          putc('\n', ttyout);
                                 quit(0, NULL);                                  quit(0, NULL);
                         }                                  /* NOTREACHED */
                         num = strlen(line);                          case -3:        /* too long; try again */
                         if (num == 0)  
                                 break;  
                         if (line[--num] == '\n') {  
                                 if (num == 0)  
                                         break;  
                                 line[num] = '\0';  
                         } else if (num == sizeof(line) - 2) {  
                                 fputs("Sorry, input line is too long.\n",                                  fputs("Sorry, input line is too long.\n",
                                     ttyout);                                      ttyout);
                                 while ((ch = getchar()) != '\n' && ch != EOF)                                  continue;
                                         /* void */;                          case 0:         /* empty; try again */
                                   continue;
                           default:        /* all ok */
                                 break;                                  break;
                         } /* else it was a line without a newline */                          }
 #ifndef NO_EDITCOMPLETE  #ifndef NO_EDITCOMPLETE
                 } else {                  } else {
                         const char *buf;                          const char *buf;

Legend:
Removed from v.1.90.2.6  
changed lines
  Added in v.1.90.2.7

CVSweb <webmaster@jp.NetBSD.org>