projects
/
neverball
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove SOL body flags
[neverball]
/
share
/
fs.c
diff --git
a/share/fs.c
b/share/fs.c
index
c14d59c
..
fd75cbf
100644
(file)
--- a/
share/fs.c
+++ b/
share/fs.c
@@
-301,7
+301,6
@@
int fs_puts(const char *src, fs_file fh)
char *fs_gets(char *dst, int count, fs_file fh)
{
char *s = dst;
char *fs_gets(char *dst, int count, fs_file fh)
{
char *s = dst;
- char *cr = NULL;
int c;
assert(dst);
int c;
assert(dst);
@@
-316,22
+315,21
@@
char *fs_gets(char *dst, int count, fs_file fh)
*s = c;
*s = c;
- /* Normalize possible CRLF and break. */
+ /* Keep a newline and break. */
if (*s == '\n')
{
if (*s == '\n')
{
- if (cr + 1 == s)
- *cr = '\n';
- else
- s++;
-
+ s++;
break;
}
break;
}
- /* Note carriage return. */
+ /* Ignore carriage returns. */
if (*s == '\r')
if (*s == '\r')
- cr = s;
+ {
+ count++;
+ s--;
+ }
s++;
}
s++;
}