Bug 1066913

Summary: zsh man page omits sh emulation if $0 starts with 'b'
Product: [Fedora] Fedora Reporter: Filip Krska <fkrska>
Component: zshAssignee: Dominic Hopf <dmaphy>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 20CC: dmaphy, james.antill, kdudka
Target Milestone: ---Keywords: EasyFix, ManPageChange, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zsh-5.0.6-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1066537 Environment:
Last Closed: 2014-11-13 14:51:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
man zsh, zshall fix none

Description Filip Krska 2014-02-19 10:26:53 UTC
Created attachment 865019 [details]
man zsh, zshall fix

+++ This bug was initially created as a clone of Bug #1066537 +++

Description of problem:

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();
}



Version-Release number of selected component (if applicable):

All versions

How reproducible:

Always

Steps to Reproduce:
1. man zsh
2. man zshall
3.

Actual results:

...
       and  if  that  is  ‘s’ or ‘k’ it will emulate sh or ksh.  Furthermore, if invoked as su (which happens on certain
...

Expected results:

...
       and if that is ‘b’, ‘s’ or ‘k’ it will emulate sh or ksh.  Furthermore, if invoked as su (which happens  on  cer-
...

Additional info:

Comment 1 Kamil Dudka 2014-11-13 14:51:16 UTC
upstream commit:

http://sourceforge.net/p/zsh/code/ci/d6698d89