[BACK]Return to tgetpass.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/tgetpass.c between version 1.2 and 1.3

version 1.2, 1999/12/10 06:45:12 version 1.3, 2000/01/24 04:22:53
Line 1 
Line 1 
 /*  /*
  * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>   * Copyright (c) 1996, 1998-2000 Todd C. Miller <Todd.Miller@courtesan.com>
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 78 
Line 78 
 #endif /* TCSASOFT */  #endif /* TCSASOFT */
   
 #ifndef lint  #ifndef lint
 static const char rcsid[] = "$Sudo: tgetpass.c,v 1.91 1999/12/05 02:18:47 millert Exp $";  static const char rcsid[] = "$Sudo: tgetpass.c,v 1.93 2000/01/17 23:46:26 millert Exp $";
 #endif /* lint */  #endif /* lint */
   
 static char *tgetline __P((int, char *, size_t, int));  static char *tgetline __P((int, char *, size_t, int));
Line 216 
Line 216 
   
             /* Read a character, exit loop on error, EOF or EOL */              /* Read a character, exit loop on error, EOF or EOL */
             n = read(fd, &c, 1);              n = read(fd, &c, 1);
             if (n != 1 || c == '\n')              if (n != 1 || c == '\n' || c == '\r')
                 break;                  break;
             *cp++ = c;              *cp++ = c;
         }          }
         free(readfds);          free(readfds);
     } else {      } else {
         /* Keep reading until out of space, EOF, error, or newline */          /* Keep reading until out of space, EOF, error, or newline */
         while (--left && (n = read(fd, &c, 1)) == 1 && c != '\n')          while (--left && (n = read(fd, &c, 1)) == 1 && (c != '\n' || c != '\r'))
             *cp++ = c;              *cp++ = c;
     }      }
     *cp = '\0';      *cp = '\0';

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3