v04i132: merged echo patch
David MacKenzie
edf at ROCKY2.ROCKEFELLER.EDU
Sat Oct 22 11:33:15 AEST 1988
Posting-number: Volume 4, Issue 132
Submitted-by: "David MacKenzie" <edf at ROCKY2.ROCKEFELLER.EDU>
Archive-name: echo.patch1
Hard to believe anyone could botch an echo, isn't it? And I'd been
using it for about a month when I posted it. Sigh. The below patch
makes the \0ooo escape work.
*** echo.c.old Sat Oct 1 02:02:58 1988
--- echo.c Sat Oct 1 02:03:35 1988
***************
*** 21,27 ****
* \\ backslash
*
* David MacKenzie
! * Latest revision: 08/07/88
*/
#include <stdio.h>
--- 21,27 ----
* \\ backslash
*
* David MacKenzie
! * Latest revision: 10/01/88
*/
#include <stdio.h>
***************
*** 65,71 ****
break;
case '0':
for (i = n = 0, ++s; i < 3 && *s >= '0' && *s <= '7'; ++i, ++s)
! n += *s - '0';
--s;
putchar(n);
break;
--- 65,71 ----
break;
case '0':
for (i = n = 0, ++s; i < 3 && *s >= '0' && *s <= '7'; ++i, ++s)
! n = n * 8 + *s - '0';
--s;
putchar(n);
break;
More information about the Comp.sources.misc
mailing list