projects
/
unix-history
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
date and time created 83/11/10 16:04:16 by ralph
[unix-history]
/
usr
/
src
/
lib
/
libc
/
stdio
/
gets.c
Commit
Line
Data
c3d4b9ff
BJ
1
/* @(#)gets.c 4.1 (Berkeley) %G% */
2
#include <stdio.h>
3
4
char *
5
gets(s)
6
char *s;
7
{
8
register c;
9
register char *cs;
10
11
cs = s;
12
while ((c = getchar()) != '\n' && c >= 0)
13
*cs++ = c;
14
if (c<0 && cs==s)
15
return(NULL);
16
*cs++ = '\0';
17
return(s);
18
}