add the chdir builtin from mircvs://contrib/hosted/tg/deb/mksh/ for

better dash compatibility (mksh is now a dash superset if printf is
compiled in)
This commit is contained in:
tg 2009-08-30 21:02:01 +00:00
parent e622d80394
commit 4a4be7d313
4 changed files with 22 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.301 2009/08/28 22:46:19 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.302 2009/08/30 21:01:59 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R39 2009/08/28
@(#)MIRBSD KSH R39 2009/08/30
description:
Check version of shell.
stdin:

View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.127 2009/08/30 13:30:07 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.128 2009/08/30 21:02:00 tg Exp $");
#if HAVE_KILLPG
/*
@ -77,6 +77,7 @@ const struct builtin mkshbuiltins[] = {
{"*=unset", c_unset},
{"+alias", c_alias}, /* no =: AT&T manual wrong */
{"+cd", c_cd},
{"chdir", c_cd}, /* dash compatibility hack */
{"+command", c_command},
{"echo", c_print},
{"*=export", c_typeset},

21
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.178 2009/08/30 11:38:44 tg Exp $
.\" $MirOS: src/bin/mksh/mksh.1,v 1.179 2009/08/30 21:02:00 tg Exp $
.\" $OpenBSD: ksh.1,v 1.129 2009/05/28 06:09:06 jmc Exp $
.\"-
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
@ -156,6 +156,7 @@ files:
.It
The
.Ic cd
.Po and Ic chdir Pc
command is disabled.
.It
The
@ -2556,10 +2557,10 @@ Additional
.Nm
regular commands
.Pp
.Ic \&[ , bind , echo , let ,
.Ic mknod , print , printf , pwd ,
.Ic realpath , rename , test , ulimit ,
.Ic whence
.Ic \&[ , chdir , bind , echo ,
.Ic let , mknod , print , printf ,
.Ic pwd , realpath , rename , test ,
.Ic ulimit , whence
.Pp
In the future, the additional
.Nm
@ -2743,6 +2744,11 @@ Execute the built-in command
.Op Fl LP
.Op Ar dir
.Xc
.It Xo
.Ic chdir
.Op Fl LP
.Op Ar dir
.Xc
Set the working directory to
.Ar dir .
If the parameter
@ -2802,6 +2808,11 @@ respectively.
.Op Fl LP
.Ar old new
.Xc
.It Xo
.Ic chdir
.Op Fl LP
.Ar old new
.Xc
The string
.Ar new
is substituted for

4
sh.h
View File

@ -134,9 +134,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.336 2009/08/30 13:30:08 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.337 2009/08/30 21:02:01 tg Exp $");
#endif
#define MKSH_VERSION "R39 2009/08/28"
#define MKSH_VERSION "R39 2009/08/30"
#ifndef MKSH_INCLUDES_ONLY