Path: utzoo!utgpu!attcan!uunet!husc6!mailrus!nrl-cmf!cmcl2!rocky8!rocky2.rockefeller.edu!edf From: edf@rocky2.rockefeller.edu (David MacKenzie) Newsgroups: comp.sources.bugs Subject: Re: v04i088: Merged SysV/BSD echo Message-ID: <205@rocky8.rockefeller.edu> Date: 1 Oct 88 06:08:27 GMT References: <2800008@kailand> Sender: notes@rocky8.rockefeller.edu Reply-To: edf@rocky2.rockefeller.edu (David MacKenzie) Organization: Environmental Defense Fund Lines: 46 I didn't think it was possible to botch echo, but . . . somehow the octal number escape came out broken. below is a diff that corrects it. As I seem to be the first one to post about it, this was obviously a _very_ popular program . . . . *** 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 --- 21,27 ---- * \\ backslash * * David MacKenzie ! * Latest revision: 10/01/88 */ #include *************** *** 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; ----- David MacKenzie Environmental Defense Fund edf@rocky2.rockefeller.edu (...rutgers!cmcl2!rocky2!edf)