mirror of
https://github.com/sheumann/hush.git
synced 2025-02-11 14:31:40 +00:00
Do newline conversion in the "echo" builtin.
This commit is contained in:
parent
01890e4a42
commit
f88111e789
@ -166,6 +166,15 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
|
||||
}
|
||||
|
||||
do_write:
|
||||
#ifdef __GNO__
|
||||
{
|
||||
char *ch;
|
||||
for (ch = buffer; ch < out; ++ch) {
|
||||
if (*ch == '\n')
|
||||
*ch = '\r';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Careful to error out on partial writes too (think ENOSPC!) */
|
||||
errno = 0;
|
||||
/*r =*/ full_write(STDOUT_FILENO, buffer, out - buffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user