zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: ${(s::)VAR} vs "${(s::)VAR}"
Date: Fri, 27 Apr 2012 19:50:48 -0700	[thread overview]
Message-ID: <120427195048.ZM10479@torch.brasslantern.com> (raw)
In-Reply-To: <20120427213837.1b861851@pws-pc.ntlworld.com>

On Apr 27,  9:38pm, Peter Stephenson wrote:
}
} This comes from the function wordcount() in utils.c, which is called in
} a couple of functions used for splitting words, none of which has any
} comments apart from a few speculations from me dating from 2003.  The
} function takes a mysterious argument mul which presumably has got
} something to do with doing something multiple times.

"mul" takes values -1, 0, 1.  The only time it's less than zero is when
called from spacesplit() with allownull == 0.  So it must have to do
with handling multiple consecutive appearances of the separator.

}  	for (; (c = findsep(&s, sep, 0)) >= 0; s += sl)
} -	    if ((c && *(s + sl)) || mul)
} +	    if ((c || mul) && *(s + sl))
}  		r++;

Does it matter that the changed line dereferences s+sl in cases where
the original line does not?


  reply	other threads:[~2012-04-28  2:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 20:48 Kynn Jones
2012-04-27 20:38 ` Peter Stephenson
2012-04-28  2:50   ` Bart Schaefer [this message]
2012-04-29 18:22     ` Peter Stephenson
2012-04-29 18:41     ` 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=120427195048.ZM10479@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).