From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 22774 invoked from network); 25 Nov 2021 11:01:37 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 25 Nov 2021 11:01:37 -0000 Received: from mail.9lab.org ([168.119.8.41]) by 4ess; Thu Nov 25 05:54:22 -0500 2021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9lab.org; s=20210803; t=1637836858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=PK3EHzs+t2T8HyQTVIDaSgKHVy/IKdrS9dzQAnB4qOw=; b=aFMmlt/J5oIJBsyrRxXvwTXZbXC1KOFSB4/EEfc73j4v+ZgC/inhaqb/7v070YaNHjAatJ NBj/4Ok2WZIdrGgh7KXePpxRcgbBQLlSl8P7R3Chhz/0dJqdkQ+dWdwSuXNEGeTVYb1xUr fcJINEQkExMYkrR1PHsrtToSFK4cP9Y= Received: from pjw (host-185-64-155-70.ecsnet.at [185.64.155.70]) by mail.9lab.org (OpenSMTPD) with ESMTPSA id c1732f9c (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <9front@9front.org>; Thu, 25 Nov 2021 11:40:57 +0100 (CET) Message-ID: <7CEF83159FC92104223B8FEC4E0A594B@9lab.org> To: 9front@9front.org Date: Thu, 25 Nov 2021 11:40:56 +0100 From: igor@9lab.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: private hypervisor rich-client replication DOM manager Subject: Re: [9front] [PATCH] rio: allow spaces in working directory path (-cd) when creating a new window Reply-To: 9front@9front.org Precedence: bulk Thanks for looking over it! Quoth cinap_lenrek@felloff.net: […] > probably is better to parse everything using gettokens(). > as your patch doesnt handle quoting the quotes. […] Thanks for the tip. That indeed sounds like the cleaner solution. > the whole window command also will probably have issues with > this kind of stuff... the quoting is definitely messed up in > there. Yeah, that is where my journey started, thinking that window cmd was the culprit, until I realised that the limitation goes all the way to `/sys/src/cmd/rio/wctl.c:/^parsewctl`. > > tho it is possible to quote from rc, like: > > fn q {a=$1 whatis a | sed 's!^a=!!;q'} > > or even get rid of wctl all together... it is a bit silly given > you can just fork and mount $wsys yourself... then there are not > two different code paths for creating a window. I think I understand what you mean. The below is just checking I am on the same page. You are referring to the two highlighted ('^^^') code paths in /rc/bin/window: … if(~ $#mflag 1) { ^^^ … if(mount $wsys /mnt/wsys 'new '$"spec){ bind -b /mnt/wsys /dev exec $argv0 -x $cmd /dev/cons >[2]/dev/cons } }& exit '' } if not { ^^^ if(~ $wctl ''){ if(test -f /dev/wctl) wctl=/dev/wctl if not if(test -f /mnt/term/dev/wctl) wctl=/mnt/term/dev/wctl if not if(test -r /mnt/term/env/wctl) wctl=/mnt/term^`{cat /mnt/term/env/wctl} if not { echo $argv0: '$wctl' not defined >[1=2] exit bad } } if(! ~ $#wdir 0) spec=($spec -cd $wdir) echo new $spec $argv0 -x $cmd >>$wctl } … …if I understand you correctly the suggestion is to drop the `if not { … }` part that writes to $wctl and modify the `if(~ $#mflag 1) { … }` in such a way that it can handle both the `-m` and non `-m` variant. Cheers, Igor