From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29322 invoked by alias); 13 Jun 2014 09:43:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32774 Received: (qmail 992 invoked from network); 13 Jun 2014 09:43:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <539ABAD6.7040208@redhat.com> Date: Fri, 13 Jun 2014 10:48:22 +0200 From: Jan Chaloupka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Re: [PATCH] zsh.1,zshall.1: missing b emulation option in man page References: <20140602150632.16888.49288.stgit@unused-4-157.brq.redhat.com> In-Reply-To: <20140602150632.16888.49288.stgit@unused-4-157.brq.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 On 06/02/2014 05:06 PM, jchaloup wrote: > In COMPATIBILITY section of zsh(all) man page doesn't cover that sh emulation is triggered also if the first letter of the name by which it was invoked is 'b'. > > However in the code ./zsh-4.3.10/Src/options.c the intention is clear: > > void > emulate(const char *zsh_name, int fully) > { > char ch = *zsh_name; > > if (ch == 'r') > ch = zsh_name[1]; > > /* Work out the new emulation mode */ > if (ch == 'c') > emulation = EMULATE_CSH; > else if (ch == 'k') > emulation = EMULATE_KSH; > else if (ch == 's' || ch == 'b') > emulation = EMULATE_SH; > else > emulation = EMULATE_ZSH; > > if (fully) > emulation |= EMULATE_FULLY; > installemulation(); > } > > Signed-off-by: Filip Krska > [jchaloup@redhat.com: corrected for upstream patch] > Signed-off-by: Jan Chaloupka > --- > Doc/Zsh/compat.yo | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Doc/Zsh/compat.yo b/Doc/Zsh/compat.yo > index bf97fe2..f1be15f 100644 > --- a/Doc/Zsh/compat.yo > +++ b/Doc/Zsh/compat.yo > @@ -6,7 +6,7 @@ cindex(ksh compatibility) > Zsh tries to emulate bf(sh) or bf(ksh) when it is invoked as > tt(sh) or tt(ksh) respectively; more precisely, it looks at the first > letter of the name by which it was invoked, excluding any initial `tt(r)' > -(assumed to stand for `restricted'), and if that is `tt(s)' or `tt(k)' it > +(assumed to stand for `restricted'), and if that is `tt(b)', `tt(s)' or `tt(k)' it > will emulate bf(sh) or bf(ksh). Furthermore, if invoked as tt(su) (which > happens on certain systems when the shell is executed by the tt(su) > command), the shell will try to find an alternative name from the tt(SHELL) > Ping