forked from KolibriOS/kolibrios
do_print.c: fix CR/LF handling
git-svn-id: svn://kolibrios.org@1409 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1402c59305
commit
acfa104846
@ -128,13 +128,11 @@ _doprnt(register const char *fmt, va_list ap, FILE *stream)
|
|||||||
|
|
||||||
while (c = *fmt++) {
|
while (c = *fmt++) {
|
||||||
if (c != '%') {
|
if (c != '%') {
|
||||||
#ifdef CPM
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
if (putc('\r', stream) == EOF)
|
if (putc('\r', stream) == EOF)
|
||||||
return nrchars ? -nrchars : -1;
|
return nrchars ? -nrchars : -1;
|
||||||
nrchars++;
|
nrchars++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (putc(c, stream) == EOF)
|
if (putc(c, stream) == EOF)
|
||||||
return nrchars ? -nrchars : -1;
|
return nrchars ? -nrchars : -1;
|
||||||
nrchars++;
|
nrchars++;
|
||||||
@ -184,13 +182,11 @@ _doprnt(register const char *fmt, va_list ap, FILE *stream)
|
|||||||
|
|
||||||
switch (c = *fmt++) {
|
switch (c = *fmt++) {
|
||||||
default:
|
default:
|
||||||
#ifdef CPM
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
if (putc('\r', stream) == EOF)
|
if (putc('\r', stream) == EOF)
|
||||||
return nrchars ? -nrchars : -1;
|
return nrchars ? -nrchars : -1;
|
||||||
nrchars++;
|
nrchars++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (putc(c, stream) == EOF)
|
if (putc(c, stream) == EOF)
|
||||||
return nrchars ? -nrchars : -1;
|
return nrchars ? -nrchars : -1;
|
||||||
nrchars++;
|
nrchars++;
|
||||||
|
Loading…
Reference in New Issue
Block a user