zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Miranda <danielkza2@gmail.com>
To: zsh-workers@zsh.org
Subject: Weird behavior of conditionals with exclamations (ZSH 5.0.7)
Date: Sun, 14 Jun 2015 19:50:10 -0300	[thread overview]
Message-ID: <CAPRQymMnbhY5CnDTsfu0r=d8u3tLask9fTaG9TNctZ4PQjRBCA@mail.gmail.com> (raw)

I've recently encountered a bug in Fedora 22 where I get error
messages when browsing a folder that contains exclamation signs in
it's name in GNOME Terminal with ZSH.

I tracked it down to a profile.d script shipped by the VTE terminal
emulation library. The __vte_urlencode function triggers a "too many
arguments" error in the case I mentioned. You can see the code at the
GNOME miirror in Github [1].

The error happens at line 31:

while [ -n "$str" ]; do

If and only if the value of "$str" is '!', a string containing a
single exclamation. It seems the test command somehow attempts to
parse it as a modifier, instead of an actual string to be tested. The
same *does not* happen in Bash. It seems incorrect, or at least
strange, to me.

Somehow using [[ ]] works correctly. I don't know why that is the case.

Is that expected or have I ran into an issue?

Thanks,
Daniel

[1] https://github.com/GNOME/vte/blob/master/src/vte.sh#L26


             reply	other threads:[~2015-06-14 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 22:50 Daniel Miranda [this message]
2015-06-15  3:19 ` Bart Schaefer
2015-06-15  8:37   ` Peter Stephenson

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='CAPRQymMnbhY5CnDTsfu0r=d8u3tLask9fTaG9TNctZ4PQjRBCA@mail.gmail.com' \
    --to=danielkza2@gmail.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).