version 1.12, 1997/08/31 14:32:13 |
version 1.13, 1997/09/04 20:44:04 |
|
|
return; |
return; |
} |
} |
count = strlen(linebuf); |
count = strlen(linebuf); |
|
/* |
|
* Transforms lines ending in <CR><LF> to just <LF>. |
|
* This allows mail to be able to read Eudora mailboxes |
|
* that reside on a DOS partition. |
|
*/ |
|
if (count >= 2 && linebuf[count-1] == '\n' && |
|
linebuf[count - 2] == '\r') |
|
linebuf[count - 2] = linebuf[--count]; |
|
|
(void)fwrite(linebuf, sizeof(*linebuf), count, otf); |
(void)fwrite(linebuf, sizeof(*linebuf), count, otf); |
if (ferror(otf)) |
if (ferror(otf)) |
err(1, "/tmp"); |
err(1, "/tmp"); |
|
|
/* |
/* |
* Read up a line from the specified input into the line |
* Read up a line from the specified input into the line |
* buffer. Return the number of characters read. Do not |
* buffer. Return the number of characters read. Do not |
* include the newline at the end. |
* include the newline (or carriage return) at the end. |
*/ |
*/ |
int |
int |
readline(ibuf, linebuf, linesize) |
readline(ibuf, linebuf, linesize) |
|
|
|
|
n = strlen(linebuf); |
n = strlen(linebuf); |
if (n > 0 && linebuf[n - 1] == '\n') |
if (n > 0 && linebuf[n - 1] == '\n') |
|
linebuf[--n] = '\0'; |
|
if (n > 0 && linebuf[n - 1] == '\r') |
linebuf[--n] = '\0'; |
linebuf[--n] = '\0'; |
return(n); |
return(n); |
} |
} |