9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@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	[thread overview]
Message-ID: <15FCCDA47C67BE480929467BA7409FBF@eigenstate.org> (raw)
In-Reply-To: <8E560F5F58B63F024428E031D57CDB22@a-b.xyz>

> 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<r; j++){
>  					if(j%16 == 0)

Ok by me.



  reply	other threads:[~2020-09-13 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-13 13:15 kvik
2020-09-13 15:32 ` ori [this message]
2020-09-17  8:33   ` [9front] " cinap_lenrek
2020-09-17 13:32     ` kvik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15FCCDA47C67BE480929467BA7409FBF@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    --cc=kvik@a-b.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).