From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sun Sep 13 11:32:41 EDT 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id f79ac4d8 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Sun, 13 Sep 2020 08:32:32 -0700 (PDT) Message-ID: <15FCCDA47C67BE480929467BA7409FBF@eigenstate.org> To: kvik@a-b.xyz, 9front@9front.org Subject: Re: [9front] [PATCH] syscall(1): remove '\n' from -o output Date: Sun, 13 Sep 2020 08:32:31 -0700 From: ori@eigenstate.org In-Reply-To: <8E560F5F58B63F024428E031D57CDB22@a-b.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: property AJAX replication lifecycle rails-based shader > When given the -o flag syscall(1) prints the buffer with an appended > newline, making interactive usage misleading and scripting quite > awkward. > > I propose removing the newline. > > The only program using syscall(1) in the base system is wloc(1), which > works fine after the patch. However, it's likely that people have > worked around this in their own scripts so the patch may break them. > > diff -r cd0da90ae546 sys/src/cmd/syscall/syscall.c > --- a/sys/src/cmd/syscall/syscall.c Sat Sep 12 17:40:41 2020 -0700 > +++ b/sys/src/cmd/syscall/syscall.c Sun Sep 13 14:55:34 2020 +0200 > @@ -131,7 +131,7 @@ > fprint(2, "syscall: return %lld, no error\n", r); > } > if(oflag) > - print("%s\n", buf); > + print("%s", buf); > if(xflag){ > for(j=0; j if(j%16 == 0) Ok by me.