zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
Date: Thu, 11 Aug 2016 10:28:03 -0700	[thread overview]
Message-ID: <160811102803.ZM2533@torch.brasslantern.com> (raw)
In-Reply-To: <20160811110545.1b066d2f@pwslap01u.europe.root.pri>

On Aug 11, 11:05am, Peter Stephenson wrote:
} Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
}
} On Wed, 10 Aug 2016 10:28:36 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > torch% print -l ${(@s.:.)x}
} > a:b
} > c d
} > ef
} 
} I think it should only cause a visible effect in double quotes as that's
} its real point --- though I wouldn't be surprised if there were already
} exceptions.  It's hard to see how it could be interpreted to mean ignore
} the (s.:.), even if there are double quotes.

I think this is fixed by workers/39019, but I did not add any tests that
use double-quoting.  Should there be some?
 
} To be clear: it is not a conflict that SHWORDSPLIT behaviour and
} (s...) behaviour differ from one another, e.g. with respect to forced
} [joining], only if expressions involving the same modifications to
} ${(@)x} and $@ differ when the contents of the arrays and the contexts
} are the same.

Agreed, but I'm still not sure the test suite covers that ...

} > Then there's this weird edge case, where an empty $IFS acts like you
} > have specified the (@) flag when shwordsplit is set:
} > 
} > torch% IFS=
} > torch% setopt shwordsplit
} > torch% print -l ${(s.:.)x}
} > a:b
} > c d
} > ef
} 
} Hmm... I would guess that what's happened is without an IFS forced
} joining with a default separator fails, and because it didn't get joined
} we refuse to split it

To clarify, the above edge case was introduced by the (never-committed)
patch in 39009, and should have been avoided by the patch in 39019.

} I would think the most logical answer here is it should have been joined
} with no separator and then split, but I doubt this has ever been thought
} about before.

This is still broken after 39019 (sigh) because IFS= plus shwordsplit
implies that joining should not happen in other circumstances, and we
only split after joining, so that unintentionally bleeds into this.  I
thought I'd got it worked out and that the tests I added covered it,
but trying this specific example again still fails.  Back to prodding
at it, I guess.


  reply	other threads:[~2016-08-11 17:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:16 Stephane Chazelas
2016-08-08 17:28 ` Bart Schaefer
2016-08-08 18:02   ` Jérémie Roquet
2016-08-08 18:27 ` Peter Stephenson
2016-08-09  1:21   ` Bart Schaefer
2016-08-09  8:40     ` Peter Stephenson
2016-08-10 17:28       ` Bart Schaefer
2016-08-11 10:05         ` Peter Stephenson
2016-08-11 17:28           ` Bart Schaefer [this message]
2016-08-12  7:50             ` Bart Schaefer
2016-08-10 12:56     ` Peter Stephenson
2016-08-11  0:39       ` Bart Schaefer

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=160811102803.ZM2533@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).