diff options
| author | rsc <rsc> | 2007-08-08 08:04:20 +0000 | 
|---|---|---|
| committer | rsc <rsc> | 2007-08-08 08:04:20 +0000 | 
| commit | a059f0259612a8c5df71605daad5487c13520405 (patch) | |
| tree | f679f61106f4f0f11c62e1ae27a4a6677607457f | |
| parent | 07018064bbc27a4b8aad99832fbe3a0e608775d9 (diff) | |
| download | xv6-labs-a059f0259612a8c5df71605daad5487c13520405.tar.gz xv6-labs-a059f0259612a8c5df71605daad5487c13520405.tar.bz2 xv6-labs-a059f0259612a8c5df71605daad5487c13520405.zip | |
change gets to return \n, to distinguish 0-byte read from empty line
| -rw-r--r-- | ulib.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| @@ -67,9 +67,9 @@ gets(char *buf, int max)      cc = read(0, &c, 1);      if(cc < 1)        break; +    buf[i++] = c;      if(c == '\n' || c == '\r')        break; -    buf[i++] = c;    }    buf[i] = '\0';    return buf; | 
