getttyent.c (24893) | getttyent.c (24899) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52static char *value __P((char *)); 53 54struct ttyent * 55getttynam(tty) 56 const char *tty; 57{ 58 register struct ttyent *t; 59 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52static char *value __P((char *)); 53 54struct ttyent * 55getttynam(tty) 56 const char *tty; 57{ 58 register struct ttyent *t; 59 |
60 if (strnchr(tty, "/dev/", 5) == 0) | 60 if (strncmp(tty, "/dev/", 5) == 0) |
61 tty += 5; 62 setttyent(); 63 while ( (t = getttyent()) ) 64 if (!strcmp(tty, t->ty_name)) 65 break; 66 endttyent(); 67 return (t); 68} --- 196 unchanged lines hidden --- | 61 tty += 5; 62 setttyent(); 63 while ( (t = getttyent()) ) 64 if (!strcmp(tty, t->ty_name)) 65 break; 66 endttyent(); 67 return (t); 68} --- 196 unchanged lines hidden --- |