zsh-workers
 help / color / mirror / code / Atom feed
* Weird behavior of conditionals with exclamations (ZSH 5.0.7)
@ 2015-06-14 22:50 Daniel Miranda
  2015-06-15  3:19 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Miranda @ 2015-06-14 22:50 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-15  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-14 22:50 Weird behavior of conditionals with exclamations (ZSH 5.0.7) Daniel Miranda
2015-06-15  3:19 ` Bart Schaefer
2015-06-15  8:37   ` Peter Stephenson

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