From 934929c2eef9182454bcad21ce098b6188acaf81 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 25 Jan 2015 15:23:43 +0000 Subject: [PATCH] =?UTF-8?q?rcsid=20sync=20from=20obsd;=20misc=20sync;=20sm?= =?UTF-8?q?all=20improvements=20=E2=80=A2=20mksh=20testsuite=20no=20longer?= =?UTF-8?q?=20uses=20printf,=20again=20=E2=80=A2=20use=20MAXPATHLEN=20from?= =?UTF-8?q?=20=20as=20PATH=5FMAX=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 249 +++++++++++++++++++++++++++++++------------------------- misc.c | 4 +- mksh.1 | 20 +++-- sh.h | 8 +- 4 files changed, 155 insertions(+), 126 deletions(-) diff --git a/check.t b/check.t index 0a5c948..3e1c8aa 100644 --- a/check.t +++ b/check.t @@ -1,8 +1,8 @@ -# $MirOS: src/bin/mksh/check.t,v 1.676 2015/01/04 21:08:08 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.677 2015/01/25 15:23:39 tg Exp $ # -*- mode: sh -*- #- # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013, 2014 +# 2011, 2012, 2013, 2014, 2015 # Thorsten Glaser # # Provided that these terms and disclaimer and all copyright notices @@ -30,7 +30,7 @@ # (2013/12/02 20:39:44) http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date expected-stdout: - @(#)MIRBSD KSH R50 2015/01/04 + @(#)MIRBSD KSH R50 2015/01/25 description: Check version of shell. stdin: @@ -39,7 +39,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R50 2015/01/04 + @(#)LEGACY KSH R50 2015/01/25 description: Check version of legacy shell. stdin: @@ -3614,23 +3614,23 @@ name: IFS-space-1 description: Simple test, default IFS stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } set -- A B C showargs 1 $* showargs 2 "$*" showargs 3 $@ showargs 4 "$@" expected-stdout: - <1> - <2> - <3> - <4> + <1> . + <2> . + <3> . + <4> . --- name: IFS-colon-1 description: Simple test, IFS=: stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS=: set -- A B C showargs 1 $* @@ -3638,16 +3638,16 @@ stdin: showargs 3 $@ showargs 4 "$@" expected-stdout: - <1> - <2> - <3> - <4> + <1> . + <2> . + <3> . + <4> . --- name: IFS-null-1 description: Simple test, IFS="" stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="" set -- A B C showargs 1 $* @@ -3655,16 +3655,16 @@ stdin: showargs 3 $@ showargs 4 "$@" expected-stdout: - <1> - <2> - <3> - <4> + <1> . + <2> . + <3> . + <4> . --- name: IFS-space-colon-1 description: Simple test, IFS=: stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="$IFS:" set -- showargs 1 $* @@ -3673,52 +3673,52 @@ stdin: showargs 4 "$@" showargs 5 : "$@" expected-stdout: - <1> - <2> <> - <3> - <4> - <5> <:> + <1> . + <2> <> . + <3> . + <4> . + <5> <:> . --- name: IFS-space-colon-2 description: Simple test, IFS=: AT&T ksh fails this, POSIX says the test is correct. stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="$IFS:" set -- showargs :"$@" expected-stdout: - <:> + <:> . --- name: IFS-space-colon-4 description: Simple test, IFS=: stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="$IFS:" set -- showargs "$@$@" expected-stdout: - + . --- name: IFS-space-colon-5 description: Simple test, IFS=: Don't know what POSIX thinks of this. AT&T ksh does not do this. stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="$IFS:" set -- showargs "${@:-}" expected-stdout: - <> + <> . --- name: IFS-subst-1 description: Simple test, IFS=: stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="$IFS:" x=":b: :" echo -n '1:'; for i in $x ; do echo -n " [$i]" ; done ; echo @@ -3740,58 +3740,58 @@ stdin: expected-stdout: 1: [] [b] [] 2: [:b::] - <3> <> <> - <4> <:b::> + <3> <> <> . + <4> <:b::> . 5: [a] [b] - <6> + <6> . 7: [a] [] [c] - <8> <> + <8> <> . 9: [h] [ith] [ere] - <10> - <11> + <10> . + <11> . 12: [A] [B] [] [D] - <13> <> + <13> <> . --- name: IFS-subst-2 description: Check leading whitespace after trim does not make a field stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } x="X 1 2" showargs 1 shift ${x#X} expected-stdout: - <1> <1> <2> + <1> <1> <2> . --- name: IFS-subst-3-arr description: Check leading IFS non-whitespace after trim does make a field but leading IFS whitespace does not, nor empty replacements stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } showargs 0 ${-+} IFS=: showargs 1 ${-+:foo:bar} IFS=' ' showargs 2 ${-+ foo bar} expected-stdout: - <0> - <1> <> - <2> + <0> . + <1> <> . + <2> . --- name: IFS-subst-3-ass description: Check non-field semantics stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } showargs 0 x=${-+} IFS=: showargs 1 x=${-+:foo:bar} IFS=' ' showargs 2 x=${-+ foo bar} expected-stdout: - <0> - <1> - <2> + <0> . + <1> . + <2> . --- name: IFS-subst-3-lcl description: @@ -3808,11 +3808,12 @@ name: IFS-subst-4-1 description: reported by mikeserv stdin: + pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; } a='space divded argument here' IFS=\ ; set -- $a IFS= ; q="$*" ; nq=$* - printf '<%s>\n' "$*" $* "$q" "$nq" + pfn "$*" $* "$q" "$nq" [ "$q" = "$nq" ] && echo =true || echo =false expected-stdout: "; done; } a='space divded argument here' IFS=\ ; set -- $a IFS= ; q="$@" ; nq=$@ - printf '<%s>\n' "$*" $* "$q" "$nq" + pfn "$*" $* "$q" "$nq" [ "$q" = "$nq" ] && echo =true || echo =false expected-stdout: "; done; } a='space divded argument here' IFS=\ ; set -- $a; IFS= @@ -3861,14 +3864,14 @@ stdin: nqs=$* qk="$@" nqk=$@ - printf '= qs '; printf '<%s>\n' "$qs" - printf '=nqs '; printf '<%s>\n' "$nqs" - printf '= qk '; printf '<%s>\n' "$qk" - printf '=nqk '; printf '<%s>\n' "$nqk" - printf '~ qs '; printf '<%s>\n' "$*" - printf '~nqs '; printf '<%s>\n' $* - printf '~ qk '; printf '<%s>\n' "$@" - printf '~nqk '; printf '<%s>\n' $@ + print -nr -- '= qs '; pfn "$qs" + print -nr -- '=nqs '; pfn "$nqs" + print -nr -- '= qk '; pfn "$qk" + print -nr -- '=nqk '; pfn "$nqk" + print -nr -- '~ qs '; pfn "$*" + print -nr -- '~nqs '; pfn $* + print -nr -- '~ qk '; pfn "$@" + print -nr -- '~nqk '; pfn $@ expected-stdout: = qs @@ -3897,21 +3900,22 @@ name: IFS-subst-4-4 description: extended testsuite based on problem by mikeserv stdin: + pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; } a='space divded argument here' IFS=\ ; set -- $a; IFS= qs="$*" - printf '= qs '; printf '<%s>\n' "$qs" - printf '~ qs '; printf '<%s>\n' "$*" + print -nr -- '= qs '; pfn "$qs" + print -nr -- '~ qs '; pfn "$*" nqs=$* - printf '=nqs '; printf '<%s>\n' "$nqs" - printf '~nqs '; printf '<%s>\n' $* + print -nr -- '=nqs '; pfn "$nqs" + print -nr -- '~nqs '; pfn $* qk="$@" - printf '= qk '; printf '<%s>\n' "$qk" - printf '~ qk '; printf '<%s>\n' "$@" + print -nr -- '= qk '; pfn "$qk" + print -nr -- '~ qk '; pfn "$@" nqk=$@ - printf '=nqk '; printf '<%s>\n' "$nqk" - printf '~nqk '; printf '<%s>\n' $@ + print -nr -- '=nqk '; pfn "$nqk" + print -nr -- '~nqk '; pfn $@ expected-stdout: = qs @@ -3940,22 +3944,23 @@ name: IFS-subst-4-4p description: extended testsuite based on problem by mikeserv stdin: + pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; } a='space divded argument here' IFS=\ ; set -- $a; IFS= unset v qs=${v:-"$*"} - printf '= qs '; printf '<%s>\n' "$qs" - printf '~ qs '; printf '<%s>\n' ${v:-"$*"} + print -nr -- '= qs '; pfn "$qs" + print -nr -- '~ qs '; pfn ${v:-"$*"} nqs=${v:-$*} - printf '=nqs '; printf '<%s>\n' "$nqs" - printf '~nqs '; printf '<%s>\n' ${v:-$*} + print -nr -- '=nqs '; pfn "$nqs" + print -nr -- '~nqs '; pfn ${v:-$*} qk=${v:-"$@"} - printf '= qk '; printf '<%s>\n' "$qk" - printf '~ qk '; printf '<%s>\n' ${v:-"$@"} + print -nr -- '= qk '; pfn "$qk" + print -nr -- '~ qk '; pfn ${v:-"$@"} nqk=${v:-$@} - printf '=nqk '; printf '<%s>\n' "$nqk" - printf '~nqk '; printf '<%s>\n' ${v:-$@} + print -nr -- '=nqk '; pfn "$nqk" + print -nr -- '~nqk '; pfn ${v:-$@} expected-stdout: = qs @@ -3984,21 +3989,22 @@ name: IFS-subst-4-5 description: extended testsuite based on problem by mikeserv stdin: + pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; } a='space divded argument here' IFS=\ ; set -- $a; IFS=, qs="$*" - printf '= qs '; printf '<%s>\n' "$qs" - printf '~ qs '; printf '<%s>\n' "$*" + print -nr -- '= qs '; pfn "$qs" + print -nr -- '~ qs '; pfn "$*" nqs=$* - printf '=nqs '; printf '<%s>\n' "$nqs" - printf '~nqs '; printf '<%s>\n' $* + print -nr -- '=nqs '; pfn "$nqs" + print -nr -- '~nqs '; pfn $* qk="$@" - printf '= qk '; printf '<%s>\n' "$qk" - printf '~ qk '; printf '<%s>\n' "$@" + print -nr -- '= qk '; pfn "$qk" + print -nr -- '~ qk '; pfn "$@" nqk=$@ - printf '=nqk '; printf '<%s>\n' "$nqk" - printf '~nqk '; printf '<%s>\n' $@ + print -nr -- '=nqk '; pfn "$nqk" + print -nr -- '~nqk '; pfn $@ expected-stdout: = qs @@ -4027,22 +4033,23 @@ name: IFS-subst-4-5p description: extended testsuite based on problem by mikeserv stdin: + pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; } a='space divded argument here' IFS=\ ; set -- $a; IFS=, unset v qs=${v:-"$*"} - printf '= qs '; printf '<%s>\n' "$qs" - printf '~ qs '; printf '<%s>\n' ${v:-"$*"} + print -nr -- '= qs '; pfn "$qs" + print -nr -- '~ qs '; pfn ${v:-"$*"} nqs=${v:-$*} - printf '=nqs '; printf '<%s>\n' "$nqs" - printf '~nqs '; printf '<%s>\n' ${v:-$*} + print -nr -- '=nqs '; pfn "$nqs" + print -nr -- '~nqs '; pfn ${v:-$*} qk=${v:-"$@"} - printf '= qk '; printf '<%s>\n' "$qk" - printf '~ qk '; printf '<%s>\n' ${v:-"$@"} + print -nr -- '= qk '; pfn "$qk" + print -nr -- '~ qk '; pfn ${v:-"$@"} nqk=${v:-$@} - printf '=nqk '; printf '<%s>\n' "$nqk" - printf '~nqk '; printf '<%s>\n' ${v:-$@} + print -nr -- '=nqk '; pfn "$nqk" + print -nr -- '~nqk '; pfn ${v:-$@} expected-stdout: = qs @@ -4083,37 +4090,53 @@ description: - b5ins, matching mksh’s !!WARNING!! more to come: http://austingroupbugs.net/view.php?id=888 stdin: - "$__progname" -c 'IFS=; set -- "" 2 ""; printf "[%s]\n" $*; x=$*; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- "" 2 ""; pfb $*; x=$*; pfn "$x"' echo '=a1zns' - "$__progname" -c 'IFS=; set -- "" 2 ""; printf "[%s]\n" "$*"; x="$*"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- "" 2 ""; pfb "$*"; x="$*"; pfn "$x"' echo '=a2zqs' - "$__progname" -c 'IFS=; set -- "" 2 ""; printf "[%s]\n" $@; x=$@; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- "" 2 ""; pfb $@; x=$@; pfn "$x"' echo '=a3zna' - "$__progname" -c 'IFS=; set -- "" 2 ""; printf "[%s]\n" "$@"; x="$@"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- "" 2 ""; pfb "$@"; x="$@"; pfn "$x"' echo '=a4zqa' - "$__progname" -c 'IFS=,; set -- "" 2 ""; printf "[%s]\n" $*; x=$*; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- "" 2 ""; pfb $*; x=$*; pfn "$x"' echo '=a5ins' - "$__progname" -c 'IFS=,; set -- "" 2 ""; printf "[%s]\n" "$*"; x="$*"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- "" 2 ""; pfb "$*"; x="$*"; pfn "$x"' echo '=a6iqs' - "$__progname" -c 'IFS=,; set -- "" 2 ""; printf "[%s]\n" $@; x=$@; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- "" 2 ""; pfb $@; x=$@; pfn "$x"' echo '=a7ina' - "$__progname" -c 'IFS=,; set -- "" 2 ""; printf "[%s]\n" "$@"; x="$@"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- "" 2 ""; pfb "$@"; x="$@"; pfn "$x"' echo '=a8iqa' - "$__progname" -c 'IFS=; set -- A B "" "" C; printf "[%s]\n" $*; x=$*; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- A B "" "" C; pfb $*; x=$*; pfn "$x"' echo '=b1zns' - "$__progname" -c 'IFS=; set -- A B "" "" C; printf "[%s]\n" "$*"; x="$*"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- A B "" "" C; pfb "$*"; x="$*"; pfn "$x"' echo '=b2zqs' - "$__progname" -c 'IFS=; set -- A B "" "" C; printf "[%s]\n" $@; x=$@; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- A B "" "" C; pfb $@; x=$@; pfn "$x"' echo '=b3zna' - "$__progname" -c 'IFS=; set -- A B "" "" C; printf "[%s]\n" "$@"; x="$@"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=; set -- A B "" "" C; pfb "$@"; x="$@"; pfn "$x"' echo '=b4zqa' - "$__progname" -c 'IFS=,; set -- A B "" "" C; printf "[%s]\n" $*; x=$*; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- A B "" "" C; pfb $*; x=$*; pfn "$x"' echo '=b5ins' - "$__progname" -c 'IFS=,; set -- A B "" "" C; printf "[%s]\n" "$*"; x="$*"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- A B "" "" C; pfb "$*"; x="$*"; pfn "$x"' echo '=b6iqs' - "$__progname" -c 'IFS=,; set -- A B "" "" C; printf "[%s]\n" $@; x=$@; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- A B "" "" C; pfb $@; x=$@; pfn "$x"' echo '=b7ina' - "$__progname" -c 'IFS=,; set -- A B "" "" C; printf "[%s]\n" "$@"; x="$@"; printf "<%s>\n" "$x"' + "$__progname" -c 'pfb() { for s_arg in "$@"; do print -r -- "[$s_arg]"; done; }; pfn() { for s_arg in "$@"; do print -r -- "<$s_arg>"; done; }; + IFS=,; set -- A B "" "" C; pfb "$@"; x="$@"; pfn "$x"' echo '=b8iqa' expected-stdout: [2] @@ -4193,7 +4216,7 @@ name: IFS-subst-6 description: Regression wrt. vector expansion in trim stdin: - showargs() { for x in "$@"; do echo -n "<$x> "; done; echo .; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS= x=abc set -- a b @@ -4205,7 +4228,7 @@ name: IFS-subst-7 description: ksh93 bug wrt. vector expansion in trim stdin: - showargs() { for x in "$@"; do echo -n "<$x> "; done; echo .; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS="*" a=abcd set -- '' c @@ -4228,7 +4251,7 @@ description: stdin: ${ZSH_VERSION+false} || emulate sh ${BASH_VERSION+set -o posix} - showargs() { for x in "$@"; do echo -n "<$x> "; done; echo .; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } IFS=0 showargs $((1230456)) expected-stdout: @@ -8342,13 +8365,13 @@ name: varexpand-null-3 description: Ensure concatenating behaviour matches other shells stdin: - showargs() { for i; do echo -n " <$i>"; done; echo; } + showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; } x=; showargs 1 "$x"$@ set A; showargs 2 "${@:+}" expected-fail: yes expected-stdout: - <1> <> - <2> <> + <1> <> . + <2> <> . --- name: print-funny-chars description: diff --git a/misc.c b/misc.c index 5ba076e..3426049 100644 --- a/misc.c +++ b/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.38 2013/11/28 10:33:37 sobrado Exp $ */ +/* $OpenBSD: misc.c,v 1.39 2015/01/16 06:39:32 deraadt Exp $ */ /* $OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $ */ /*- @@ -30,7 +30,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.223 2015/01/02 13:21:28 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.224 2015/01/25 15:23:41 tg Exp $"); #define KSH_CHVT_FLAG #ifdef MKSH_SMALL diff --git a/mksh.1 b/mksh.1 index 15e9212..83a0a77 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,8 +1,8 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.347 2014/12/18 20:51:12 tg Exp $ -.\" $OpenBSD: ksh.1,v 1.155 2014/12/09 15:37:13 schwarze Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.348 2015/01/25 15:23:42 tg Exp $ +.\" $OpenBSD: ksh.1,v 1.156 2015/01/16 15:32:32 schwarze Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -.\" 2010, 2011, 2012, 2013, 2014 +.\" 2010, 2011, 2012, 2013, 2014, 2015 .\" Thorsten Glaser .\" .\" Provided that these terms and disclaimer and all copyright notices @@ -74,7 +74,7 @@ .\" with -mandoc, it might implement .Mx itself, but we want to .\" use our own definition. And .Dd must come *first*, always. .\" -.Dd $Mdocdate: December 18 2014 $ +.Dd $Mdocdate: January 25 2015 $ .\" .\" Check which macro package we use, and do other -mdoc setup. .\" @@ -673,11 +673,11 @@ are reserved words, not meta-characters. .It Xo case Ar word No in .Oo Op \&( .Ar pattern -.Op \*(Ba Ar pat +.Op \*(Ba Ar pattern .No ... Ns ) .Ar list -.Op ;; \*(Ba ;&\& \*(Ba ;\*(Ba\ \& -.Oc ... esac +.Ic terminator +.Oc No ... esac .Xc The .Ic case @@ -707,9 +707,11 @@ For historical reasons, open and close braces may be used instead of and .Ic esac e.g.\& -.Ic case $foo { *) echo bar;; } . +.Ic case $foo { *) echo bar ;; } . .Pp -The list terminators are: +The list +.Ic terminator Ns s +are: .Bl -tag -width 4n .It Ql ;; Terminate after the list. diff --git a/sh.h b/sh.h index ba890ec..fe4c057 100644 --- a/sh.h +++ b/sh.h @@ -169,9 +169,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.708 2015/01/04 21:08:10 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.709 2015/01/25 15:23:43 tg Exp $"); #endif -#define MKSH_VERSION "R50 2015/01/04" +#define MKSH_VERSION "R50 2015/01/25" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES @@ -312,9 +312,13 @@ struct rusage { #undef PATH_MAX #else #ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else #define PATH_MAX 1024 #endif #endif +#endif #ifndef SIZE_MAX #ifdef SIZE_T_MAX #define SIZE_MAX SIZE_T_MAX