Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] zsh.1,zshall.1: missing b emulation option in man page



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 <fkrska@xxxxxxxxxx>
[jchaloup@xxxxxxxxxx: corrected for upstream patch]
Signed-off-by: Jan Chaloupka <jchaloup@xxxxxxxxxx>
---
 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)



Messages sorted by: Reverse Date, Date, Thread, Author