--- mksh-40.4.orig/check.t +++ mksh-40.4/check.t @@ -1,9 +1,10 @@ -# $MirOS: src/bin/mksh/check.t,v 1.474.2.10 2011/12/11 18:18:20 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.474.2.12 2012/02/11 15:25:29 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 $ #- -# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 # Thorsten Glaser # # Provided that these terms and disclaimer and all copyright notices @@ -28,7 +29,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R40 2011/12/11 + @(#)MIRBSD KSH R40 2012/02/11 description: Check version of shell. stdin: @@ -3878,7 +3879,7 @@ echo =1 trap "echo trap 2 executed" UNKNOWNSIGNAL EXIT 999999 FNORD echo = $? - ) 2>&1 | sed "s^${__progname}: \[[0-9]*]PROG" + ) 2>&1 | sed "s^${__progname%.exe}\.*e*x*e*: \[[0-9]*]PROG" expected-stdout: PROG: trap: bad signal 'UNKNOWNSIGNAL' foo @@ -4998,6 +4999,30 @@ expected-stdout: ok --- +name: regression-66 +description: + Check that quoting is sane + XXX not really in R40-stable +stdin: + ac_space=' ' + ac_newline=' + ' + set | grep ^ac_ |& + set -A lines + while IFS= read -pr line; do + if [[ $line = *space* ]]; then + lines[0]=$line + else + lines[1]=$line + fi + done + for line in "${lines[@]}"; do + print -r -- "$line" + done +expected-stdout: + ac_space=' ' + ac_newline=' +--- name: readonly-0 description: Ensure readonly is honoured for assignments and unset @@ -6047,7 +6072,7 @@ -UMKSH_ASSUME_UTF8 => not expected, but if your OS is old, try passing HAVE_SETLOCALE_CTYPE=0 to Build.sh need-pass: no -category: !os:hpux +category: !os:hpux,!os:msys need-ctty: yes arguments: !-i! env-setup: !PS1=!PS2=!LC_CTYPE=en_US.UTF-8! @@ -8226,6 +8251,22 @@ esac } --- +name: comsub-5 +description: + Check COMSUB works with aliases (does not expand them twice) +stdin: + alias echo='echo a' + foo() { + printf '%s\n' "$(echo foo)" + } + printf '%s\n' "$(echo b)" + typeset -f foo +expected-stdout: + a b + foo() { + printf "%s\\n" "$(echo foo )" + } +--- name: comsub-torture description: Check the tree dump functions work correctly @@ -8267,7 +8308,7 @@ #TSELECT select file in *; do echo "<$file>" ; break ; done #TFOR_TTIME - for i in {1,2,3} ; do time echo $i ; done + time for i in {1,2,3} ; do echo $i ; done #TCASE case $foo in 1) echo eins;& 2) echo zwei ;| *) echo kann net bis drei zählen;; esac #TIF_TBANG_TDBRACKET_TELIF @@ -8409,25 +8450,25 @@ x=$(( select file in * ; do echo "<$file>" ; break ; done ) | tr u x ) } inline_TFOR_TTIME() { - for i in {1,2,3} ; do time echo $i ; done + time for i in {1,2,3} ; do echo $i ; done } inline_TFOR_TTIME() { - for i in {1,2,3} + time for i in {1,2,3} do - time echo $i + echo $i done } function comsub_TFOR_TTIME { x=$( - for i in {1,2,3} ; do time echo $i ; done + time for i in {1,2,3} ; do echo $i ; done ); } function comsub_TFOR_TTIME { - x=$(for i in {1,2,3} ; do time echo $i ; done ) + x=$(time for i in {1,2,3} ; do echo $i ; done ) } function reread_TFOR_TTIME { x=$(( - for i in {1,2,3} ; do time echo $i ; done + time for i in {1,2,3} ; do echo $i ; done )|tr u x); } function reread_TFOR_TTIME { - x=$(( for i in {1,2,3} ; do time echo $i ; done ) | tr u x ) + x=$(( time for i in {1,2,3} ; do echo $i ; done ) | tr u x ) } inline_TCASE() { case $foo in 1) echo eins;& 2) echo zwei ;| *) echo kann net bis drei zählen;; esac @@ -8923,6 +8964,328 @@ x=$(( case x in (x) a+=b ; set -A c+ -- d e ;; esac ) | tr u x ) } --- +name: comsub-torture-io +description: + Check the tree dump functions work correctly with I/O redirection +stdin: + if [[ -z $__progname ]]; then echo >&2 call me with __progname; exit 1; fi + while IFS= read -r line; do + if [[ $line = '#1' ]]; then + lastf=0 + continue + elif [[ $line = EOFN* ]]; then + fbody=$fbody$'\n'$line + continue + elif [[ $line != '#'* ]]; then + fbody=$fbody$'\n\t'$line + continue + fi + if (( lastf )); then + x="inline_${nextf}() {"$fbody$'\n}\n' + print -nr -- "$x" + print -r -- "${x}typeset -f inline_$nextf" | "$__progname" + x="function comsub_$nextf { x=\$("$fbody$'\n); }\n' + print -nr -- "$x" + print -r -- "${x}typeset -f comsub_$nextf" | "$__progname" + x="function reread_$nextf { x=\$(("$fbody$'\n)|tr u x); }\n' + print -nr -- "$x" + print -r -- "${x}typeset -f reread_$nextf" | "$__progname" + fi + lastf=1 + fbody= + nextf=${line#?} + done <<'EOD' + #1 + #TCOM + vara=1 varb='2 3' cmd arg1 $arg2 "$arg3 4" >&3 + #TPAREN_TPIPE_TLIST + (echo $foo | tr -dc 0-9 >&3; echo >&3) >&3 + #TAND_TOR + cmd >&3 && >&3 echo ja || echo >&3 nein + #TSELECT + select file in *; do echo "<$file>" ; break >&3 ; done >&3 + #TFOR_TTIME + for i in {1,2,3} ; do time >&3 echo $i ; done >&3 + #TCASE + case $foo in 1) echo eins >&3;& 2) echo zwei >&3 ;| *) echo kann net bis drei zählen >&3;; esac >&3 + #TIF_TBANG_TDBRACKET_TELIF + if ! [[ 1 = 1 ]] >&3 ; then echo eins; elif [[ 1 = 2 ]] >&3; then echo zwei ;else echo drei; fi >&3 + #TWHILE + i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3 + #TUNTIL + i=10; until (( !--i )) >&3 ; do echo $i; done >&3 + #TCOPROC + cat * >&3 |& >&3 ls + #TFUNCT_TBRACE_TASYNC + function korn { echo eins; echo >&3 zwei ; } + bourne () { logger * >&3 & } + #COMSUB_EXPRSUB + echo $(true >&3) $((1+ 2)) + #0 + EOD +expected-stdout: + inline_TCOM() { + vara=1 varb='2 3' cmd arg1 $arg2 "$arg3 4" >&3 + } + inline_TCOM() { + vara=1 varb="2 3" cmd arg1 $arg2 "$arg3 4" >&3 + } + function comsub_TCOM { x=$( + vara=1 varb='2 3' cmd arg1 $arg2 "$arg3 4" >&3 + ); } + function comsub_TCOM { + x=$(vara=1 varb="2 3" cmd arg1 $arg2 "$arg3 4" >&3 ) + } + function reread_TCOM { x=$(( + vara=1 varb='2 3' cmd arg1 $arg2 "$arg3 4" >&3 + )|tr u x); } + function reread_TCOM { + x=$(( vara=1 varb="2 3" cmd arg1 $arg2 "$arg3 4" >&3 ) | tr u x ) + } + inline_TPAREN_TPIPE_TLIST() { + (echo $foo | tr -dc 0-9 >&3; echo >&3) >&3 + } + inline_TPAREN_TPIPE_TLIST() { + ( echo $foo | tr -dc 0-9 >&3 + echo >&3 ) >&3 + } + function comsub_TPAREN_TPIPE_TLIST { x=$( + (echo $foo | tr -dc 0-9 >&3; echo >&3) >&3 + ); } + function comsub_TPAREN_TPIPE_TLIST { + x=$(( echo $foo | tr -dc 0-9 >&3 ; echo >&3 ) >&3 ) + } + function reread_TPAREN_TPIPE_TLIST { x=$(( + (echo $foo | tr -dc 0-9 >&3; echo >&3) >&3 + )|tr u x); } + function reread_TPAREN_TPIPE_TLIST { + x=$(( ( echo $foo | tr -dc 0-9 >&3 ; echo >&3 ) >&3 ) | tr u x ) + } + inline_TAND_TOR() { + cmd >&3 && >&3 echo ja || echo >&3 nein + } + inline_TAND_TOR() { + cmd >&3 && echo ja >&3 || echo nein >&3 + } + function comsub_TAND_TOR { x=$( + cmd >&3 && >&3 echo ja || echo >&3 nein + ); } + function comsub_TAND_TOR { + x=$(cmd >&3 && echo ja >&3 || echo nein >&3 ) + } + function reread_TAND_TOR { x=$(( + cmd >&3 && >&3 echo ja || echo >&3 nein + )|tr u x); } + function reread_TAND_TOR { + x=$(( cmd >&3 && echo ja >&3 || echo nein >&3 ) | tr u x ) + } + inline_TSELECT() { + select file in *; do echo "<$file>" ; break >&3 ; done >&3 + } + inline_TSELECT() { + select file in * + do + echo "<$file>" + break >&3 + done >&3 + } + function comsub_TSELECT { x=$( + select file in *; do echo "<$file>" ; break >&3 ; done >&3 + ); } + function comsub_TSELECT { + x=$(select file in * ; do echo "<$file>" ; break >&3 ; done >&3 ) + } + function reread_TSELECT { x=$(( + select file in *; do echo "<$file>" ; break >&3 ; done >&3 + )|tr u x); } + function reread_TSELECT { + x=$(( select file in * ; do echo "<$file>" ; break >&3 ; done >&3 ) | tr u x ) + } + inline_TFOR_TTIME() { + for i in {1,2,3} ; do time >&3 echo $i ; done >&3 + } + inline_TFOR_TTIME() { + for i in {1,2,3} + do + time echo $i >&3 + done >&3 + } + function comsub_TFOR_TTIME { x=$( + for i in {1,2,3} ; do time >&3 echo $i ; done >&3 + ); } + function comsub_TFOR_TTIME { + x=$(for i in {1,2,3} ; do time echo $i >&3 ; done >&3 ) + } + function reread_TFOR_TTIME { x=$(( + for i in {1,2,3} ; do time >&3 echo $i ; done >&3 + )|tr u x); } + function reread_TFOR_TTIME { + x=$(( for i in {1,2,3} ; do time echo $i >&3 ; done >&3 ) | tr u x ) + } + inline_TCASE() { + case $foo in 1) echo eins >&3;& 2) echo zwei >&3 ;| *) echo kann net bis drei zählen >&3;; esac >&3 + } + inline_TCASE() { + case $foo in + (1) + echo eins >&3 + ;& + (2) + echo zwei >&3 + ;| + (*) + echo kann net bis drei zählen >&3 + ;; + esac >&3 + } + function comsub_TCASE { x=$( + case $foo in 1) echo eins >&3;& 2) echo zwei >&3 ;| *) echo kann net bis drei zählen >&3;; esac >&3 + ); } + function comsub_TCASE { + x=$(case $foo in (1) echo eins >&3 ;& (2) echo zwei >&3 ;| (*) echo kann net bis drei zählen >&3 ;; esac >&3 ) + } + function reread_TCASE { x=$(( + case $foo in 1) echo eins >&3;& 2) echo zwei >&3 ;| *) echo kann net bis drei zählen >&3;; esac >&3 + )|tr u x); } + function reread_TCASE { + x=$(( case $foo in (1) echo eins >&3 ;& (2) echo zwei >&3 ;| (*) echo kann net bis drei zählen >&3 ;; esac >&3 ) | tr u x ) + } + inline_TIF_TBANG_TDBRACKET_TELIF() { + if ! [[ 1 = 1 ]] >&3 ; then echo eins; elif [[ 1 = 2 ]] >&3; then echo zwei ;else echo drei; fi >&3 + } + inline_TIF_TBANG_TDBRACKET_TELIF() { + if ! [[ 1 = 1 ]] >&3 + then + echo eins + elif [[ 1 = 2 ]] >&3 + then + echo zwei + else + echo drei + fi >&3 + } + function comsub_TIF_TBANG_TDBRACKET_TELIF { x=$( + if ! [[ 1 = 1 ]] >&3 ; then echo eins; elif [[ 1 = 2 ]] >&3; then echo zwei ;else echo drei; fi >&3 + ); } + function comsub_TIF_TBANG_TDBRACKET_TELIF { + x=$(if ! [[ 1 = 1 ]] >&3 ; then echo eins ; elif [[ 1 = 2 ]] >&3 ; then echo zwei ; else echo drei ; fi >&3 ) + } + function reread_TIF_TBANG_TDBRACKET_TELIF { x=$(( + if ! [[ 1 = 1 ]] >&3 ; then echo eins; elif [[ 1 = 2 ]] >&3; then echo zwei ;else echo drei; fi >&3 + )|tr u x); } + function reread_TIF_TBANG_TDBRACKET_TELIF { + x=$(( if ! [[ 1 = 1 ]] >&3 ; then echo eins ; elif [[ 1 = 2 ]] >&3 ; then echo zwei ; else echo drei ; fi >&3 ) | tr u x ) + } + inline_TWHILE() { + i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3 + } + inline_TWHILE() { + i=1 + while let " i < 10 " >&3 + do + echo $i + let ++i + done >&3 + } + function comsub_TWHILE { x=$( + i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3 + ); } + function comsub_TWHILE { + x=$(i=1 ; while let " i < 10 " >&3 ; do echo $i ; let ++i ; done >&3 ) + } + function reread_TWHILE { x=$(( + i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3 + )|tr u x); } + function reread_TWHILE { + x=$(( i=1 ; while let " i < 10 " >&3 ; do echo $i ; let ++i ; done >&3 ) | tr u x ) + } + inline_TUNTIL() { + i=10; until (( !--i )) >&3 ; do echo $i; done >&3 + } + inline_TUNTIL() { + i=10 + until let " !--i " >&3 + do + echo $i + done >&3 + } + function comsub_TUNTIL { x=$( + i=10; until (( !--i )) >&3 ; do echo $i; done >&3 + ); } + function comsub_TUNTIL { + x=$(i=10 ; until let " !--i " >&3 ; do echo $i ; done >&3 ) + } + function reread_TUNTIL { x=$(( + i=10; until (( !--i )) >&3 ; do echo $i; done >&3 + )|tr u x); } + function reread_TUNTIL { + x=$(( i=10 ; until let " !--i " >&3 ; do echo $i ; done >&3 ) | tr u x ) + } + inline_TCOPROC() { + cat * >&3 |& >&3 ls + } + inline_TCOPROC() { + cat * >&3 |& + ls >&3 + } + function comsub_TCOPROC { x=$( + cat * >&3 |& >&3 ls + ); } + function comsub_TCOPROC { + x=$(cat * >&3 |& ls >&3 ) + } + function reread_TCOPROC { x=$(( + cat * >&3 |& >&3 ls + )|tr u x); } + function reread_TCOPROC { + x=$(( cat * >&3 |& ls >&3 ) | tr u x ) + } + inline_TFUNCT_TBRACE_TASYNC() { + function korn { echo eins; echo >&3 zwei ; } + bourne () { logger * >&3 & } + } + inline_TFUNCT_TBRACE_TASYNC() { + function korn { + echo eins + echo zwei >&3 + } + bourne() { + logger * >&3 & + } + } + function comsub_TFUNCT_TBRACE_TASYNC { x=$( + function korn { echo eins; echo >&3 zwei ; } + bourne () { logger * >&3 & } + ); } + function comsub_TFUNCT_TBRACE_TASYNC { + x=$(function korn { echo eins ; echo zwei >&3 ; } ; bourne() { logger * >&3 & } ) + } + function reread_TFUNCT_TBRACE_TASYNC { x=$(( + function korn { echo eins; echo >&3 zwei ; } + bourne () { logger * >&3 & } + )|tr u x); } + function reread_TFUNCT_TBRACE_TASYNC { + x=$(( function korn { echo eins ; echo zwei >&3 ; } ; bourne() { logger * >&3 & } ) | tr u x ) + } + inline_COMSUB_EXPRSUB() { + echo $(true >&3) $((1+ 2)) + } + inline_COMSUB_EXPRSUB() { + echo $(true >&3 ) $((1+ 2)) + } + function comsub_COMSUB_EXPRSUB { x=$( + echo $(true >&3) $((1+ 2)) + ); } + function comsub_COMSUB_EXPRSUB { + x=$(echo $(true >&3 ) $((1+ 2)) ) + } + function reread_COMSUB_EXPRSUB { x=$(( + echo $(true >&3) $((1+ 2)) + )|tr u x); } + function reread_COMSUB_EXPRSUB { + x=$(( echo $(true >&3 ) $((1+ 2)) ) | tr u x ) + } +--- name: test-stnze-1 description: Check that the short form [ $x ] works @@ -9828,6 +10191,6 @@ (( u )) || set -U } - s=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + s=$("$__perlname" -e 'print "a"x12120;') Lb64decode $s >/dev/null --- --- mksh-40.4.orig/eval.c +++ mksh-40.4/eval.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.110 2011/11/26 00:45:20 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.111 2011/12/16 20:03:12 tg Exp $"); /* * string expansion @@ -863,11 +863,19 @@ fdo = 0; saw_eq = 0; tilde_ok = (f & (DOTILDE|DOASNTILDE)) ? 1 : 0; - if (c != 0) - Xinit(ds, dp, 128, ATEMP); - } - if (c == 0) + if (c == 0) + return; + Xinit(ds, dp, 128, ATEMP); + } else if (c == 0) { return; + } else if (type == XSUB && ctype(c, C_IFS) && + !ctype(c, C_IFSWS) && Xlength(ds, dp) == 0) { + char *p; + + *(p = alloc(1, ATEMP)) = '\0'; + XPput(*wp, p); + type = XSUBMID; + } if (word != IFS_NWS) word = ctype(c, C_IFSWS) ? IFS_WS : IFS_NWS; } else { --- mksh-40.4.orig/dot.mkshrc +++ mksh-40.4/dot.mkshrc @@ -1,5 +1,5 @@ # $Id$ -# $MirOS: src/bin/mksh/dot.mkshrc,v 1.68 2011/11/25 23:58:04 tg Exp $ +# $MirOS: src/bin/mksh/dot.mkshrc,v 1.69 2011/12/31 01:07:19 tg Exp $ #- # Copyright (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 # Thorsten Glaser @@ -326,6 +326,9 @@ function Lnzathash { Lnzathash_v=0 Lnzathash_add "$@" + Lnzathash_end +} +function Lnzathash_end { if (( Lnzathash_v )); then Lnzaathash_end else --- mksh-40.4.orig/histrap.c +++ mksh-40.4/histrap.c @@ -26,29 +26,22 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.113 2011/12/10 14:12:16 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.117 2011/12/31 00:47:45 tg Exp $"); Trap sigtraps[NSIG + 1]; static struct sigaction Sigact_ign; #if HAVE_PERSISTENT_HISTORY -static int hist_count_lines(unsigned char *, int); -static int hist_shrink(unsigned char *, int); -static unsigned char *hist_skip_back(unsigned char *,int *,int); -static void histload(Source *, unsigned char *, int); -static void histinsert(Source *, int, const char *); -static void writehistfile(int, char *); -static int sprinkle(int); +static int histload(Source *, unsigned char *, size_t); +static int writehistline(int, int, const char *); +static void writehistfile(int, const char *); #endif static int hist_execute(char *); -static int hist_replace(char **, const char *, const char *, bool); static char **hist_get(const char *, bool, bool); static char **hist_get_oldest(void); -static void histbackup(void); -static char **current; /* current position in history[] */ -static int hstarted; /* set after hist_init() called */ +static bool hstarted; /* set after hist_init() called */ static Source *hist_source; #if HAVE_PERSISTENT_HISTORY @@ -71,25 +64,35 @@ /* current history file: name, fd, size */ static char *hname; -static int histfd; -static size_t hsize; +static int histfd = -1; +static off_t histfsize; #endif static const char Tnot_in_history[] = "not in history"; #define Thistory (Tnot_in_history + 7) +static const char TFCEDIT_dollaru[] = "${FCEDIT:-/bin/ed} $_"; +#define Tspdollaru (TFCEDIT_dollaru + 18) + +/* HISTSIZE default: size of saved history, persistent or standard */ +#ifdef MKSH_SMALL +#define MKSH_DEFHISTSIZE 255 +#else +#define MKSH_DEFHISTSIZE 2047 +#endif +/* maximum considered size of persistent history file */ +#define MKSH_MAXHISTFSIZE ((off_t)1048576 * 96) + int c_fc(const char **wp) { struct shf *shf; struct temp *tf; - const char *p; - char *editor = NULL; bool gflag = false, lflag = false, nflag = false, rflag = false, sflag = false; int optc; - const char *first = NULL, *last = NULL; - char **hfirst, **hlast, **hp; + const char *p, *first = NULL, *last = NULL; + char **hfirst, **hlast, **hp, *editor = NULL; if (!Flag(FTALKING_I)) { bi_errorf("history %ss not available", Tfunction); @@ -110,7 +113,7 @@ /* almost certainly not overflowing */ editor = alloc(len + 4, ATEMP); memcpy(editor, p, len); - memcpy(editor + len, " $_", 4); + memcpy(editor + len, Tspdollaru, 4); } break; @@ -158,7 +161,7 @@ /* Substitute and execute command */ if (sflag) { - char *pat = NULL, *rep = NULL; + char *pat = NULL, *rep = NULL, *line; if (editor || lflag || nflag || rflag) { bi_errorf("can't use -e, -l, -n, -r with -s (-e -)"); @@ -184,7 +187,42 @@ hist_get_newest(false); if (!hp) return (1); - return (hist_replace(hp, pat, rep, gflag)); + /* hist_replace */ + if (!pat) + strdupx(line, *hp, ATEMP); + else { + char *s, *s1; + size_t len, pat_len, rep_len; + XString xs; + char *xp; + bool any_subst = false; + + pat_len = strlen(pat); + rep_len = strlen(rep); + Xinit(xs, xp, 128, ATEMP); + for (s = *hp; (s1 = strstr(s, pat)) && + (!any_subst || gflag); s = s1 + pat_len) { + any_subst = true; + len = s1 - s; + XcheckN(xs, xp, len + rep_len); + /*; first part */ + memcpy(xp, s, len); + xp += len; + /* replacement */ + memcpy(xp, rep, rep_len); + xp += rep_len; + } + if (!any_subst) { + bi_errorf("bad substitution"); + return (1); + } + len = strlen(s) + 1; + XcheckN(xs, xp, len); + memcpy(xp, s, len); + xp += len; + line = Xclose(xs, xp); + } + return (hist_execute(line)); } if (editor && (lflag || nflag)) { @@ -278,7 +316,7 @@ Source *sold = source; int ret; - ret = command(editor ? editor : "${FCEDIT:-/bin/ed} $_", 0); + ret = command(editor ? editor : TFCEDIT_dollaru, 0); source = sold; if (ret) return (ret); @@ -288,7 +326,7 @@ struct stat statb; XString xs; char *xp; - int n; + ssize_t n; if (!(shf = shf_open(tf->name, O_RDONLY, 0, 0))) { bi_errorf("can't %s temporary file %s: %s", @@ -298,7 +336,7 @@ if (stat(tf->name, &statb) < 0) n = 128; - else if (statb.st_size > (1024 * 1048576)) { + else if ((off_t)statb.st_size > MKSH_MAXHISTFSIZE) { bi_errorf("%s %s too large: %lu", Thistory, "file", (unsigned long)statb.st_size); goto errout; @@ -328,11 +366,18 @@ static int hist_execute(char *cmd) { + static int last_line = -1; Source *sold; int ret; char *p, *q; - histbackup(); + /* Back up over last histsave */ + if (histptr >= history && last_line != hist_source->line) { + hist_source->line--; + afree(*histptr, APERM); + histptr--; + last_line = hist_source->line; + } for (p = cmd; p; p = q) { if ((q = strchr(p, '\n'))) { @@ -365,48 +410,6 @@ return (ret); } -static int -hist_replace(char **hp, const char *pat, const char *rep, bool globr) -{ - char *line; - - if (!pat) - strdupx(line, *hp, ATEMP); - else { - char *s, *s1; - size_t pat_len = strlen(pat); - size_t rep_len = strlen(rep); - size_t len; - XString xs; - char *xp; - bool any_subst = false; - - Xinit(xs, xp, 128, ATEMP); - for (s = *hp; (s1 = strstr(s, pat)) && (!any_subst || globr); - s = s1 + pat_len) { - any_subst = true; - len = s1 - s; - XcheckN(xs, xp, len + rep_len); - /*; first part */ - memcpy(xp, s, len); - xp += len; - /* replacement */ - memcpy(xp, rep, rep_len); - xp += rep_len; - } - if (!any_subst) { - bi_errorf("bad substitution"); - return (1); - } - len = strlen(s) + 1; - XcheckN(xs, xp, len); - memcpy(xp, s, len); - xp += len; - line = Xclose(xs, xp); - } - return (hist_execute(line)); -} - /* * get pointer to history given pattern * pattern is a number or string @@ -471,21 +474,9 @@ return (history); } -/* - * Back up over last histsave - */ -static void -histbackup(void) -{ - static int last_line = -1; - - if (histptr >= history && last_line != hist_source->line) { - hist_source->line--; - afree(*histptr, APERM); - histptr--; - last_line = hist_source->line; - } -} +#if !MKSH_S_NOVI +/* current position in history[] */ +static char **current; /* * Return the current position. @@ -509,6 +500,7 @@ return (n); } } +#endif /* * This will become unnecessary if hist_get is modified to allow @@ -539,15 +531,15 @@ * set history; this means reallocating the dataspace */ void -sethistsize(int n) +sethistsize(mksh_ari_t n) { if (n > 0 && n != histsize) { int cursize = histptr - history; /* save most recent history */ if (n < cursize) { - memmove(history, histptr - n, n * sizeof(char *)); - cursize = n; + memmove(history, histptr - n + 1, n * sizeof(char *)); + cursize = n - 1; } history = aresize2(history, n, sizeof(char *), APERM); @@ -566,7 +558,7 @@ sethistfile(const char *name) { /* if not started then nothing to do */ - if (hstarted == 0) + if (hstarted == false) return; /* if the name is the same as the name we have */ @@ -576,11 +568,11 @@ /* * it's a new name - possibly */ - if (histfd) { + if (histfd != -1) { /* yes the file is open */ (void)close(histfd); - histfd = 0; - hsize = 0; + histfd = -1; + histfsize = 0; afree(hname, APERM); hname = NULL; /* let's reset the history */ @@ -599,7 +591,7 @@ init_histvec(void) { if (history == (char **)NULL) { - histsize = HISTORYSIZE; + histsize = MKSH_DEFHISTSIZE; history = alloc2(histsize, sizeof(char *), APERM); histptr = history - 1; } @@ -617,7 +609,7 @@ { bool changed = false; - if (histfd) { + if (histfd != -1) { int lno = hist_source->line; hist_source->line++; @@ -656,7 +648,7 @@ ++*lnp; #if HAVE_PERSISTENT_HISTORY - if (histfd && dowrite) + if (dowrite && histfd != -1) writehistfile(*lnp, c); #endif @@ -680,6 +672,10 @@ * This is ksh behaviour. * * This stuff uses mmap() + * + * This stuff is so totally broken it must eventually be + * redesigned, without mmap, better checks, support for + * larger files, etc. and handle partially corrupted files */ /*- @@ -689,36 +685,38 @@ * HMAGIC - just to check that we are dealing with the correct object * Then follows a number of stored commands * Each command is - * + * */ -#define HMAGIC1 0xab -#define HMAGIC2 0xcd -#define COMMAND 0xff +#define HMAGIC1 0xAB +#define HMAGIC2 0xCD +#define COMMAND 0xFF + +static const unsigned char sprinkle[2] = { HMAGIC1, HMAGIC2 }; void hist_init(Source *s) { #if HAVE_PERSISTENT_HISTORY unsigned char *base; - int lines, fd, rv = 0; - off_t hfsize; + int lines, fd; + enum { hist_init_first, hist_init_retry, hist_init_restore } hs; #endif if (Flag(FTALKING) == 0) return; - hstarted = 1; - + hstarted = true; hist_source = s; #if HAVE_PERSISTENT_HISTORY if ((hname = str_val(global("HISTFILE"))) == NULL) return; strdupx(hname, hname, APERM); + hs = hist_init_first; retry: /* we have a file and are interactive */ - if ((fd = open(hname, O_RDWR|O_CREAT|O_APPEND, 0600)) < 0) + if ((fd = open(hname, O_RDWR | O_CREAT | O_APPEND, 0600)) < 0) return; histfd = savefd(fd); @@ -727,247 +725,144 @@ (void)flock(histfd, LOCK_EX); - hfsize = lseek(histfd, (off_t)0, SEEK_END); - hsize = 1024 * 1048576; - if (hfsize < (off_t)hsize) - hsize = (size_t)hfsize; - - if (hsize == 0) { - /* add magic */ - if (sprinkle(histfd)) { - hist_finish(); - return; - } - } else if (hsize > 0) { - /* - * we have some data - */ - base = (void *)mmap(NULL, hsize, PROT_READ, + histfsize = lseek(histfd, (off_t)0, SEEK_END); + if (histfsize > MKSH_MAXHISTFSIZE || hs == hist_init_restore) { + /* we ignore too large files but still append to them */ + /* we also don't need to re-read after truncation */ + goto hist_init_tail; + } else if (histfsize > 2) { + /* we have some data, check its validity */ + base = (void *)mmap(NULL, (size_t)histfsize, PROT_READ, MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); - /* - * check on its validity - */ - if (base == (unsigned char *)MAP_FAILED || - *base != HMAGIC1 || base[1] != HMAGIC2) { - if (base != (unsigned char *)MAP_FAILED) - munmap(caddr_cast(base), hsize); + if (base == (unsigned char *)MAP_FAILED) + goto hist_init_fail; + if (base[0] != HMAGIC1 || base[1] != HMAGIC2) { + munmap(caddr_cast(base), (size_t)histfsize); + goto hist_init_fail; + } + /* load _all_ data */ + lines = histload(hist_source, base + 2, (size_t)histfsize - 2); + munmap(caddr_cast(base), (size_t)histfsize); + /* check if the file needs to be truncated */ + if (lines > histsize && histptr >= history) { + /* you're fucked up with the current code, trust me */ + char *nhname, **hp; + struct stat sb; + + /* create temporary file */ + nhname = shf_smprintf("%s.%d", hname, (int)procpid); + if ((fd = open(nhname, O_RDWR | O_CREAT | O_TRUNC | + O_EXCL, 0600)) < 0) { + /* just don't truncate then, meh. */ + goto hist_trunc_dont; + } + if (fstat(histfd, &sb) >= 0 && + chown(nhname, sb.st_uid, sb.st_gid)) { + /* abort the truncation then, meh. */ + goto hist_trunc_abort; + } + /* we definitively want some magic in that file */ + if (write(fd, sprinkle, 2) != 2) + goto hist_trunc_abort; + /* and of course the entries */ + hp = history; + while (hp < histptr) { + if (!writehistline(fd, + s->line - (histptr - hp), *hp)) + goto hist_trunc_abort; + ++hp; + } + /* now unlock, close both, rename, rinse, repeat */ + close(fd); + fd = -1; hist_finish(); - if (unlink(hname) /* fails */) - goto hiniterr; + if (rename(nhname, hname) < 0) { + hist_trunc_abort: + if (fd != -1) + close(fd); + unlink(nhname); + if (fd != -1) + goto hist_trunc_dont; + /* darn! restore histfd and pray */ + } + hs = hist_init_restore; + hist_trunc_dont: + afree(nhname, ATEMP); + if (hs == hist_init_restore) + goto retry; + } + } else if (histfsize != 0) { + /* negative or too small... */ + hist_init_fail: + /* ... or mmap failed or illegal */ + hist_finish(); + /* nuke the bogus file then retry, at most once */ + if (!unlink(hname) && hs != hist_init_retry) { + hs = hist_init_retry; goto retry; } - if (hsize > 2) { - lines = hist_count_lines(base+2, hsize-2); - if (lines > histsize) { - /* we need to make the file smaller */ - if (hist_shrink(base, hsize)) - rv = unlink(hname); - munmap(caddr_cast(base), hsize); - hist_finish(); - if (rv) { - hiniterr: - bi_errorf("can't %s %s: %s", - "unlink HISTFILE", hname, - strerror(errno)); - hsize = 0; - return; - } - goto retry; - } + if (hs != hist_init_retry) + bi_errorf("can't %s %s: %s", + "unlink HISTFILE", hname, strerror(errno)); + histfsize = 0; + return; + } else { + /* size 0, add magic to the history file */ + if (write(histfd, sprinkle, 2) != 2) { + hist_finish(); + return; } - histload(hist_source, base+2, hsize-2); - munmap(caddr_cast(base), hsize); } + histfsize = lseek(histfd, (off_t)0, SEEK_END); + hist_init_tail: (void)flock(histfd, LOCK_UN); - hfsize = lseek(histfd, (off_t)0, SEEK_END); - hsize = 1024 * 1048576; - if (hfsize < (off_t)hsize) - hsize = hfsize; #endif } #if HAVE_PERSISTENT_HISTORY -typedef enum state { - /* expecting a header */ - shdr, - /* looking for a NUL byte to end the line */ - sline, - /* bytes 1 to 4 of a line number */ - sn1, sn2, sn3, sn4 -} State; - -static int -hist_count_lines(unsigned char *base, int bytes) -{ - State state = shdr; - int lines = 0; - - while (bytes--) { - switch (state) { - case shdr: - if (*base == COMMAND) - state = sn1; - break; - case sn1: - state = sn2; break; - case sn2: - state = sn3; break; - case sn3: - state = sn4; break; - case sn4: - state = sline; break; - case sline: - if (*base == '\0') { - lines++; - state = shdr; - } - } - base++; - } - return (lines); -} - /* - * Shrink the history file to HISTSIZE lines + * load the history structure from the stored data */ static int -hist_shrink(unsigned char *oldbase, int oldbytes) -{ - int fd, rv = 0; - char *nfile = NULL; - struct stat statb; - unsigned char *nbase = oldbase; - int nbytes = oldbytes; - - nbase = hist_skip_back(nbase, &nbytes, histsize); - if (nbase == NULL) - return (1); - if (nbase == oldbase) - return (0); - - /* - * create temp file - */ - nfile = shf_smprintf("%s.%d", hname, (int)procpid); - if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0) - goto errout; - if (fstat(histfd, &statb) >= 0 && - chown(nfile, statb.st_uid, statb.st_gid)) - goto errout; - - if (sprinkle(fd) || write(fd, nbase, nbytes) != nbytes) - goto errout; - close(fd); - fd = -1; - - /* - * rename - */ - if (rename(nfile, hname) < 0) { - errout: - if (fd >= 0) { - close(fd); - if (nfile) - unlink(nfile); - } - rv = 1; - } - afree(nfile, ATEMP); - return (rv); -} - -/* - * find a pointer to the data 'no' back from the end of the file; - * return the pointer and the number of bytes left - */ -static unsigned char * -hist_skip_back(unsigned char *base, int *bytes, int no) +histload(Source *s, unsigned char *base, size_t bytes) { - int lines = 0; - unsigned char *ep; - - for (ep = base + *bytes; --ep > base; ) { - /* - * this doesn't really work: the 4 byte line number that - * is encoded after the COMMAND byte can itself contain - * the COMMAND byte... - */ - for (; ep > base && *ep != COMMAND; ep--) - ; - if (ep == base) - break; - if (++lines == no) { - *bytes = *bytes - ((char *)ep - (char *)base); - return (ep); - } - } - return (NULL); -} + int lno = 0, lines = 0; + unsigned char *cp; -/* - * load the history structure from the stored data - */ -static void -histload(Source *s, unsigned char *base, int bytes) -{ - State state; - int lno = 0; - unsigned char *line = NULL; - - for (state = shdr; bytes-- > 0; base++) { - switch (state) { - case shdr: - if (*base == COMMAND) - state = sn1; - break; - case sn1: - lno = (((*base) & 0xFF) << 24); - state = sn2; - break; - case sn2: - lno |= (((*base) & 0xFF) << 16); - state = sn3; - break; - case sn3: - lno |= (((*base) & 0xFF) << 8); - state = sn4; - break; - case sn4: - lno |= (*base) & 0xFF; - line = base + 1; - state = sline; - break; - case sline: - if (*base == '\0') { - /* worry about line numbers */ - if (histptr >= history && lno-1 != s->line) { - /* a replacement? */ - histinsert(s, lno, (char *)line); - } else { - s->line = lno--; - histsave(&lno, (char *)line, false, - false); - } - state = shdr; - } + histload_loop: + /* !bytes check as some systems (older FreeBSDs) have buggy memchr */ + if (!bytes || (cp = memchr(base, COMMAND, bytes)) == NULL) + return (lines); + /* advance base pointer past COMMAND byte */ + bytes -= ++cp - base; + base = cp; + /* if there is no full string left, don't bother with the rest */ + if (bytes < 5 || (cp = memchr(base + 4, '\0', bytes - 4)) == NULL) + return (lines); + /* load the stored line number */ + lno = ((base[0] & 0xFF) << 24) | ((base[1] & 0xFF) << 16) | + ((base[2] & 0xFF) << 8) | (base[3] & 0xFF); + /* store away the found line (@base[4]) */ + ++lines; + if (histptr >= history && lno - 1 != s->line) { + /* a replacement? */ + char **hp; + + if (lno >= s->line - (histptr - history) && lno <= s->line) { + hp = &histptr[lno - s->line]; + if (*hp) + afree(*hp, APERM); + strdupx(*hp, (char *)(base + 4), APERM); } + } else { + s->line = lno--; + histsave(&lno, (char *)(base + 4), false, false); } -} - -/* - * Insert a line into the history at a specified number - */ -static void -histinsert(Source *s, int lno, const char *line) -{ - char **hp; - - if (lno >= s->line - (histptr - history) && lno <= s->line) { - hp = &histptr[lno - s->line]; - if (*hp) - afree(*hp, APERM); - strdupx(*hp, line, APERM); - } + /* advance base pointer past NUL */ + bytes -= ++cp - base; + base = cp; + /* repeat until no more */ + goto histload_loop; } /* @@ -979,65 +874,65 @@ * we should (re)read those commands to update our history */ static void -writehistfile(int lno, char *cmd) +writehistfile(int lno, const char *cmd) { off_t sizenow; - ssize_t bytes; - unsigned char *base, *news, hdr[5]; + size_t bytes; + unsigned char *base, *news; (void)flock(histfd, LOCK_EX); sizenow = lseek(histfd, (off_t)0, SEEK_END); - if ((sizenow <= (1024 * 1048576)) && ((size_t)sizenow != hsize)) { - /* - * Things have changed - */ - if ((size_t)sizenow > hsize) { - /* someone has added some lines */ - bytes = (size_t)sizenow - hsize; - base = (void *)mmap(NULL, (size_t)sizenow, PROT_READ, - MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); - if (base == (unsigned char *)MAP_FAILED) - goto bad; - news = base + hsize; - if (*news != COMMAND) { - munmap(caddr_cast(base), (size_t)sizenow); - goto bad; - } + if (sizenow < histfsize) { + /* the file has shrunk; give up */ + goto bad; + } + if ( + /* ignore changes when the file is too large */ + sizenow <= MKSH_MAXHISTFSIZE + && + /* the size has changed, we need to do read updates */ + sizenow > histfsize + ) { + /* both sizenow and histfsize are <= MKSH_MAXHISTFSIZE */ + bytes = (size_t)(sizenow - histfsize); + base = (void *)mmap(NULL, (size_t)sizenow, PROT_READ, + MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); + if (base == (unsigned char *)MAP_FAILED) + goto bad; + news = base + (size_t)histfsize; + if (*news == COMMAND) { hist_source->line--; histload(hist_source, news, bytes); hist_source->line++; lno = hist_source->line; - munmap(caddr_cast(base), (size_t)sizenow); - hsize = (size_t)sizenow; - } else { - /* it has shrunk */ - /* but to what? */ - /* we'll give up for now */ + } else + bytes = 0; + munmap(caddr_cast(base), (size_t)sizenow); + if (!bytes) goto bad; - } } - if (cmd) { - /* - * we can write our bit now - */ - hdr[0] = COMMAND; - hdr[1] = (lno >> 24) & 0xFF; - hdr[2] = (lno >> 16) & 0xFF; - hdr[3] = (lno >> 8) & 0xFF; - hdr[4] = lno & 0xFF; - bytes = strlen(cmd) + 1; - if ((write(histfd, hdr, 5) != 5) || - (write(histfd, cmd, bytes) != bytes)) - goto bad; - sizenow = lseek(histfd, (off_t)0, SEEK_END); - hsize = 1024 * 1048576; - if (sizenow < (off_t)hsize) - hsize = (size_t)sizenow; + if (cmd && !writehistline(histfd, lno, cmd)) { + bad: + hist_finish(); + return; } + histfsize = lseek(histfd, (off_t)0, SEEK_END); (void)flock(histfd, LOCK_UN); - return; - bad: - hist_finish(); +} + +static int +writehistline(int fd, int lno, const char *cmd) +{ + ssize_t n; + unsigned char hdr[5]; + + hdr[0] = COMMAND; + hdr[1] = (lno >> 24) & 0xFF; + hdr[2] = (lno >> 16) & 0xFF; + hdr[3] = (lno >> 8) & 0xFF; + hdr[4] = lno & 0xFF; + n = strlen(cmd) + 1; + return (write(fd, hdr, 5) == 5 && write(fd, cmd, n) == n); } void @@ -1045,21 +940,11 @@ { (void)flock(histfd, LOCK_UN); (void)close(histfd); - histfd = 0; -} - -/* - * add magic to the history file - */ -static int -sprinkle(int fd) -{ - static const unsigned char mag[] = { HMAGIC1, HMAGIC2 }; - - return (write(fd, mag, 2) != 2); + histfd = -1; } #endif + #if !HAVE_SYS_SIGNAME static const struct mksh_sigpair { const char *const name; --- mksh-40.4.orig/syn.c +++ mksh-40.4/syn.c @@ -1,7 +1,8 @@ /* $OpenBSD: syn.c,v 1.28 2008/07/23 16:34:38 jaredy Exp $ */ /*- - * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 + * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, + * 2011, 2012 * Thorsten Glaser * * Provided that these terms and disclaimer and all copyright notices @@ -22,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.71 2011/11/22 18:01:41 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.73 2012/01/03 15:32:08 tg Exp $"); extern short subshell_nesting_level; extern void yyskiputf8bom(void); @@ -64,6 +65,7 @@ static bool reject; /* token(cf) gets symbol again */ static int symbol; /* yylex value */ +static int sALIAS = ALIAS; /* 0 in yyrecursive */ #define REJECT (reject = true) #define ACCEPT (reject = false) @@ -227,7 +229,7 @@ nesting_push(&old_nesting, smark); t = c_list(true); - musthave(emark, KEYWORD|ALIAS); + musthave(emark, KEYWORD|sALIAS); nesting_pop(&old_nesting); return (block(type, t, NOBLOCK, NOWORDS)); } @@ -260,8 +262,8 @@ XPinit(args, 16); XPinit(vars, 16); - syniocf = KEYWORD|ALIAS; - switch (c = token(cf|KEYWORD|ALIAS|VARASN)) { + syniocf = KEYWORD|sALIAS; + switch (c = token(cf|KEYWORD|sALIAS|VARASN)) { default: REJECT; afree(iops, ATEMP); @@ -273,12 +275,12 @@ case LWORD: case REDIR: REJECT; - syniocf &= ~(KEYWORD|ALIAS); + syniocf &= ~(KEYWORD|sALIAS); t = newtp(TCOM); t->lineno = source->line; while (/* CONSTCOND */ 1) { cf = (t->u.evalflags ? ARRAYVAR : 0) | - (XPsize(args) == 0 ? ALIAS|VARASN : CMDWORD); + (XPsize(args) == 0 ? sALIAS|VARASN : CMDWORD); switch (tpeek(cf)) { case REDIR: while ((iop = synio(cf)) != NULL) { @@ -442,12 +444,12 @@ t = newtp(TIF); t->left = c_list(true); t->right = thenpart(); - musthave(FI, KEYWORD|ALIAS); + musthave(FI, KEYWORD|sALIAS); nesting_pop(&old_nesting); break; case BANG: - syniocf &= ~(KEYWORD|ALIAS); + syniocf &= ~(KEYWORD|sALIAS); t = pipeline(0); if (t == NULL) syntaxerr(NULL); @@ -455,9 +457,9 @@ break; case TIME: - syniocf &= ~(KEYWORD|ALIAS); + syniocf &= ~(KEYWORD|sALIAS); t = pipeline(0); - if (t) { + if (t && t->type == TCOM) { t->str = alloc(2, ATEMP); /* TF_* flags */ t->str[0] = '\0'; @@ -506,7 +508,7 @@ int c; struct op *list; - c = token(CONTIN|KEYWORD|ALIAS); + c = token(CONTIN|KEYWORD|sALIAS); /* * A {...} can be used instead of do...done for for/select loops * but not for while/until loops - we don't need to check if it @@ -520,7 +522,7 @@ else syntaxerr(NULL); list = c_list(true); - musthave(c, KEYWORD|ALIAS); + musthave(c, KEYWORD|sALIAS); return (list); } @@ -529,7 +531,7 @@ { struct op *t; - musthave(THEN, KEYWORD|ALIAS); + musthave(THEN, KEYWORD|sALIAS); t = newtp(0); t->left = c_list(true); if (t->left == NULL) @@ -543,7 +545,7 @@ { struct op *t; - switch (token(KEYWORD|ALIAS|VARASN)) { + switch (token(KEYWORD|sALIAS|VARASN)) { case ELSE: if ((t = c_list(true)) == NULL) syntaxerr(NULL); @@ -567,7 +569,7 @@ struct op *t, *tl; int c; - c = token(CONTIN|KEYWORD|ALIAS); + c = token(CONTIN|KEYWORD|sALIAS); /* A {...} can be used instead of in...esac for case statements */ if (c == IN) c = ESAC; @@ -584,7 +586,7 @@ else tl->right = tc, tl = tc; } - musthave(c, KEYWORD|ALIAS); + musthave(c, KEYWORD|sALIAS); return (t); } @@ -613,7 +615,7 @@ /* initialise to default for ;; or omitted */ t->u.charflag = ';'; /* SUSv4 requires the ;; except in the last casepart */ - if ((tpeek(CONTIN|KEYWORD|ALIAS)) != endtok) + if ((tpeek(CONTIN|KEYWORD|sALIAS)) != endtok) switch (symbol) { default: syntaxerr(NULL); @@ -659,14 +661,14 @@ * only accepts an open-brace. */ if (ksh_func) { - if (tpeek(CONTIN|KEYWORD|ALIAS) == '(' /*)*/) { + if (tpeek(CONTIN|KEYWORD|sALIAS) == '(' /*)*/) { /* function foo () { */ ACCEPT; musthave(')', 0); /* degrade to POSIX function */ ksh_func = false; } - musthave('{' /*}*/, CONTIN|KEYWORD|ALIAS); + musthave('{' /*}*/, CONTIN|KEYWORD|sALIAS); REJECT; } @@ -711,7 +713,7 @@ XPinit(args, 16); /* POSIX does not do alias expansion here... */ - if ((c = token(CONTIN|KEYWORD|ALIAS)) != IN) { + if ((c = token(CONTIN|KEYWORD|sALIAS)) != IN) { if (c != ';') /* non-POSIX, but AT&T ksh accepts a ; here */ REJECT; @@ -1107,7 +1109,7 @@ struct op *t; char *cp; bool old_reject; - int old_symbol; + int old_symbol, old_salias; struct ioword **old_herep; /* tell the lexer to accept a closing parenthesis as EOD */ @@ -1118,8 +1120,11 @@ old_symbol = symbol; ACCEPT; old_herep = herep; + old_salias = sALIAS; + sALIAS = 0; /* we use TPAREN as a helper container here */ t = nested(TPAREN, '(', ')'); + sALIAS = old_salias; herep = old_herep; reject = old_reject; symbol = old_symbol; --- mksh-40.4.orig/tree.c +++ mksh-40.4/tree.c @@ -1,7 +1,8 @@ /* $OpenBSD: tree.c,v 1.19 2008/08/11 21:50:35 jaredy Exp $ */ /*- - * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + * 2011, 2012 * Thorsten Glaser * * Provided that these terms and disclaimer and all copyright notices @@ -22,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.52 2011/10/25 22:36:39 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.52.4.2 2012/02/11 15:25:36 tg Exp $"); #define INDENT 8 @@ -133,25 +134,26 @@ #endif case TIF: i = 2; + t1 = t; goto process_TIF; do { - t = t->right; + t1 = t1->right; i = 0; fptreef(shf, indent, "%;"); process_TIF: /* 5 == strlen("elif ") */ - fptreef(shf, indent + 5 - i, "elif %T" + i, t->left); - t = t->right; - if (t->left != NULL) { + fptreef(shf, indent + 5 - i, "elif %T" + i, t1->left); + t1 = t1->right; + if (t1->left != NULL) { fptreef(shf, indent, "%;"); fptreef(shf, indent + INDENT, "%s%N%T", - "then", t->left); + "then", t1->left); } - } while (t->right && t->right->type == TELIF); - if (t->right != NULL) { + } while (t1->right && t1->right->type == TELIF); + if (t1->right != NULL) { fptreef(shf, indent, "%;"); fptreef(shf, indent + INDENT, "%s%N%T", - "else", t->right); + "else", t1->right); } fptreef(shf, indent, "%;fi "); break; @@ -711,24 +713,42 @@ void vistree(char *dst, size_t sz, struct op *t) { - int c; + unsigned int c; char *cp, *buf; + size_t n; - buf = alloc(sz, ATEMP); - snptreef(buf, sz, "%T", t); + buf = alloc(sz + 8, ATEMP); + snptreef(buf, sz + 8, "%T", t); cp = buf; - while ((c = *cp++)) { - if (((c & 0x60) == 0) || ((c & 0x7F) == 0x7F)) { - /* C0 or C1 control character or DEL */ - if (!--sz) - break; - *dst++ = (c & 0x80) ? '$' : '^'; - c = (c & 0x7F) ^ 0x40; - } - if (!--sz) - break; - *dst++ = c; + vist_loop: + if (UTFMODE && (n = utf_mbtowc(&c, cp)) != (size_t)-1) { + if (c == 0 || n >= sz) + /* NUL or not enough free space */ + goto vist_out; + /* copy multibyte char */ + sz -= n; + while (n--) + *dst++ = *cp++; + goto vist_loop; + } + if (--sz == 0 || (c = (unsigned char)(*cp++)) == 0) + /* NUL or not enough free space */ + goto vist_out; + if ((c & 0x60) == 0 || (c & 0x7F) == 0x7F) { + /* C0 or C1 control character or DEL */ + if (--sz == 0) + /* not enough free space for two chars */ + goto vist_out; + *dst++ = (c & 0x80) ? '$' : '^'; + c = (c & 0x7F) ^ 0x40; + } else if (UTFMODE && c > 0x7F) { + /* better not try to display broken multibyte chars */ + c = '?'; } + *dst++ = c; + goto vist_loop; + + vist_out: *dst = '\0'; afree(buf, ATEMP); } --- mksh-40.4.orig/sh.h +++ mksh-40.4/sh.h @@ -9,7 +9,8 @@ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /*- - * Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + * 2011, 2012 * Thorsten Glaser * * Provided that these terms and disclaimer and all copyright notices @@ -151,18 +152,28 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.484.2.11 2011/12/11 18:18:28 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.484.2.14 2012/02/11 15:25:33 tg Exp $"); #endif -#define MKSH_VERSION "R40 2011/12/11" +#define MKSH_VERSION "R40 2012/02/11" -/* arithmetics types */ +/* arithmetic types: C implementation */ +#if !HAVE_CAN_INTTYPES +#if !HAVE_CAN_UCBINTS +typedef signed int int32_t; +typedef unsigned int uint32_t; +#else +typedef u_int32_t uint32_t; +#endif +#endif + +/* arithmetic types: shell arithmetics */ typedef int32_t mksh_ari_t; typedef uint32_t mksh_uari_t; /* boolean type (no deliberately) */ typedef unsigned char mksh_bool; #undef bool -/* false MUST equal 0 */ +/* false MUST equal the same 0 as written by static storage initialisation */ #undef false #undef true /* access macros for boolean type */ @@ -173,6 +184,26 @@ /* make any-type into bool or short */ #define tobool(cond) ((cond) ? true : false) +/* char (octet) type: C implementation */ +#if !HAVE_CAN_INT8TYPE +#if !HAVE_CAN_UCBINT8 +typedef unsigned char uint8_t; +#else +typedef u_int8_t uint8_t; +#endif +#endif + +/* other standard types */ + +#if !HAVE_RLIM_T +typedef long rlim_t; +#endif + +#if !HAVE_SIG_T +#undef sig_t +typedef void (*sig_t)(int); +#endif + #ifndef MKSH_INCLUDES_ONLY /* extra types */ @@ -191,32 +222,6 @@ }; #endif -#if !HAVE_RLIM_T -typedef long rlim_t; -#endif - -#if !HAVE_SIG_T -#undef sig_t -typedef void (*sig_t)(int); -#endif - -#if !HAVE_CAN_INTTYPES -#if !HAVE_CAN_UCBINTS -typedef signed int int32_t; -typedef unsigned int uint32_t; -#else -typedef u_int32_t uint32_t; -#endif -#endif - -#if !HAVE_CAN_INT8TYPE -#if !HAVE_CAN_UCBINT8 -typedef unsigned char uint8_t; -#else -typedef u_int8_t uint8_t; -#endif -#endif - /* extra macros */ #ifndef timerclear @@ -1448,11 +1453,9 @@ EXTERN struct ioword *heres[HERES], **herep; EXTERN char ident[IDENT+1]; -#define HISTORYSIZE 500 /* size of saved history */ - -EXTERN char **history; /* saved commands */ -EXTERN char **histptr; /* last history item */ -EXTERN int histsize; /* history size */ +EXTERN char **history; /* saved commands */ +EXTERN char **histptr; /* last history item */ +EXTERN mksh_ari_t histsize; /* history size */ /* user and system time of last j_waitjed job */ EXTERN struct timeval j_usrtime, j_systime; @@ -1607,12 +1610,14 @@ bool histsync(void); #endif int c_fc(const char **); -void sethistsize(int); +void sethistsize(mksh_ari_t); #if HAVE_PERSISTENT_HISTORY void sethistfile(const char *); #endif +#if !MKSH_S_NOVI char **histpos(void); int histnum(int); +#endif int findhist(int, int, const char *, int); char **hist_get_newest(bool); void inittraps(void); @@ -1798,6 +1803,7 @@ void dumpchar(struct shf *, int); void dumptree(struct shf *, struct op *); void dumpwdvar(struct shf *, const char *); +void dumpioact(struct shf *shf, struct op *t); void vistree(char *, size_t, struct op *) MKSH_A_BOUNDED(__string__, 1, 2); void fpFUNCTf(struct shf *, int, bool, const char *, struct op *); --- mksh-40.4.orig/mksh.1 +++ mksh-40.4/mksh.1 @@ -1,4 +1,4 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.269.2.8 2011/12/11 18:18:25 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.269.2.9 2011/12/31 02:25:29 tg Exp $ .\" $OpenBSD: ksh.1,v 1.141 2011/09/03 22:59:08 jmc Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -72,7 +72,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 11 2011 $ +.Dd $Mdocdate: December 31 2011 $ .\" .\" Check which macro package we use .\" @@ -1618,7 +1618,8 @@ The internal hash of the expansion of .Ar name . At the moment, this is OAAT1 (Bob Jenkins' one-at-a-time hash with -an initialisation value of 0x00000100), this will change for R41. +an initialisation value of 0x00000100), this will change for R41, +which will also introduce an explicit initial value. This is the hash the shell uses internally for its associative arrays. .El .Pp --- mksh-40.4.orig/Build.sh +++ mksh-40.4/Build.sh @@ -1,7 +1,8 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.484.2.7 2011/12/11 18:18:18 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.484.2.10 2012/02/11 15:25:26 tg Exp $' #- -# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 # Thorsten Glaser # # Provided that these terms and disclaimer and all copyright notices @@ -147,7 +148,7 @@ } # pipe .c | ac_test[n] [!] label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput -ac_testn() { +ac_testnnd() { if test x"$1" = x"!"; then fr=1 shift @@ -173,6 +174,9 @@ test $ct = sunpro && vscan='-e ignored -e turned.off' fi test -n "$vscan" && grep $vscan vv.out >/dev/null 2>&1 && fv=$fr +} +ac_testn() { + ac_testnnd "$@" rmf conftest.c conftest.o ${tcfn}* vv.out ac_testdone } @@ -452,7 +456,7 @@ esac ;; Haiku) - add_cppflags -DMKSH_ASSUME_UTF8 + add_cppflags -DMKSH_ASSUME_UTF8; HAVE_ISSET_MKSH_ASSUME_UTF8=1 ;; HP-UX) ;; @@ -487,6 +491,7 @@ MirBSD) ;; MSYS_*) + add_cppflags -DMKSH_ASSUME_UTF8=0; HAVE_ISSET_MKSH_ASSUME_UTF8=1 # almost same as CYGWIN* (from RT|Chatzilla) : ${HAVE_SETLOCALE_CTYPE=0} # broken on this OE (from ir0nh34d) @@ -510,7 +515,7 @@ add_cppflags -D_LIMITS_EXTENSION add_cppflags -D_BSD_EXTENSION add_cppflags -D_SUSV2_SOURCE - add_cppflags -DMKSH_ASSUME_UTF8 + add_cppflags -DMKSH_ASSUME_UTF8; HAVE_ISSET_MKSH_ASSUME_UTF8=1 oswarn=' and will currently not work' add_cppflags -DMKSH_UNEMPLOYED ;; @@ -686,8 +691,9 @@ clang) # does not work with current "ccc" compiler driver vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -version" - # this works, for now + # one of these two works, for now vv '|' "${CLANG-clang} -version" + vv '|' "${CLANG-clang} --version" # ensure compiler and linker are in sync unless overridden case $CCC_CC:$CCC_LD in :*) ;; @@ -968,13 +974,12 @@ elif test $ct = sunpro; then phase=u ac_flags 1 v -v - ac_flags 1 xc99 -xc99 'for support of ISO C99' ac_flags 1 ipo -xipo 'for cross-module optimisation' phase=x elif test $ct = hpcc; then phase=u - ac_flags 1 agcc -Agcc 'for support of GCC extensions' - ac_flags 1 ac99 -AC99 'for support of ISO C99' + # probably not needed + #ac_flags 1 agcc -Agcc 'for support of GCC extensions' phase=x elif test $ct = dec; then ac_flags 0 verb -verbose @@ -985,7 +990,6 @@ elif test $ct = bcc; then ac_flags 1 strpool "${ccpc}-d" 'if string pooling can be enabled' elif test $ct = mipspro; then - ac_flags 1 xc99 -c99 'for support of ISO C99' ac_flags 1 fullwarn -fullwarn 'for remark output support' elif test $ct = msc; then ac_flags 1 strpool "${ccpc}/GF" 'if string pooling can be enabled' @@ -997,8 +1001,6 @@ ac_flags 1 wall "${ccpc}/Wall" 'to enable all warnings' ac_flags 1 wp64 "${ccpc}/Wp64" 'to enable 64-bit warnings' elif test $ct = xlc; then - ac_flags 1 x99 -qlanglvl=extc99 - test 1 = $HAVE_CAN_X99 || ac_flags 1 c99 -qlanglvl=stdc99 ac_flags 1 rodata "-qro -qroconst -qroptr" ac_flags 1 rtcheck -qcheck=all ac_flags 1 rtchkc -qextchk @@ -1009,18 +1011,15 @@ test 1 = $HAVE_CAN_YSYSTEM && CPPFLAGS="-Ysystem $CPPFLAGS" ac_flags 1 extansi -Xa elif test $ct = tcc; then - ac_flags 1 boundschk -b + : #broken# ac_flags 1 boundschk -b elif test $ct = clang; then i=1 elif test $ct = nwcc; then i=1 - #broken# ac_flags 1 ssp -stackprotect + : #broken# ac_flags 1 ssp -stackprotect fi # flags common to a subset of compilers (run with -Werror on gcc) if test 1 = $i; then - ac_flags 1 stdg99 -std=gnu99 'for support of ISO C99 + GCC extensions' - test 1 = $HAVE_CAN_STDG99 || \ - ac_flags 1 stdc99 -std=c99 'for support of ISO C99' ac_flags 1 wall -Wall fi @@ -1179,51 +1178,6 @@ ac_header values.h # -# check whether whatever we use for the final link will succeed -# -if test $cm = makefile; then - : nothing to check -else - HAVE_LINK_WORKS=x - ac_testinit link_works '' 'checking if the final link command may succeed' - fv=1 - cat >conftest.c <<-'EOF' - #define EXTERN - #define MKSH_INCLUDES_ONLY - #include "sh.h" - __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.484.2.7 2011/12/11 18:18:18 tg Exp $"); - int main(void) { printf("Hello, World!\n"); return (0); } -EOF - case $cm in - llvm) - v "$CC $CFLAGS $CPPFLAGS $NOWARN -emit-llvm -c conftest.c" || fv=0 - rmf mksh.s - test $fv = 0 || v "llvm-link -o - conftest.o | opt $optflags | llc -o mksh.s" || fv=0 - test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr" - ;; - dragonegg) - v "$CC $CFLAGS $CPPFLAGS $NOWARN -S -flto conftest.c" || fv=0 - test $fv = 0 || v "mv conftest.s conftest.ll" - test $fv = 0 || v "llvm-as conftest.ll" || fv=0 - rmf mksh.s - test $fv = 0 || v "llvm-link -o - conftest.bc | opt $optflags | llc -o mksh.s" || fv=0 - test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr" - ;; - combine) - v "$CC $CFLAGS $CPPFLAGS $LDFLAGS -fwhole-program --combine $NOWARN -o $tcfn conftest.c $LIBS $ccpr" - ;; - lto|normal) - cm=normal - v "$CC $CFLAGS $CPPFLAGS $NOWARN -c conftest.c" || fv=0 - test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn conftest.o $LIBS $ccpr" - ;; - esac - test -f $tcfn || fv=0 - ac_testdone - test $fv = 1 || exit 1 -fi - -# # Environment: definitions # echo '#include @@ -1310,6 +1264,51 @@ ac_cppflags SIG_T # +# check whether whatever we use for the final link will succeed +# +if test $cm = makefile; then + : nothing to check +else + HAVE_LINK_WORKS=x + ac_testinit link_works '' 'checking if the final link command may succeed' + fv=1 + cat >conftest.c <<-'EOF' + #define EXTERN + #define MKSH_INCLUDES_ONLY + #include "sh.h" + __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.484.2.10 2012/02/11 15:25:26 tg Exp $"); + int main(void) { printf("Hello, World!\n"); return (0); } +EOF + case $cm in + llvm) + v "$CC $CFLAGS $CPPFLAGS $NOWARN -emit-llvm -c conftest.c" || fv=0 + rmf mksh.s + test $fv = 0 || v "llvm-link -o - conftest.o | opt $optflags | llc -o mksh.s" || fv=0 + test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr" + ;; + dragonegg) + v "$CC $CFLAGS $CPPFLAGS $NOWARN -S -flto conftest.c" || fv=0 + test $fv = 0 || v "mv conftest.s conftest.ll" + test $fv = 0 || v "llvm-as conftest.ll" || fv=0 + rmf mksh.s + test $fv = 0 || v "llvm-link -o - conftest.bc | opt $optflags | llc -o mksh.s" || fv=0 + test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn mksh.s $LIBS $ccpr" + ;; + combine) + v "$CC $CFLAGS $CPPFLAGS $LDFLAGS -fwhole-program --combine $NOWARN -o $tcfn conftest.c $LIBS $ccpr" + ;; + lto|normal) + cm=normal + v "$CC $CFLAGS $CPPFLAGS $NOWARN -c conftest.c" || fv=0 + test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn conftest.o $LIBS $ccpr" + ;; + esac + test -f $tcfn || fv=0 + ac_testdone + test $fv = 1 || exit 1 +fi + +# # Environment: signals # test x"NetBSD" = x"$TARGET_OS" && $e Ignore the compatibility warning. @@ -1507,7 +1506,7 @@ ac_cppflags save_CFLAGS=$CFLAGS -test 1 = $HAVE_CAN_WNOOVERFLOW && CFLAGS="$CFLAGS -Wno-overflow" +test x1 = x$HAVE_CAN_WNOOVERFLOW && CFLAGS="$CFLAGS -Wno-overflow" ac_testn compile_time_asserts_$$ '' 'whether compile-time assertions pass' <<-'EOF' #define MKSH_INCLUDES_ONLY #include "sh.h" @@ -1556,6 +1555,61 @@ eval test 1 = \$HAVE_COMPILE_TIME_ASSERTS_$$ || exit 1 # +# runtime checks +# once this is more than one, check if we can do runtime +# checks (not cross-compiling) first to save on warnings +# +$e "${bi}run-time checks follow$ao, please ignore any weird errors" + +ac_testnnd silent_idivwrapv '' '(run-time) whether signed integer division overflows wrap silently' <<-'EOF' + #define MKSH_INCLUDES_ONLY + #include "sh.h" + #ifdef SIGFPE + static void fpe_catcher(int) MKSH_A_NORETURN; + #endif + int main(int ac, char **av) { + mksh_ari_t o1, o2, r1, r2; + + #ifdef SIGFPE + signal(SIGFPE, fpe_catcher); + #endif + o1 = ((mksh_ari_t)1 << 31); + o2 = -ac; + r1 = o1 / o2; + r2 = o1 % o2; + if (r1 == o1 && r2 == 0) { + printf("si"); + return (0); + } + printf("no %d %d %d %d %s", o1, o2, r1, r2, av[0]); + return (1); + } + #ifdef SIGFPE + static const char fpe_msg[] = "no, got SIGFPE, what were they smoking?"; + #define fpe_msglen (sizeof(fpe_msg) - 1) + static void fpe_catcher(int sig MKSH_A_UNUSED) { + _exit(write(1, fpe_msg, fpe_msglen) == fpe_msglen ? 2 : 3); + } + #endif +EOF +if test $fv = 0; then + echo "| hrm, compiling this failed, but we will just failback" +else + echo "| running test programme; this will fail if cross-compiling" + echo "| in which case we will gracefully degrade to the default" + ./$tcfn >vv.out 2>&1 + rv=$? + echo "| result: `cat vv.out`" + fv=0 + test $rv = 0 && test x"`cat vv.out`" = x"si" && fv=1 +fi +rmf conftest.c conftest.o ${tcfn}* vv.out +ac_testdone +ac_cppflags + +$e "${bi}end of run-time checks$ao" + +# # Compiler: Praeprocessor (only if needed) # test 0 = $HAVE_SYS_SIGNAME && if ac_testinit cpp_dd '' \ @@ -1643,15 +1697,19 @@ files= objs= sp= +case $tcfn in +a.exe) mkshexe=mksh.exe ;; +*) mkshexe=mksh ;; +esac case $curdir in -*\ *) echo "#!./mksh" >test.sh ;; -*) echo "#!$curdir/mksh" >test.sh ;; +*\ *) echo "#!./$mkshexe" >test.sh ;; +*) echo "#!$curdir/$mkshexe" >test.sh ;; esac cat >>test.sh <<-EOF LC_ALL=C PATH='$PATH'; export LC_ALL PATH test -n "\$KSH_VERSION" || exit 1 set -A check_categories -- $check_categories - pflag='$curdir/mksh' + pflag='$curdir/$mkshexe' sflag='$srcdir/check.t' usee=0 Pflag=0 uset=0 vflag=0 xflag=0 while getopts "C:e:fPp:s:t:v" ch; do case \$ch { @@ -1747,10 +1805,6 @@ lobjs=$objs ;; esac -case $tcfn in -a.exe) mkshexe=mksh.exe ;; -*) mkshexe=mksh ;; -esac echo tcfn=$mkshexe >>Rebuild.sh echo "$CC $CFLAGS $LDFLAGS -o \$tcfn $lobjs $LIBS $ccpr" >>Rebuild.sh echo 'test -f $tcfn || exit 1; size $tcfn' >>Rebuild.sh --- mksh-40.4.orig/var.c +++ mksh-40.4/var.c @@ -26,7 +26,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/var.c,v 1.130.2.6 2011/12/11 18:18:30 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/var.c,v 1.130.2.7 2011/12/31 02:25:36 tg Exp $"); /*- * Variables @@ -709,7 +709,6 @@ if (val == var) return (NULL); mkssert(var != NULL); - mkssert(*var != 0); if (*val == '[') { if (set_refflag != SRF_NOP) errorf("%s: %s", var, @@ -1220,7 +1219,7 @@ getopts_reset((int)i); break; case V_HISTSIZE: - sethistsize((int)i); + sethistsize(i); break; case V_COLUMNS: if (i >= MIN_COLS) --- mksh-40.4.orig/jobs.c +++ mksh-40.4/jobs.c @@ -1,7 +1,7 @@ /* $OpenBSD: jobs.c,v 1.38 2009/12/12 04:28:44 deraadt Exp $ */ /*- - * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 + * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 * Thorsten Glaser * * Provided that these terms and disclaimer and all copyright notices @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.81 2011/08/27 18:06:46 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.84 2012/02/06 17:49:52 tg Exp $"); #if HAVE_KILLPG #define mksh_killpg killpg @@ -37,13 +37,15 @@ #define PSIGNALLED 2 #define PSTOPPED 3 -typedef struct proc Proc; +typedef struct proc Proc; struct proc { Proc *next; /* next process in pipeline (if any) */ pid_t pid; /* process id */ int state; int status; /* wait status */ - char command[48]; /* process command string */ + /* process command string from vistree */ + char command[64 - (ALLOC_SIZE + sizeof(Proc *) + sizeof(pid_t) + + 2 * sizeof(int))]; }; /* Notify/print flag - j_print() argument */ @@ -1491,6 +1493,8 @@ strlcpy(buf, sigtraps[WTERMSIG(p->status)].mess, sizeof(buf)); break; + default: + buf[0] = '\0'; } if (how != JP_SHORT) { --- mksh-40.4.orig/edit.c +++ mksh-40.4/edit.c @@ -25,7 +25,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.225 2011/12/11 18:07:45 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.226 2011/12/29 23:36:10 tg Exp $"); /* * in later versions we might use libtermcap for this, but since external @@ -624,6 +624,10 @@ prefix_len = j; break; } + /* false for nwords==1 as 0 = words[0][prefix_len] then */ + if (UTFMODE && prefix_len && (words[0][prefix_len] & 0xC0) == 0x80) + while (prefix_len && (words[0][prefix_len] & 0xC0) != 0xC0) + --prefix_len; return (prefix_len); } --- mksh-40.4.orig/expr.c +++ mksh-40.4/expr.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.51 2011/12/11 01:56:43 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.51.2.1 2011/12/31 02:25:28 tg Exp $"); /* The order of these enums is constrained by the order of opinfo[] */ enum token { @@ -347,7 +347,8 @@ /* vl may not have a value yet */ vl = intvar(es, vl); if (IS_ASSIGNOP(op)) { - assign_check(es, op, vasn); + if (!es->noassign) + assign_check(es, op, vasn); vr = intvar(es, evalexpr(es, P_ASSIGN)); } else if (op != O_TERN && op != O_LAND && op != O_LOR) vr = intvar(es, evalexpr(es, prec - 1)); @@ -365,21 +366,25 @@ break; case O_DIV: case O_DIVASN: +#if !HAVE_SILENT_IDIVWRAPV if (!es->natural && vr->val.i == -1 && vl->val.i == ((mksh_ari_t)1 << 31)) { /* -2147483648 / -1 = 2147483648 */ /* 80000000 / FFFFFFFF = 80000000 */ res = ((mksh_ari_t)1 << 31); } else +#endif res = bivui(vl, /, vr); break; case O_MOD: case O_MODASN: +#if !HAVE_SILENT_IDIVWRAPV if (!es->natural && vr->val.i == -1 && vl->val.i == ((mksh_ari_t)1 << 31)) { /* -2147483648 % -1 = 0 */ res = 0; } else +#endif res = bivui(vl, %, vr); break; case O_PLUS: @@ -609,7 +614,8 @@ setint_v(vasn, vl, es->arith); else setint(vasn, vl->val.i); - if (!is_prefix) /* undo the inc/dec */ + if (!is_prefix) + /* undo the increment/decrement */ vl->val.i = oval; return (vl); --- mksh-40.4.orig/debian/compat +++ mksh-40.4/debian/compat @@ -0,0 +1 @@ +5 --- mksh-40.4.orig/debian/changelog +++ mksh-40.4/debian/changelog @@ -0,0 +1,2222 @@ +mksh (40.4-3) unstable; urgency=low + + * The “sleepy” upload + * Several fixes for klibc support: + - dpkg-buildflags adds -fstack-protector, klibc doesn’t like it + - on m68k, klibc builds need -g or they croak + - unbreak overriding which toolchains are used for mksh-static + * Patch up to mksh R40-stable branch of today: + - [tg, RT] Move mirtoconf checks and INCLUDES_ONLY parts of sh.h + around to ensure prerequisites are always available + - [tg, RT, ir0nh34d] Pass mksh.exe to testsuite, if such thing is + generated, and deal with Cygwin passing just “mksh” in argv[0] in + such cases + - [tg] Imply -DMKSH_ASSUME_UTF8=0 on MSYS; optimise checks + - [tg, Jb_boin] Fix regression introduced in R35b by jaredy’s + security patch where TTIME trashed a non-TCOM string argument + (e.g. in TFOR) + - [tg] Better support for tcc; fix GCCism that accidentally crept in + - [tg] Deal with UTF-8 when reporting jobs’ commands + * Omit dietlibc and don’t depend on lsb-release on hppa, to give + it some chances to catch up (and mark for revisiting) + * Note that mksh-static has some features disabled in the package + description (unless DEB_BUILD_OPTIONS contains nomksh-small) + ‣ do we want to have a dynamically generated binary package desc? + * Copyright year is now 2012 + + -- Thorsten Glaser Sat, 11 Feb 2012 16:59:31 +0000 + +mksh (40.4-2) unstable; urgency=high + + * The “busy” upload + * Patch up to mksh R40-stable branch of today: + - [tg, Jilles Tjoelker] skip readonly check in unevaluated ternary twig + - [tg, anonymous] fix all remaining ifs.sh testcases + - [tg] No longer try to build with GCC and C99 extensions + - [tg, Jilles Tjoelker] Do not expand aliases in COMSUB twice + - [tg] Honour UTF-8 multi-byte character boundaries when doing partial + tab-completion insertions (LP: #909025) to fix RedHat BZ#745702 + - [tg] Fix R40 (BZ#496791) regression with IOACT in TIF (LP: #907224) + - [tg, ft] Darn persistent history code worst offenders (LP: #906914) + - [tg] Fix some gc-sections, GCC and Clang/scan-build warnings/issues + - [tg, 28C3] dot.mkshrc hash functions: partially address LP: #909818 + - [tg] Only compile divmod(0x80000000, -1) code in when not unneeded + * Merge from the squeeze and lenny-hardy backport packages: + - The “dreaming of aufsbuilder” upload + + Document that, even in all backports, the debconf questions for + /bin/sh handling are now gone + - The “motivated” upload + + d/control: lsb-release is only needed on hppa at the moment + + d/README.Debian: rework note on /bin/sh use for backports + * Urgency high due to the severity of the assorted bugfixes + + -- Thorsten Glaser Sat, 31 Dec 2011 02:53:56 +0000 + +mksh (40.4-1) unstable; urgency=low + + * The “not-so-little-any-more brother” upload + * Update to mksh R40d (release): + - [tg, Jilles Tjoelker] test(1) built-in behaves exactly as POSIX says + - [tg] Move compile-time assertions to Build.sh from misc.c#ifdef DEBUG + - [tg] Invocation documentation is at the bottom of Build.sh + - [tg] test.sh: verbosely look for perl(1) interpreter to use + - [tg] New tests for integers (base 1‥36, base unspecified, base OOB) + - [tg] Correct error paths for typeset -n global state + - [tg] Deprecate interpreting "010" as octal number, will go + - [tg] Improvements re. integer handling; more explicit manpage text + - [tg] Do not use caddr_t on Linux, so dietlibc stops bitching + - [tg, Jilles Tjoelker] Catch division/modulo overflow 0x80000000/-1 + - [tg] Emacs mode ^O regression fix when the fetched lines are edited + * Add missing upstream code change explanations to the changelog + entries 40.3-1, 40.2-5, 40.2-4 (in lieu of upstream-changelog) + * Fix two oversights that might (finally) get us line-buffered I/O + * Disable use of to avoid needing to B-C libbsd-dev + * Use hardening=+all in DEB_BUILD_MAINT_OPTIONS querying buildflags + * mtest.t: new brkcontin to catch breakage failing test.sh operation + * Also, scan the test log and fail the build if the testsuite + appears not having run at all (Closes: #651615) + + -- Thorsten Glaser Sun, 11 Dec 2011 18:51:39 +0000 + +mksh (40.3-1) unstable; urgency=medium + + * The “Missing” upload + * Update to “mksh R40c+”, snapshot of R40-stable branch: + - [tg] Fix R40 regression misparsing $(case x in (x) :; esac) + - [tg] New test.sh ‘-f’ option (same as ‘-C fastbox’) + - [tg] Drop using set -o noglob inside pushd/popd/dirs + - [tg] Use += more in dot.mkshrc and keep strings shorter + - [tg] Correct interworking between local and set -A + - [tg] Fix out-of-bounds memory access on strings of 32 KiB length + - [tg] MKSH_DISABLE_DEPRECATED (for integrators) + * debian/.mkshrc: proper ksh88-hack char extraction and reuse + * debian/rules: use dh_prep ipv “dh_clean -k” iff it exists, + ONLY to please the new build log checker not taking backport‐ + friendliness of packages into account + * Use more loose dietlibc-dev build dependencies again, except + on known-bad cases (armel armhf s390) and need-verification + cases (no build logs available yet: hppa sparc64) and new + arches (s390x) but not on those where _some_ intermediate + versions were bad but both old and new versions work and the + testsuite falls back to eglibc if broken (powerpc sparc) + * Update package description - pdksh is orphaned, suggests mksh + * Log toolchain versions in buildinfo + + -- Thorsten Glaser Sat, 26 Nov 2011 19:28:57 +0000 + +mksh (40.2-5) unstable; urgency=low + + * The “Fernet-Branca” upload + * debian/rules: cleanup (remove dh_installdirs) + * debian/.mkshrc: use $'…' for PS1, like dot.mkshrc now does + * Use new-style template for maintainer scripts (good comments) + * Update to mksh R40-stable from today, which is close to R40c + - [RT, Chris “ir0nh34d” Sutcliffe] Port to MSYS + - [tg, Markus Duft, Bruno Haible] Interix select(2) bug workaround + - [tg] Manpage fixes + - [tg] Deprecate the “command line begins with ‘!’ for fc -e -” hack + - [tg] Promote x=(a b); x+=(c d) to a core mksh(1) feature + - [tg] Testsuite fixes for Hurd, MSYS; warning fixes for dietlibc + * Build-Depend on today’s dietlibc to test-drive it, again + + -- Thorsten Glaser Sat, 19 Nov 2011 22:48:44 +0000 + +mksh (40.2-4) unstable; urgency=low + + * The “visit us at OpenRheinRuhr” upload (AllBSD *and* Debian/m68k!) + * Pull in mksh packaging CVS HEAD, to test-drive packaging changes + (also gives us back PIE, relative to the last experimental upload, + and tries dietlibc on both MORE and ALL architectures possible) + * To also test dietlibc, version its B-D (this upload is not + intended to be released with wheezy, there _will_ be another + one before it, but it is needed to get dietlibc into shape + for the wheezy and precise releases, and it delivers a fix) + * Pull mksh CVS commit 1004EB9A7F80119200E, which fixes setting + the base of several built-in integer parameters to 10 instead + of retaining the one from the first assignment (regression) + - [tg] Fix accidental behavioural change wrt some built-in parameters + * Upload to unstable, despite the test status (also, this will + not migrate to testing anyway, due to #633479) + + -- Thorsten Glaser Fri, 11 Nov 2011 22:50:09 +0000 + +mksh (40.2-3exp1) experimental; urgency=low + + * Expand dietlibc-dev B-D to armhf hppa and depend on experimental + version, to test-drive that + * Disable PIE hardening for now, until compiler bugs are addressed + + -- Thorsten Glaser Wed, 09 Nov 2011 11:21:51 +0100 + +mksh (40.2-3) unstable; urgency=low + + * The “What a wonderful… day (or week?)” upload + * Avoid warnings during build information logging + * Update to R40-stable branch from 2011-10-25 23:00 for: + - [jonthn, Snader_LB] Fix spelling mistakes + - [cnuke] Fix bugs spotted during porting to OPENSTEP + - [tg, jg71] Unbreak building stristr with MKSH_ASSUME_UTF8 defined + - [tg] Fix most of the issues Jerker Bäck encountered on Interix + - [tg] Wrap access(2) as it may return false positive for X_OK on root + - [OpenBSD] Upper bound Emacs mode command repeat by input line length + - [tg] Improve CPPFLAGS mangling in Build.sh + - [Snader_LB] Several comment, documentation and website fixes/updates + - [tg] Avoid identifiers and cpp(1) macros with two underscores in a row + and those with a trailing underscore; they are reserved for the OS + * Add “hardening=+pie,+bindnow” when calling dpkg-buildflags; reminded by + RichiH (release goal); drop PIE for mksh-static (non-PIC obviously) + + -- Thorsten Glaser Tue, 25 Oct 2011 23:25:17 +0000 + +mksh (40.2-2) unstable; urgency=medium + + * The “Someone bring me Kruškovac❣” upload + * Update to R40-stable branch from 2011-07-26 17:30 for: + - [tg, Wouter Verhelst] Fix ${foo%\?} in -o sh + * This makes mksh as /bin/sh not break on building d-i on m68k + * Mention that mksh-small makes a faster /bin/sh on slow arches + * Drop the mksh-as-/bin/sh debconf code and questions from the + package in preparation for Goswin’s fix for that dash bug; + drop our /bin/sh diversion, always + + -- Thorsten Glaser Tue, 26 Jul 2011 21:41:01 +0000 + +mksh (40.2-1) unstable; urgency=low + + * debian/meat: Fix running the testsuite on Hurd + * Do not call "update-alternatives --remove" on upgrade (cf. #568299) + * New upstream stable version “Frankenheim Alt”: + - [tg] Don’t busy-loop on nameref ARY=ARY (LHS = RHS) + - [tg, yofuh] Tabcomplete ~foo like $FOO (LP: #710539) + - [tg] Code cleanup, style, and minor assorted fixes + - [tg] Tabcomplete ~foo/M↹ (with slash) economically + - [tg] Add new [DEL: experimental :DEL] global builtin, doing the same + as local (typeset, really – but that doesn’t deserve its name) does, + except localising all parameters it touches + - [tg] Better error messages with non-integral environment imports + - [tg] $RANDOM environment import accepts any string now + - [tg, Lucas Holt] Add setenv cshism to dot.mkshrc + - [tg, Johannes] Allow ^C to interrupt the built-in cat(1) + - [tg, Arkadiusz Miśkiewicz, Kacper Kornet] Fix mksh taking down the + entire terminal, hard, when scripts use $COLUMNS and fork off utilities; + regression introduced in mksh R37 (sorry, no regression test possible) + - [tg, Arkadiusz Miśkiewicz] Properly mark need-ctty regression tests + - [tg] MKSH_NO_EXTERNAL_CAT – Quell the external cat(1) calls magic + - [tg, Arkadiusz Miśkiewicz] Yes, “echo” is not portable, document + - [tg] Improve content and look of the manual page + - [tg] Move /etc/{,suid_}profile to /system/etc/ on Android + - [tg] Prevent more compiler warnings; catch build errors earlier + * Build from R40-stable branch: get a fix for dot.mkshrc + + -- Thorsten Glaser Mon, 25 Jul 2011 16:38:45 +0000 + +mksh (40.1-1) unstable; urgency=medium + + * README.Debian: Log check_categories to use with the testsuite + * debian/meat: Restore skipping of catmanpage build + * This is “Frankenheim” mksh R40: + - [tg] Let code samples in check.t and dot.mkshrc take care of the + new features; fix some longstanding bugs in them + - [tg] Add missing flush in rewritten read builtin for prompting + - [tg] Minix builds now automatically disable the ulimit builtin + * Medium urgency due to the missing flush call (problematic UI) + + -- Thorsten Glaser Sun, 12 Jun 2011 17:52:42 +0000 + +mksh (40~0.20110605-2) unstable; urgency=low + + * Upgrade to mksh R40 Release Candidate 3 + - [tg] [hash table limit]; work around bug in GCC 4.1 on Debian Etch + - [tg] New -c lto option to use Link Time Optimisation (GCC) with + automatic fallback to -c combine if unavailable + - [tg] Improvements for -c dragonegg, -c llvm (with gcc+dragonegg, + or llvm-gcc and clang, respectively), and TenDRA + * Enable LTO, for real, this time + + -- Thorsten Glaser Sun, 05 Jun 2011 20:47:53 +0000 + +mksh (40~0.20110604-1) unstable; urgency=low + + * Do not use libbsd any longer, mksh is self-contained + * Update README.Debian, copyright + * Upgrade to mksh R40 Release Candidate 2 + - [tg, hondza] Fix regression in tab completion result display + - [tg, Frank Terbeck] Fix parsing x=(…) expressions + - [tg, Jb_boin] Increase hash table limit; don’t crash when reaching it + - Comment sync with OpenBSD ksh + - Update testsuite tags (for Cygwin and other weird platforms) + * Catch early build failures better + + -- Thorsten Glaser Sat, 04 Jun 2011 20:15:03 +0200 + +mksh (40~0.20110529-1) unstable; urgency=low + + * Update to mksh R40 Release Candidate from CVS: + - [tg, Kacper Kornet] Implement a new regression test attribute + need-pass: {yes|no} and exit 1 if unexpected fails occur + - [tg] Add ;& and ;| for case + - [tg] Rewrite the read builtin and its documentation; adding + -A (read IFS words into array), -a (read octets/wide characters + into array), -N/-n (read only / up to z bytes), -t (read with + timeout) + - [tg] Add -e option to cd -P (POSIX 2011) + - [tg] Update dot.mkshrc to use the new features + - [tg] Fix gsf’s ifs.sh tests of the read builtin + - [tg, cnuke] Improve support for AIX, Cygwin, IBM XL C + - [tg] Add tests for x+=(y z) and ;;& extensions + * Please help testing this, so the release can rock❣ + + -- Thorsten Glaser Sun, 29 May 2011 18:51:43 +0200 + +mksh (39.3.20110506-1) unstable; urgency=low + + * New CVS snapshot with more regression and bug fixes: + - [tg] Correct skipping the UTF-8 BOM when identifying a file + - [tg] Do not use any longer + - [tg] Use double-underscore-framed __attribute__s + - [tg] Always catch SIGALRM (for the sleep builtin) + - [tg, wbx] Functions now inherit a global set -x + - [tg] Do not explicitly initialise static globals to 0/NULL + - [tg] Eliminate some dead code (functions, globals) + - [tg] Correct more tree handling bugs and merge similar code + - [tg] Add “+=” to concatenate scalars and append to arrays + - [tg] Support empty here document delimiters + - [Robert Luberda] Fix the four-argument form of test(1) + (Closes: #465250) – patch and testcases taken from pdksh.deb + - [tg] Drop the pre-POSIX ability to “test -t” without specifying “fd” + - [tg] Defer dropping an alias in favour of a POSIX function to + when the function is actually defined and check for the closing + parenthesis too + * Drop armhf dietlibc dependency, it’s broken + * Drop hppa dietlibc dependency, there’s no known good version + * Shorten debian/rules; update package description (mksh HEAD is + at OpenBSD 4.9-current level) + * Policy 3.9.2 with no changed relevant to us + + -- Thorsten Glaser Sat, 07 May 2011 01:16:22 +0000 + +mksh (39.3.20110328-2) unstable; urgency=high + + * Turns out running history-subst-4 on the buildds is a bad idea… + revert, and just live with the bug on hppa for now + * Urgency as this fixes FTBFS from 39.3.20110328-1 which was high + + -- Thorsten Glaser Mon, 28 Mar 2011 23:26:13 +0000 + +mksh (39.3.20110328-1) unstable; urgency=high + + * Back out dietlibc [hppa] dependency on experimental package + to be able to upload to unstable + * New CVS snapshot fixing all known regressions from the + recent experimental changes, as well as some more fallout: + - [tg] Fix mis-detection of gcc format attribute (false negative) + - [tg] Include some Android specific hacks (no change on other OEs) + - [tg, Jb_boin] In ${foo/bar/baz} expressions, when adjourning empty + patterns to avoid running into a busy-wait loop, remember to skip + the anchor characters (‘#’ or ‘%’) at the beginning, yet keep the + special meaning replacing a string begin or end with a string has + - [tg] Write a pattern optimiser that is run internally before calls + to the pattern matching code always (currently, replaces a@(b@(c)d)e + with abcde but keeps @(a|a), then (in a second pass) collapses + adjacent asterisk (‘*’) wildcards into a single one; this fixes some + of the symptoms of severe performance issues our pattern matching code + has to the extent that it can prevent busy-looping (found by Jb_boin) + - [tg, Chris “ironhead” Sutcliffe, Chet Ramey, Eric Blake, David Korn] + Handle pathnames with exactly two leading slashes well (SUSv4 3.266) + - [tg, Wayne Pollock, Bart Schaefer] Fix here documents, add testcases + - [tg] Fix corner case ${##1}, add tests for that and ${##} and ${#?} + - [tg] Bring back “test -H” ifdef S_ISCDF (for HP-UX) from pdksh + - [tg] Align read-only variable behaviour with (future) POSIX + - [tg] Permit ${foo%(*} on FSH (Debian Closes: #619947) + - [tg, rsc] Allow skipping testcases that need a controlling tty + * High urgency because the fix for ${foo%(*} is required since without + it, keyboard-configuration=1.68+squeeze2 can fail to configure + * Copy history-subst-4 to mtest.t to ensure hppa mksh-static is usable + * Tweak build process to prevent more redundant checks + * On unattended Hurd builds, skip testcases that need a controlling tty + + -- Thorsten Glaser Mon, 28 Mar 2011 22:26:25 +0000 + +mksh (39.3.20110313-1) experimental; urgency=medium + + * New CVS snapshot: + - [tg] Use the existing state machine, a recursive parser and retracing + the input stream for correct x=(…$((…$(…)…))…) parsing + - [tg, Jb_boin] complain about ${x:1:2:3} instead of crashing + - [tg, Jb_boin] make optional printf(1) builtin __CRAZY=Yes clean and + prevent it from crashing by reading past end of (invalid) format strings + - [tg] abort(3) on rogue pointers #ifdef DEBUG + - [tg] Correct some documentation, code commentary, etc. + - [tg] Handle the UTF-8 Byte Order Mark in $(…) expressions + - [tg] Speed up reading input by checking for the BOM only once + * Urgency due to crash (SIGSEGV, glibc-malloc corruption) fixes + + -- Thorsten Glaser Sun, 13 Mar 2011 17:06:35 +0000 + +mksh (39.3.20110308-2) experimental; urgency=low + + * Update architecture list for dietlibc (in experimental) + * Depend on fixed hppa dietlibc (from experimental) + + -- Thorsten Glaser Tue, 08 Mar 2011 21:03:53 +0000 + +mksh (39.3.20110308-1) experimental; urgency=low + + * Fix build warnings + * Add mtest-ascii1 to catch an unclear dietlibc bug on mips, powerpc + * New CVS snapshot: + - [tg] Port to MiNT / FreeMiNT (Atari m68k operating system) + - [tg] Do not close filedescriptor #3 (controlling tty) on UWIN + - [tg] Make the tree printing code safe for re-entrancy of output + - [tg] Implement recursive parser for $(…) to fix RedHat BZ#496791 + - Note that MKSH_NOPROSPECTOFWORK disables |& (co-processes) + * Upload to experimental (happy birthday, you three) + + -- Thorsten Glaser Tue, 08 Mar 2011 19:37:05 +0000 + +mksh (39.3.20110218-3) unstable; urgency=medium + + * Fix build when GNU bash in /bin/sh (still no idea _why_ though) + + -- Thorsten Glaser Fri, 04 Mar 2011 11:54:20 +0000 + +mksh (39.3.20110218-2) unstable; urgency=medium + + * When cross-compiling (DEB_{BUILD,HOST}_GNU_TYPE not the same) + set mksh-firstbuilt to avoid “testing” non-native executables + * mksh can do Multi-Arch: foreign as requested by vorlon + * Install build information (actual compiler, flags, regression + testsuite results, etc.) and regression testsuite as documen‐ + tation files (append build info to README.Debian) + * Fix bug which resulted in always trying to build with combine + * README.Debian: /bin/mksh-static can be /bin/sh too + * README.Debian: Add notes about expected testsuite failures + + -- Thorsten Glaser Thu, 03 Mar 2011 20:38:48 +0000 + +mksh (39.3.20110218-1) unstable; urgency=low + + * New CVS snapshot: + - [tg] Limit history file size to 1 GiB for sanity + - [tg] Add smores, a more(1)-like pager, as shell function to + dot.mkshrc (not control character safe but tty aware) + - [tg, David Korn] Make builtins directly callable; utf8-mode is + determined by LC_ALL/LC_CTYPE/LANG environment variables in that case + - [tg] If the interactive shell uses setlocale(3)/nl_langinfo(3) + to divine utf8-mode, fall back to environment variables unless success + - [tg] When called as a builtin, echo(1) behaves POSIXish + - [tg] Replace some MirBSD utilities with links to mksh(1) and ensure + some integration to keep compatibility + - [tg] Add a microsecond capable sleep(1) builtin + - [tg] Add selftest-direct-builtin-call regression test + - [tg] If the built-in cat is invoked from a direct builtin call, it + now properly handles the POSIXly demanded ‘-u’ option (as a no-op) + - [tg] Support the PIPESTATUS array (like GNU bash) + * Rewrite packaging to automatically test for usable libraries + (klibc (not yet) or dietlibc, fallback to eglibc) for mksh-static + and better test whether the binaries built against them is usable + * Try dietlibc on PowerPC, S/390, sparc again (we test the binary) + * Bring back basic klibc support (can be enabled by DEB_BUILD_OPTIONS) + + -- Thorsten Glaser Sat, 19 Feb 2011 17:36:19 +0000 + +mksh (39.3.20110209-1) unstable; urgency=low + + * New CVS snapshot: + - [tg, Jörg-Volker Peetz] Emacs prev-hist-word resets the counter + if other editing commands were run in between; repeat calling + works, even together with arguments, now; arguments are 0-based + (Debian Closes: #603801) – now for real ☻☺ + - [tg] Fix mis-sign comparison and potential truncation error + * Support $debian_chroot in /etc/skel/.mkshrc (template) + + -- Thorsten Glaser Wed, 09 Feb 2011 13:30:29 +0000 + +mksh (39.3.20110203-1) unstable; urgency=low + + * New CVS snapshot: + - [tg] More int → bool conversion, whitespace and related code cleanup, + error messages and typo correction + - [tg] Don’t alias suspend on Android either (goes together with stop) + - [tg] dot.mkshrc no longer exports $PS1, as recommended by Frank Terbeck, + to avoid confusing other shells + - [tg] The character width table is now in sync with Unicode 6.0.0 + - [tg] MKSH_SMALL doesn’t imply HAVE_REVOKE=0 any longer + - [tg] Ignore a ‘$’ preceding ‘"…"’ (like bash, ksh93) + - [tg] Make “foo=< unless it exists + - [tg] dot.mkshrc: When we set a UTF-8 locale (e.g. for the GNU OS), + we must also set -o utf8-mode to match it + - [tg] Don’t append a space after tab-completing a parameter substi- + tution that doesn’t contain a glob/extglob (LP: #710539) + * add RCS IDs into more files + * d/README.Debian: be more explicit about mksh-as-/bin/sh and + mention we wait on klibc, to use it with mksh-static + * d/control: add note on dietlibc B-D, which can be dropped + e.g. if porting to Derivates that don’t have it, like UCS + * d/control: update long description + * d/copyright, d/rules: we use debian/rules get-orig-source" now + * d/copyright: sync, 2011 + * d/rules: restructure a bit; add build-{indep,arch} targets + * d/rules, d/x_getflag: use dpkg-buildflags if existent + * d/po/it.po: update translation, grazie TetsuyO! + * run debconf-updatepo + + -- Thorsten Glaser Thu, 03 Feb 2011 18:38:45 +0000 + +mksh (39.3.20101101-1) unstable; urgency=low + + * New CVS snapshot: + - [tg] In setres{u,g}id/setuid EAGAIN case, error out immediately + - [OpenBSD] Some small manpage fixes + - [tg] Clean up mirtoconf and build warnings with some compilers + - [tg] Fix \c? vs. \c~ mis-documentation in mksh(1) + - [tg] Remove the somewhat-portable setmode.c from the mksh source + distribution and demote mknod(8) to an optional builtin, disabled + by default, manually re-enabled in the installer only on MirBSD + - [tg] Regenerate wcwidth table from Unicode 6.0.0 + - [tg] Change behaviour of argument-less exit in traps to match SUSv4, + original patch from Jonathan Nieder (Debian Closes: #599484) + * Integrate Vietnamese translation update, thanks Clytie Siddall + (Closes: #601925) + * Use lsb-release instead of dpkg-vendor for better reliability + + -- Thorsten Glaser Tue, 16 Nov 2010 13:42:18 +0000 + +mksh (39.3.20100915-1) UNRELEASED; urgency=high + + * New CVS snapshot: + - [Jeff Hamilton] Don’t alias stop on Android (system specific conflict) + - [tg] Add size optimisations, ifdef’d, mostly for Android + - [tg] Address what few concerns Chris Palmer (Android security team) had: + check all multiplications and some additions for integer overflows, + mostly in allocation context, and check setres{u,g}id/setuid for EAGAIN + iff the target OS is known to be returning it (Linux only, right now) + - correct a regression: 「read i?'foo:'」 was not working + + -- Thorsten Glaser Thu, 16 Sep 2010 22:03:08 +0000 + +mksh (39.3.20100905-1) UNRELEASED; urgency=low + + * New CVS snapshot: + - [tg] More int → bool conversion, whitespace and related code cleanup + - [tg] Improve mksh(1) manpage coverage, remove mentions of not-mksh + - [tg] Use wcwidth() from system on MirBSD + - [tg] u_int32_t is no longer needed (only for OpenBSD’s pre-ISO-C99 + arc4random API, which we no longer call), so don’t provide it from + Build.sh any longer + - [tg, tonnerre] Scan for uint8_t and provide if not found + - [tg] Fix realpath builtin for “/file/” arguments wrt. POSIX + - [tg] Do not generate from Build.sh as file any more if + it is missing; rather let sh.h define the types appropriately and + fix related compiler warnings + - [tg] Add “cat” builtin (defers to external if options are given) + - [tg] Reduce size by improved string pooling + - [tg] Document 「x=$(eval $(cat)) <<'EOF'」 workaround for the $(…) + parsing bug in the mksh(1) manual page and on the Red Hat Bugzilla + - [tg] Add support for handling a “--” argument to more builtins + - [tg] Correct some error messages + * Move extra/printf.c.1.nn to debian/extra/printf.c for improved + compatibility with source/format 3.0 and reduced build warnings + * Build with -Wall -Wextra in all modes + * Mention where strict aliasing warnings in dietlibc mode come from + + -- Thorsten Glaser Sun, 05 Sep 2010 21:04:15 +0000 + +mksh (39.3.20100725-1) unstable; urgency=high + + * The “Portability?” release + * Another new CVS snapshot: + - [tg] More int → bool conversion + - [tg] Fix window size not being checked during runtime + of external programmes by not relying on SIGWINCH so + much but instead checking before every interactive + editing of a command line + * High urgency because 39.3.20100721-1 isn’t yet in testing + * Policy 3.9.1.0, no changes needed + + -- Thorsten Glaser Thu, 29 Jul 2010 08:54:25 +0000 + +mksh (39.3.20100721-1) unstable; urgency=high + + * The “WTF is up with all these bugs spotted?” release + * Another new CVS snapshot: + - [tg] Fix NULL pointer dereference during iteration loop + when checking for alias recursion; discovered by Michal + Hlavinka + * High urgency due to SIGSEGV crashes + + -- Thorsten Glaser Wed, 21 Jul 2010 11:48:24 +0000 + +mksh (39.3.20100719-1) unstable; urgency=high + + * New CVS snapshot; summary of changes relevant to Debian: + - [tg] Correct shf buffer I/O routines to avoid a memory + corruption bug discovered by Waldemar Brodkorb and other + bad effects (bug inherited from pdksh, anno 1999) + * High urgency due to memory corruption and “set -x” fix + + -- Thorsten Glaser Mon, 19 Jul 2010 22:51:03 +0000 + +mksh (39.3.20100717-1) unstable; urgency=low + + * The “「Don't drink and dupload ;-)」? I use dput anyway!” release + * debian/rules: revert change disabling -combined on dietlibc, + since it appears to be of no practical relevance + * debian/rules: disable dietlibc on sparc due to weird problems + * debian/rules: adapt build log scanner contraband to newer gcc + * Switch from patch system to applying patches directly to the + extracted source in “1.0” style (in the future, “3.0 (quilt)” + can ease this) by using repackaged orig.tar.gz + * Install upstream’s dot.mkshrc as /etc/mkshrc and source this + from a new, minimal, /etc/skel/.mkshrc (debian/.mkshrc); idea + by Michal Hlavinka (RHEL package maintainer) + * Use repackaged upstream snapshot; changelog: + - [tg] Remove arc4random(3) functionality; seed an LCG depending + on the OS doing Address Space Layout Randomisation; speed up + - [tg] Fix spelling in dot.mkshrc + - [tg] Implement “live” window resize for the Emacs editing mode + - [tg] More fixes for bugs found by Valgrind and LLVM+Clang scan-build + - [tg] For script compatibility support “set ±o arc4random” during a + transition period until R40 is out (but issue a warning to stderr) + - [oksh] Add (, ), (( to reserved words in the manual page and fix + some formatting errors with GNU groff’s mdoc + - [tg] Make printf.c.1.15 use mksh’s shf_* routines instead of stdio + - [tg] Fix -Wc++-compat except implicit casts from/to "void *" + * Update printf.c file added; the new version actually uses mksh’s + shf functions instead of libc stdio, saves about 11K in mksh-static + * Adapt debian/* to new versions + * Bump Standards-Version to 3.9.0.0 (no changes required) + * Remove experimental, commented-out, klibc support for readability + * Run debconf-updatepo; put something into Language: header lines + * Lintian P: mksh: maintainer-script-without-set-e config + + -- Thorsten Glaser Sat, 17 Jul 2010 23:27:41 +0000 + +mksh (39.3-4) unstable; urgency=low + + * debian/control, debian/rules, debian/mksh.install{,.in}: + improve klibc builds (still disabled) and, for testing + purposes, do full, dynamic, builds if klibc is enabled + * debian/diffs/backport-fixes.diff: replace with upstream CVS diff + between 39.3 and 20100522 and adjust manpage version number; changes: + - [tg] Make default temporary directory configurable at compile time + - [tg] Fix performance deficiencies in the built-in realpath function + - [tg] Deprecate Build.sh -longoptions in favour of short ones: + -valgrind becomes -g (like debug), -combine and -llvm become + -c {combine,llvm} and the LLVM optimiser flags are passed via + -O = -o -std-compile-opts + - [tg] New Build.sh options -c dragonegg (for using the LLVM plugin + to GCC 4.5 with inter-module optimisation), -v (version) + - [tg] Document another way to get a coloured PS1 in the manpage + - [tg] Disallow some more kinds to trim a vector; Closes: #581867 + - [oksh] Simplify some code; RCSID and comment sync with OpenBSD ksh + - [oksh] Apply diff from manuel giraud to keep track of LINENO in a trap + * Silence some build log checkers wrt. false positives triggered from + mirtoconf output (affects both Debian and Ubuntu, at least) + * Put upstream changes for 39.3-2 and 39.3-3 into debian/changelog + entries retroactively for proper documentation + * debian/rules (if Ubuntu): Exclude dietlibc on powerpc/ppc64 and sparc + * debian/rules: the “diet” wrapper also eats most of our CFLAGS when + passing them to cc, so disable combine mode there to avoid some of + the problems, such as strict aliasing violations that are none + * debian/control: prefer pax over cpio + + -- Thorsten Glaser Mon, 24 May 2010 15:09:22 +0000 + +mksh (39.3-3) unstable; urgency=medium + + * debian/diffs/backport-fixes.diff: replace with upstream CVS diff + between 39.3 and 20100420 and adjust manpage version number; + this fix unbreaks word splitting "${foo#a}" for foo="a b c", + which, for example, is used by kwalletcli + - [tg] Fix "${x#?}" expansion when quoted, for real this time + + -- Thorsten Glaser Tue, 20 Apr 2010 09:21:39 +0000 + +mksh (39.3-2) unstable; urgency=low + + * README.Debian: mention /etc/skel/.mkshrc + * debian/diffs/backport-fixes.diff: replace with upstream CVS diff + between 39.3 and 20100409 and adjust manpage version number; changes: + - [tg] Correct small mistakes in manpage and build script + - [ahoka, tg, stippi, bonefish] Port to Haiku (and probably, implicitly, + BeOS; this is not tested though) + - [tg, stippi] Add Haiku specific RLIMIT_NOVMON as ‘V’ to ulimit builtin + - [tg] Let Build.sh cope with dirname(1) unavailability + - [tg] In the Emacs editing mode, hi-bit7 octets are now considered + “motion characters” for word boundaries – Esc+b, Esc+f, ^W, … + - [tg] Make EXECSHELL default configurable at compile time (embedded) + - [tg] If MKSH_SMALL do not compile in “set -o bgnice” by default + - [tg] Rework how RLIMIT_{AS,RSS,VMEM} map to ‘m’ and ‘v’ ulimits + - [tg] Add some more OS specific limits seen in zsh + - [tg] SUSv4 ${v=a\ b} and "${v=a\ b}" and ${v-a\ b} compliance, tests + - [tg] Make "~/.mkshrc" path configurable at compile time (embedded) + - [tg] Fix SUNWcc 12.1 error message scan in build phase=u + - [tg, Johannes Sixt, Geoff Clare] Fix variable assignment scope during + command execution (expansion vs. assignment execution environment); + [Herbert Xu, Geoff Clare] Add more regression tests for this + - [tg] Fix single quotes in "${foo#bar}" (differs from "${foo-bar}") + - [oksh] Fix mknod(8) usage message: b|c are not optional + - [tg, oksh] Fix "${x#?}" expansion when quoted (quotes, space) + * debian/control: make locales optional on avr32 + * debian/rules: disable locale support on avr32 + + -- Thorsten Glaser Fri, 09 Apr 2010 20:08:16 +0000 + +mksh (39.3-1) unstable; urgency=low + + * New upstream version R39c; shortened ChangeLog since R39: + - [tg] Build system, code, docs and testsuite cleanup, also style(9) + - [tg] Parse and evaluate ${parameter op word} correctly + - [tg] Fix possible SIGSEGV in interactive mode bind builtin due to + mis-optimisation of gcc combined with a bogus prototype; + discovered by Grml.org's Frank Terbeck (ft), thanks! + - [tg] Clean up some more strict *roff or compiler warnings: dashes, + undefined macros; casting errors (constness, signedness, type + width/class) and catch possibly unaligned pointer dereferences + early; remove code/rodata redundancies, plug memory leaks + - [smultron] Tweak the manual page: point out the word “colour” + - [tg] Optimise dot.mkshrc DJB’s CDB hash implementations; add Bob + Jenkins’ one-at-a-time hash (standard and leading-bit + initialised); fix signedness in expressions; let the hashes use + stdin if "$*" is empty, like Lb64{en,de}code; use + “[[ -o utf8-mode ]]” ipv “[[ $- = *U* ]]” + - [tg] Build.sh portability fixes: missing prerequisite headers; + ensure $CC is never called without $CFLAGS; fix test.sh, et al. + - [tg] Optimise internal variable representation; use one-at-a-time + hash; cache hash values for faster resizing at zero memory cost; + clean up hash table (keytab) code; switch hash table collision + resolution algorithm to Python’s; prepare for later changes + - [tg] Fix type errors in the source code (int → bool, size_t, + mksh_uari_t) + - [tg] Fix “${foo:bar:$baz}” not working (missing substitute() call) + - [tg] Implement “typeset ±a” as nop + - [tg] Support ksh93-like “${!foo[@]}” listing the keys (indicēs) of + all set array elements + - [tg] Support bash/ksh93-like “array=([key]=value …)” and + (additionally) “set ±A array -- [key]=value …” to directly + specify indicēs to use + - [tg] Document the optional, unsupported, printf(1) builtin in TFM + - [tg] Replace realpath(3) dependency and internally used + get_phys_path() pdksh code with own implementation; always offer + the realpath builtin + - [tg] Implement nameref='typeset -n' (bounded variables) like AT&T + ksh93 but with mksh-style nested/dynamic scoping and on-use + resolving; they cannot currently be stored in an array though + - [tg] Add “chdir” builtin doing the same as “cd” special builtin + - [tg, David Korn] Document more differences between mksh (and + pdksh) and AT&T ksh (or, more specific, ksh88, ksh93) in the + manual page + - [tg] Support “'a'” as an alternative to “1#a”, like ksh93 does + - [tg] Add ksh’s “test -o ?foo”: true if “foo” is a valid shell + option, where “foo” can be “xtrace” or “-x” or “+x” (these three + are equivalent) + - [tg] Support “$'…'” backslash-expanding single-quoted strings, as + requested by David Korn, with almost the same syntax and semantics + - [tg] Unify backslash expansion code (C style vs. print builtin) + - [tg] Support “function stop () {” bashism + - [tg] For several items in the source code that require order to be + kept, provide from multiply-included header files; sort correctly + - [tg] Get rid of unneeded FMONITOR (-m) for shells without job + control; sync list of flags, comments and manpage with reality + - [tg] If MKSH_SMALL, reduce size by removing editor functionality + - [tg] Support VT100 emulator style {Ctrl,Alt}-CurLeft/Right keycode + sequences with new vt100-hack emacs bind function (LP: #355883) + - [cnuke, tg] Remove more, like GNU bash extensions, from MKSH_SMALL + - [tg] Remove more functionality, such as Emacs command line editing + mode bind key macros, and other extensions, from MKSH_SMALL to + help floppies + - [tg] Make forking and subshells less expensive wrt. random state + - [tg] Build and source code fixes for / caught by SUNWcc, HP aCC, + pcc, DEC ucode cc (MIPS), GCC, LLVM clang + - [tg] Make undef/def MKSH_NOVI into 0/1 MKSH_S_NOVI build flag + - [tg] Get rid of "U getenv" in nm output, we already import environ + - [tg] Simplify $RANDOM handling: reads are now either arc4random(3) + (if available: set +o arc4random is no longer possible) or an LCG; + writes are arc4random_pushb(3) if available for explicit writes, + arc4random_addrandom(3) otherwise, or another one-at-a-time hash + feeding the LCG; furthermore, RANDOM is now always exported to and + imported from (implicit read: no push to kernel done) the + environment vector on startup and spawning + - [tg] Document mksh does not exactly use OPTU-8/OPTU-16 in the + manpage, as well as when characters, octets, or screen columns + are used + - [tg] Fix exit 127 on "mksh /tmp/horsies" ipv of 1 on ENOENT, + #548744 + - [Clint Adams] Fix typos in the testsuite + - [tg, Clint Adams] Begin a shared testsuite for mksh and posh + - [tg] Make 「((foo) || bar)」 and 「((foo) | (bar))」 work + - [tg] Fix lazy evaluation of assignments by ternary operator, + #445651 + - [tg] Work around Cygwin bugs (quirks) hindering the testsuite + - [tg] In FSH mode, “echo [-n] 'foo\x40bar'” shall not be expanded + - [tg] Let set -- $(false); echo $? return 0 (POSIXly correct) in + FSH mode, 1 (needed for getopt(1) support) otherwise + - [tg] Changes of variables inside Bourne style POSIX functions + indeed affect the current execution environment (of the function + caller) + - [tg] Fix getopts behaviour (sync with AT&T ksh93 not ksh88) + - [tg] “eval $(false)” shall return 0 (Debian Closes: #550717) + - [tg] Ensure that /* apo'strophes in comments */ work + - [tg] Overhaul and simplify handling of (special) variables + - [tg] Further reduce memory (code/data) and import footprint + - [tg] Use functions without PATH_MAX limit on GNU/Hurd + - [tg] Fix tab completing pathnames containing ‘:’, ‘=’, ‘$’ or ‘`’ + - [tg] Support ‘-T ’ even if MKSH_SMALL and fix it + - [tg] Remove "which" alias "whence -p" to allow "which -a" in + dot.mkshrc and add more examples, some commented out + - [tg] Fix print_columns() issue with displaying items where + characters had differing number of octets and columns, and the + off-by-one which had hidden this problem with 2-octet 1-column + and 3-octet 2-column chars + - [tg] Beautify the manpage in both AT&T nroff and GNU groff + - [tg] Fix null-expansion of “${x%?}” if $x is unset + - [tg] Make some globbing (${x%?}) operate on characters instead of + octets; update manual page to reflect that others still do and + remove wording that let people think we’d ever support POSuX + character classes + - [tg] New ${%foo} returning width of $foo in screen columns, or -1 + if $foo contains an ASCII/latin1/Unicode C0/C1 control character + - [tg] Fix subtle possible portability problem wrt. CHILD_MAX + - [tg] Honour ±U on command line of an interactive shell + - [tg] Fix dead stores and other bugs pointed out by the Clang + static analyser; put assertions in places it has false positives + - [tg] Plug uninitialised memory access and possible out-of-bounds + read of a buffer caught by Valgrind; change one memcpy(3) to + memmove(3) where srcbuf and dstbuf overlap; place (-DDEBUG) + workaround for false positive + - [tg] Rework __attribute__ compiler capability check + - [tg] Apply errno save/restore related fix from (sync with) oksh + - [tg] Build.sh: output message when switching from + autoconfiguration to building / output generation (requested by + Matt “lewellyn” Lewandowsky); use “conftest.c” ipv “scn.c” (to + please ccache); ... + - [tg] Allow “unset foo[*]” (keep attributes) and “typeset foo[*]” + (for forward-compatibility; R39b it’s the same as “typeset foo”) + - [tg] When persistent history is enabled (but not MKSH_SMALL) and + used, intertwine the shells concurrently accessing $HISTFILE + better ⇒ sync on empty or duplicate line as well (requested by + Maximilian “mxey” Gaß) + - [tg] Split off “set ±o posix” and “set ±o sh” again, to be + somewhat more compatible to various old or vendor versions of + pdksh and mksh: + + MKSH_BINSHREDUCED sets FSH but not FPOSIX + + MKSH_MIDNIGHTBSD01ASH_COMPAT depends on FSH but not FPOSIX + + The echo built-in behaves the same for FPOSIX and FSH + + File descriptors > 2 are not closed for both FPOSIX and FSH + + Both “set -o posix” and “set -o sh” call “set +o braceexpand” + + In contrast to R39 and below, the errorlevel of + “set -- $(getopt ab:c "$@")” is now the same in ksh and + FPOSIX mode (0) and only FSH will use the errorlevel of getopt + (used to be the other way round) + - [tg] Document some more shortcomings in the mksh(1) manual page + - Contributed printf.c fixes: + + [tg] Make printf(1) builtin use “$'…'” mode, like ksh93 + + [tg] Fix const-cleanliness + * Remove patches now integrated in upstream or no longer needed + * Bump Standards-Version, no relevant change + * Apply patches inside the top-level directory + * debian/source/format: Enforce "1.0" manually, for now + * debian/README.source: New, by zack's suggestion, to document some + particulars of the source package and why I'm not using 3.0 yet + * debian/README.Debian, debian/mksh.docs: New, document dash bug + * debian/control: I'm sure we don't need to B-D on locales-all [m68k] + * debian/control: tweak package short description to well-known text + and sync long description with upstream's + * debian/copyright: Update, sync with upstream + * Rename build/ into builddir/ to avoid phony target vs pathname + conflict in Makefile (debian/rules) + * debian/rules: Ensure we use the C locale during build (especially + for patch application collation order) + * debian/mksh.examples, debian/rules: Split out dh_installexamples args + * debian/rules: Update for R39c, printf.c.1.14 particulars + * debian/rules: When building, try with -combine first but retry if it + fails, like my OpenSuSE Buildservice packages do (cf. LP: #375604) + * debian/control: Remove DMUA, I'm a DD now + * debian/diffs/backport-fixes.diff: New, fixes not yet in R39c + + -- Thorsten Glaser Sun, 28 Feb 2010 14:09:39 +0000 + +mksh (39.1-4) unstable; urgency=low + + * Update danish translation, Tak tazz + * debian/diffs/backport-echo-noescapes.diff: new, backport fix + for "echo [-n] 'foo\x40bar'" expanding even in sh mode + * debian/diffs/*: refresh and bump version number + * debian/control: Update and correct package description + + -- Thorsten Glaser Sat, 10 Oct 2009 22:00:37 +0000 + +mksh (39.1-3) unstable; urgency=low + + * Add support for using pax instead of cpio for extraction + * Backport fix for return code bug (Closes: #548744) + + -- Thorsten Glaser Tue, 29 Sep 2009 12:46:07 +0000 + +mksh (39.1-2) unstable; urgency=low + + * debian/rules: build mksh-small without floating point support + also, because it’s ⓐ huge and ⓑ buggy in dietlibc + * debian/diffs/backport-function-parens.diff: new, support the + "function stop () {" bashism sometimes popular in sh scripts + * debian/diffs/zz-version.diff: fix an oversight and use the + actual 39.1-* version number instead of 38.9.yyyymmdd-* from + when this patch was first being created in an experimental + version; refresh diff against original files; use -U1 instead + of -up for sh.h diff to not get fuzz at the RCS ID + + -- Thorsten Glaser Sat, 26 Sep 2009 21:18:54 +0000 + +mksh (39.1-1) unstable; urgency=low + + * New upstream version R39 (despite #540512, I got fed up waiting for + Guillem/Gerrit to contact me), Closes: #541617; complete ChangeLog: + - [tg] Shut up a bogus gcc warning during configuration process + - [tg] Spell AT&T consistently in the source code + - [tg] Tweak mksh(1) manual page, from wbx@ and «lewellyn:#ksh» + - [tg] dot.mkshrc: fix $@ vs. $* mix-up + - [tg] dot.mkshrc: add DJB cdb hash function + - [tg] Sync with oksh: fix Vi editing mode word erase handling, again + - [tg] Skip whitespace between POSIX style shell function name and + its definition parenthesēs during detection if an alias of the same + name already exists to be more robust (Debian Closes: #535970) + - [tg] Build system improvements for ACK and nwcc, both on Debian sid + - [tg] Fix spelling error in changelog discovered by Lintian + - [tg] Aligh “set -o nounset” / “set -u” behaviour with future POSIX + standard, as discussed with GNU bash maintainers, David Korn from + AT&T ksh93, and The Open Group; prompted by use in Debian; + Closes: #539538 + - [tg] add an unsupported way to make printf(1) a builtin + - [tg] Build system and regression test code and comment improvements: + better and more comments matching reality better; more reliability + w.r.t. passed CPPFLAGS; more of the MKSH_SMALL changes may be + overridden, all of them are now enumerated on the webpage; fixed + some breakage; portability + - [tg] MKSH_NOPWNAM and MKSH_SMALL will now both disable the ~fac/ + (homedir) expansion code wholly if defined, not just getpwnam(3) + calls + - [tg] shells without job control no longer define the standard + “stop” and “suspend” aliases (they are pointless anyway); + regression tests know + - [tg] use system RCS ID macros on MirBSD if decent enough + - [tg] shut up bogus gcc 4.5/trunk warnings caused by + over-optimisation + - [tg] restore ANSI C compilability broken in R38 (speed up, even) + - [tg] use memcpy(3) ipv strlcpy(3) if possible and safe and secure + * Integrate czech translation update, Dêkuji; Closes: #534788 + * Switch to debhelper 5, by suggestion of Patrick “aptituz” Schönfeld + * Add (commented out) framework for building with klibc, pending + bugfixes and enhancements I submitted to the Debian BTS; can be + customised for with/without MKSH_SMALL and dynamic/static linkage + * debian/copyright: remove setmode.c remark, it is never used: + mksh-full has it provided by libbsd; mksh-diet, mksh-small, and + mksh-klibc have the mknod builtin disabled and do not need it; + strlcpy.c is provided by libbsd, dietlibc and klibc, so neither + mksh-full nor mksh-diet (nor mksh-klibc) need it, only mksh-small + in the glibc version (on platforms where dietlibc is unavailable) + * debian/rules: Append -e to sub-make command line, to force it to + use the correct build environment (mostly CFLAGS) + * Apply policy compliance (-o posix if run as sh) to mksh-small + * Disable duplication of -Wall on the compiler command line + * debian/rules: improve comments + * mksh-klibc: debian/rules can now build an MKSH_SMALL flavour + * Let mksh have all builtins dash has; Closes: #532343 + ‣ New diffs/add-builtin-chdir.diff: add “chdir” builtin (= “cd”) + ‣ New diffs/add-builtin-printf.diff: add “printf” builtin (manpage) + ‣ debian/copyright, debian/rules: new source file printf.c (code), + install and use it; make sure klibc has strtod(3) disabled + ‣ New diffs/add-builtin_common.diff: common part of the diff + * New diffs/zz-version.diff: use Debian specific ksh version number + * debian/rules: reorder some assignments to make it better readable + and add and improve comments + * debian/watch: add RCS ID and comments + * debian/mksh.menu: don’t create an entry for Diet mksh any more + * debian/mksh.menu, debian/mksh*.xpm: add icons, long description + * Update spanish translation; from asarch via IRC, ¡gracias! + * Fix a spelling error and repetitiveness in the German translation + * Use portuguese debconf translation for the missing parts of the + brasilian-portuguese translations and mark them fuzzy + * Translate the missing dutch parts myself (as good as I can) + * Convert all debconf translation files to UTF-8 + * Remove VCS-CVS field override; the Lintian maintainers have + agreed to adjust it so that anoncvs-over-ssh is not criticised + * Switch to Debian Policy 3.8.3, no relevant changes + + -- Thorsten Glaser Wed, 16 Sep 2009 11:08:08 +0000 + +mksh (38.3-1) unstable; urgency=low + + * New upstream version R38c; complete ChangeLog: + - [tg] Fix regression tests on OSes insisting on a shebang (Cygwin) + - [Sean Boudreau] QNX 6.4.2 ed(1) is said to have the bugs fixed + - [tg] Build.sh bugfixes: -DMKSH_BINSHREDUCED can also be given + without -DMKSH_SMALL; allow HAVE_REALPATH=x and HAVE_REVOKE=x in + the environment to re-enable these even if -DMKSH_SMALL disables + them by default, like mknod already did + - [tg] -DMKSH_ASSUME_UTF8=0 skips the environment checks, like + -DMKSH_ASSUME_UTF8=1, but disables the utf8-mode + - [tg] Apply some more KNF – style(9) – to the source; clean it up + and further optimise for small size + - [OpenBSD] Fix segfaults caused by missing check for end of input + in the tokeniser on “let --” and other input + - [OpenBSD] Make Vi editing mode ^W behave like Emacs mode’s + - [tg] If no killpg(3) is available, use kill(2) and hope it works + - [tg] -DMKSH_NO_LIMITS skips trying to build the ulimit code + * debian/rules: use DEB_BUILD_ARCH, not DEB_HOST_ARCH, to determine + if dietlibc should be excluded on certain architectures where it + is known to fail + + -- Thorsten Glaser Wed, 10 Jun 2009 19:45:10 +0000 + +mksh (38.2-1) unstable; urgency=low + + * debian/rules: fix typo in buildd admin instructions for openpty() + * New upstream version R38b; complete ChangeLog: + - [André Wösten] Add __NO_EXT_QNX to avoid picking up the wrong + waitfor() from in (while porting to) QNX 6.4 + - [tg] Plug memory corruption issue introduced in R38 + - [tg] Amend dot.mkshrc with a base64 en-/decoder in shell + - [tg] Import a manpage fix via OpenBSD from Alan R. S. Bueno + + -- Thorsten Glaser Sun, 31 May 2009 17:45:42 +0000 + +mksh (38.1-1) unstable; urgency=low + + * debian/control: depend on locales-all on m68k because its + locales and glibc packages are not up to date / installable + * debian/rules: ignore localedef failure (uncritical to build) + * New upstream version R38; complete ChangeLog: + - [tg] Improve regression test output debugging + - [tg] Fix prerequisites on MidnightBSD in mirtoconf + - [tg] Mention that RedHat BZ#496791 cannot currently be fixed in + the manpage by discouraging use of apostrophes in comments in + comsubs; add appropriate (expected-fail) regression tests + - [tg] Sync with OpenBSD ksh (mostly a no-op) + - [James Butler] Add search-history-up and search-history-down + keybindings (tcsh-like) to the Emacs command line editing mode + - [tg] Bind new search-history-{up,down} to ANSI PgUp and PgDn keys + - [tg] Document ANSI default keybindings (↑↓←→ Home End Del + PgUp PgDn) in the mksh(1) manual page as well + - [tg] Optimise internal UTF-8 handling code for size and reusability + - [tg] Incompatible change: ${foo:1:2} and ${#foo} now operate on + characters, not on bytes. Characters are octets (set +U) or + (utf8-mode) MirOS OPTU-8 multibyte characters (set -U) + - [tg] Improve regression tests relating to ${foo:1:2} and ${#foo} and + let wc=1#x and utf8-mode + - [tg] Use per-file copyright notices, move global text to manpage + - [tg] Expose new MKSH_MIDNIGHTBSD01ASH_COMPAT ifdef; change it to only + trigger if FPOSIX (or MKSH_BINSHREDUCED and /bin/sh) + - [tg] Remove already-dead “#if 0” style debugging code + - [tg] Change some code into a more portable fashion, optimise + - [tg] Allow [[ $foo ]] (ksh93 extension) mentioned by pgas + - [tg] Clean up mksh and the contributed arc4random.c for some + conversion, enum and other warnings for gcc-snapshot trunk r147610 + - [tg] Ensure no function uses more than 768 bytes of stack either + - [tg, wbx] Add extension to make “!string” lines work like in GNU bash + * debian/rules, debian/copyright: adjust to upstream changes, + provide separate copyright file for Debian + * Remove package-uses-deprecated-debhelper-compat-version + lintian override to show up in statistics, we want to + retain the old debhelper version to facilitate backports + + -- Thorsten Glaser Wed, 27 May 2009 21:27:50 +0000 + +mksh (37.3-2) unstable; urgency=low + + * Provide a way to not use dietlibc for /bin/mksh-static + on certain architectures; use it for s390 (Closes: #523088) + * debian/control: run ispell over it + + -- Thorsten Glaser Wed, 08 Apr 2009 18:07:55 +0000 + +mksh (37.3-1) unstable; urgency=low + + * New upstream version R37c; complete ChangeLog: + - [tg] Improve præprocessor detection/work in Build.sh + - [tg] Decouple MKSH_CONSERVATIVE_FDS from MKSH_SMALL + - [tg] Enable MKSH_CONSERVATIVE_FDS by default on Minix 3 + - [tg] Work around the (in-)famous ACK "const" bug + - [tg] Optimise structure alignment and padding; Closes: #522778 + - [tg] Retain LOCPATH (for glibc locale) in check.pl + - [tg] Document, simplify and clean up the code better + - [tg] Use mirbsd.org eMail addresses consistently + * debian/rules: try to at least execute the built binaries in !nocheck + cases, to prevent totally unusable packages from being published; + Closes: #522779 + * Use LOCPATH and a temporarily generated UTF-8 locale for the regres- + sion test suite (from Steve “vorlon” Langasek); depend on localedef + Closes: #522777 + * debian/control: add comment where the dietlibc list comes from + * Sync package description, etc. with R37c release and upstream + * debian/control: mention VCS-CVS syntax and place of upstream source + + -- Thorsten Glaser Tue, 07 Apr 2009 23:24:48 +0200 + +mksh (37.2-1) unstable; urgency=low + + * New upstream version R37b; complete ChangeLog: + - [tg] Clean up build system and dot.mkshrc some more + - [tg] Add getrusage(2) implementation using times(3) if none found + - [tg] Add jobless mode (for Minix 3, Plan 9, …) + - [tg] Detect the Amsterdam Compiler Kit in the build system + - [tg] If no RLIM_INFINITY don’t try to do ulimit + - [tg] Work around gcc4 strict warnings vs. broken system headers + - [tg] Work around systems with mmap(2) but no munmap(2) + - [tg] Fix (disallow) bind key macro recursion (instead of beeping + and going into an endless loop), allow multi-line bind key macros + (mostly from Alexander Hall), remove dead code (the beeping) and + optimise + - [tg] Add (commented out, undesired, standards compliance breaking) + compatibility code to MidnightBSD 0.1 /bin/sh for ctriv + - [tg] Clarify the mksh(1) manual page even more + - [tg] Port to Minix 3 + GCC + * New upstream version R37; complete ChangeLog: + - [tg] Rename -o utf8-hack to -o utf8-mode + - [tg] Fix spacing mode error (pasto) in the mdoc(7) format manpage + - [tg] Implement $((#…)) unsigned arithmetic calculation, needed for + arc4random_uniform(3)-in-korn-shell implementation + - [tg] Really preserve LD_LIBRARY_PATH in check.pl + - [tg] New Build.sh option ‘-combine’ for building mksh(1) at once + with “-fwhole-program --combine” (gcc4, llvm-gcc4) if available + - [tg] Always set COLUMNS and LINES trying as hard as we can, using + TIOCGWINSZ even if used without FTALKING, and with the sane 80x24 + default if the ioctl(2) fails + - [tg] Handle _POSIX_VDISABLE being undefined (e.g. Linux/klibc) + - [tg] is only required for flock(2) + - [tg] Fix multi-column output routine for the corner case if the + screen is less wide than one output column; 10x Gábor Gergely + - [tg] Fix ${foo/@(%)/\\x} in UTF-8 mode (utf_widthadj for control + characters U+0080‥U+009F is slightly broken; this fix shifts the + brokenness into the command line editing mode only) + - [tg] Introduce mksh_ari_t and mksh_uari_t internal types to limit + arithmetics to 32 bit on all systems; currently depending on the + already-used standard int32_t and uint32_t types. Future expansion + to 64 bit possible. Document that shell integer variables use this + type. + - [tg] The variables PGRP, PPID, RANDOM and USER_ID are now unsigned + - [tg] Fix two off-by-ones breaking PS1 ending with a newline; bug + reported by Matthias Diener + - [tg] Just pass through C1 control characters for now + - [tg] Code and internal interfaces cleanup + - [tg] Regression test fixes for Cygwin env(1) being unsorted + - [tg] Replace the memory allocator by something equally simple and + homegrown but optimised for use with mksh and free checking + - [tg] Import a couple of minor fixes (e.g. spelling) from oksh + - [tg] Fix problems with "set -e" for real; from oksh, + Closes: #518359 + - [tg] In "set -o posix" mode, have limited echo(1) to improve + standards compliance; the exact feature set is open for discussion, + e.g. with pkgsrc® people; for now, only -n as first arg + - [tg] Make test builtin operator precedence consistent; from oksh + - [tg] Revamp and fold and enhance the regression tests + - [tg] Document somewhat surprising behaviour in mksh(1) better; + here: [ x -eq y ]; for gps23 from #ksh + - [tg] Reduce memory consumption by allocator simplification + - [tg] Fix bugs spotted by DEC ucode cc (ULTRIX) and gcc 1.42 (BSD/OS) + - [laffer1] Make mksh the default /bin/sh in MidnightBSD + * debian/rules: add support for applying patches to the source code + * debian/rules: build with new ‘-combine’ option for better optimisation + * Fix debconf checks if dash is uninstalled; Closes: #518355 + * Use 「--package mksh」 consistently with dpkg-divert + * debian/control: update package description + * Upgrade Standards-Version to 3.8.1 + - debian/rules: support nocheck in DEB_BUILD_OPTIONS + - debian/control: add RCS Id as comment field + * debian/source.lintian-overrides: add (things not deemed fixable) + - package-uses-deprecated-debhelper-compat-version (who cares) + - vcs-field-uses-not-recommended-uri-format (source is available + via AnonCVS, but pserver must die!) + * debian/control: prepend :ext: anoncvs protocol to VCS-CVS field + + -- Thorsten Glaser Sun, 05 Apr 2009 15:48:16 +0000 + +mksh (36.2-1) unstable; urgency=low + + * Reword package description, avoid things not of interest to + a Debian user; Closes: #505882 + * Switch from patching copyright to merely prepending information + * Remove all patches, as they have been integrated upstream; add + ‘-DMKSH_BINSHREDUCED’ to CPPFLAGS to enable the functionality + * New upstream version; complete ChangeLog: + - [tg] Add check for naming the output file “scn” instead of “a.out” + or “a.exe” when compiling scn.c, for Haiku, from Adam “replaced” Hoka + - [tg] Rewrite utf_backch macro and x_bs2 function into a combined + x_bs3 function for the Emacs editing mode, to optimise them and get + rid of the use of __typeof__ (suggested by Anders “ragge” Magnusson + after the problem was spot by replaced) and one of the uses of the + statements-as-expressions feature + - [ahoka] Add mirtoconf check for nice(3), missing on Haiku + - [tg] Remove all uses of the statements-as-expressions feature by + rewriting the source code accordingly and optimising some parts + - [tg] Recognise nwcc (Nils Weller’s C compiler) in Build.sh + - [tg] If exists, pull it in for strcasecmp(3) + - [tg] Welcome QNX/Neutrino; work around broken /bin/ed + - [tg] Simplify, shorten, speed up PS1 in dot.mkshrc + - [tg] Remove some dead code courtesy of scan-build native runs + - [tg] Add some casts to prevent LLVM+Clang warnings + - [tg] Work around llvm-gcc-4.2.1 -Wformat pickyness + - [tg] Add new Build.sh option ‘-llvm’ (clang, llvm-gcc) + - [tg] Speed up mirtoconf if ‘-DMKSH_ASSUME_UTF8’ is set + - [tg] Add the workaround for Debian #492377 into the main mirtoconf + function (hiding gcc errors during the configure phase) because + Gentoo has similar scanner issues; reported by Hanno Böck + - [tg] If an MKSH_SMALL has arc4random(3), skip the rand(3)/srand(3) + fall-back altogether to shrink size, also removed need for time(3) + - [tg] Fix alias expansion recursion check if the word to be expanded + is immediately followed by end of input, add test case; spotted by + Michael Hlavinka in pdksh and mksh; RedHat #474115 + - [tg] Fix string/wdstring confusion preventing bashiop (&>foo) to + work inside a function, add regression test, limit to 99 fds + - [tg] change regression tests to ‘set -U’ or ‘set +U̲ instead of + ‘set -o utf8-hack’, as well as query using ‘$-’ ipv ‘$(set +o)’ + (easier and more reliable) + - [tg] Add comment to regression tests which can fail on slow machines + or Cygwin environments due to timing issues + - [tg] Remove a lot of superfluous casts, improve type cleanliness + - [tg] Insert a couple of /* CONSTCOND */ for lint + * New source package and build structure: + - distfile is now packaged *inside* the orig tarball instead of repak- + kaged, similar to PostgreSQL + - debian/rules “patch” target takes care of it, as per Policy Manual + - debian-specific things (debian/ directory and all patches) are kept + in a publically accessible CVS repository + - VCS-CVS and VCS-Browser fields have been added to debian/control + - source is extracted to ./mksh and built, using relative paths to the + source code, in ./build/full and ./build/small; both are .cvsignore’d + - most files now carry an RCS ID + - paths in mksh.install, mksh.manpages, rules have been adjusted + * word-wrap debian/control lines to 80c + * add build dependency on cpio (for distfile extraction) + * for non-pbuilder testsuite runs (needed on gnubber), rename the ./manual + file tested for to ./attended to clarify its purpose + * debian/rules: share code instead of duplicating it + * debian/rules: fix testsuite use of $? and $x (gmake wants $$? and $$x) + * debian/rules: use sensible stamp files and new paths, coming along with + the new “patch” target + * remove the ‘-Q’ option from Build.sh invocation, which is gone + + -- Thorsten Glaser Sun, 14 Dec 2008 20:38:42 +0000 + +mksh (35.2-3) unstable; urgency=low + + * Apply upstream changeset 10048D15ABE2EA76C75: + - Bring back automatic -o posix setting if the shell is invoked + as “sh” or “-sh” (unless compiled with MKSH_SMALL), add + regression test + - If -o posix is set, do not keep file descriptors created via + I/O redirection, as Korn Shells do, private; add regression + test; Debian Closes: #499139; reported by Markus Schaber and + Agustin Martin Domingo + * Change mksh-internal version number to document aberration from + pristine source + * Add DM-Upload-Allowed control field to prepare for future updates + * Add workaround to “posix-mode-2” regression test to cope for GNU + getopt idiocy to not stop argument parsing upon encountering the + first non-flag argument: “ln -s mksh -sh” tries to parse -s and -h + + -- Thorsten Glaser Fri, 19 Sep 2008 10:12:59 +0000 + +mksh (35.2-2) unstable; urgency=low + + * Workaround for false positives on IA64, Closes: #492377 + (by circumventing the regex matcher for code not actually used) + * The mksh-static binary on non-dietlibc arches was not statically linked + * MKSH_STATIC implies MKSH_NO_PWNAM, remove duplicate definition + * Add build dependency on en_US.UTF-8 locale data for the regression tests + * Fix lintian -vIi warning debian-copyright-line-too-long by wrapping + + -- Thorsten Glaser Mon, 28 Jul 2008 20:54:17 +0000 + +mksh (35.2-1) unstable; urgency=low + + * Update to BSD-advertising-clause-free new upstream release; changelog: + - Simplify and refactor the ulimit builtin, partially from oksh + - Some style cleanup; use appropriate integer types + - Fix a bug in table (e.g. kill -l, tab completion) display: the width + of non-ASCII characters is now honoured in the utf8-hack mode + - Improve handling of invalid UTF-8 in certain areas, and multibyte + (UTF-8 / CESU-8) in general + - When using “typeset -Z«n»” on an integer variable with a base other + than ten, zero-pad the value instead of the base – pdksh, oksh, zsh, + and AT&T ksh93 are wrong here; GNU bash doesn’t even have typeset + - Improve parsing of “set +o” output where done (dot.mkshrc, check.t) + - Improve regression tests + - Support for base-1 numbers: in non-utf8-hack mode, ‘1#x’ means the + same as the ASCII code for ‘x’ (e.g. 78hex), where ‘x’ is any single + octet (byte); in utf8-hack mode, ‘x’ is either a valid and minimali- + stically encoded UTF-8 multibyte character in the range 0000‥FFFD, + or a single octet with no trailing octets (bytes), which will then be + converted as if it were an ASCII value, or, if bit7 is set, be mapped + into the PUA range of EF80‥EFFF assigned by CSUR for this purpose; + this mapping is, in both cases, bidirectional; the planned base-0 + number support is not possible with the code, so use base-1 (with + utf8-hack disabled, or & 0xFF) instead (while it is recommended to + parse only single octets, there is a regression test showing correct + and safe multibyte parsing, which however is error-prone to implement + and thusly not recommended) – “genial” replaced@TNG, “this sounds + fun” ggergely, agreed bsiegert@ and others + - Pull in more current versions of supplied files; use Unicode 5.0 + - Clean up unused definitions in build system; document MKSH_CLS_STRING + - Remove advertising clause from copyright file; while we’d be pleased + to be mentioned if something contains our code, tg@ will no longer + enforce the requirement to advertise with that specific formula, and + we’d prefer if people remember the OpenHAL vs ath5k incident and that + they cannot simply change licencing of existing code; patches sent to + the MirOS Project for inclusion shall be accepted if they’re agreed + to match this licence + - Simplify dot.mkshrc sample file: licence is merged into the main + copyright file; AT&T ksh93 compatibility was improved + - Fix a display problem regarding fullwidth characters (e.g. CJK) + - Set the “C” locale in Build.sh for tool execution; otherwise, cer- + tain OEs behave strange; thanks to Adam “replaced” Hoka for spotting + - Use en_US.utf8 as UTF-8 locale for the testsuite for now + - If setlocale(LC_CTYPE, "") is not available, look at the environment + variables ourselves – brings UTF-8 support to poor OSes + - Remove some now-dead code; speed up configuration process; shrink + - Default to no setlocale(3) due to stubbed or missing locale support + on GNU/Cygwin, OpenBSD, OSF/1 in Build.sh; a few more that are quite + unlikely to have a UTF-8 locale: BSD/OS, Interix, Minix, PW32, + Ultrix, AT&T UWIN; default to always UTF-8 on Plan 9 + - Fix for testsuite unexpected failure if running as root in one case + - Initialise all shell integer variables (OPTIND, PPID, RANDOM, + SECONDS, TMOUT) to base 10 + - Reintroduce from mksh pre-R24 shell integer variable PGRP set to + the PID of the process group leader via getpgrp(2) + - New shell integer variable USER_ID set to the geteuid(2) and used + by dot.mkshrc to speed up logins, saves a spawn of id(1), mentioned + by and realisation planned with Andreas "gecko2" Gockel + - Fix dot.mkshrc tilde replacement in both $PS1 and the pushd/popd/dirs + implementation when the home directory is empty, the root directory, + or ends with a slash (disable replacement in that case) + - Support dietlibc, force it into providing a BSDish caddr_t + - Do not use LDFLAGS and LIBS while compiling with -c + - Add realpath(3) builtin, to further speed up logins and chdirs + - Optimise the code somewhat by making use of possible assumptions + - Set the “C” locale in test.sh as well to quell warnings + - Split the regression tests that use locale between en_US.utf8 and + en_US.UTF-8, since not all OSes support either one, and make only + HP-UX and GNU use the latter + - Fix kill, mknod(8) builtin usage msg, from Igor Sobrado via oksh + - Use proper ptrdiff_t casts for pointer arithmetics, inspired by an + oksh commit from Federico Schwindt + - Remove check category “pdksh” from check.t and test script + - Improve Darwin, OSF/1, HP aCC, SUNpro version reporting + - Support GNU bash “&>” extension, even better than they do, suggested + by Lukas “smultron” from MidnightBSD + - Basic support for LLVM+clang in the build system with experimental + “ccc” compiler driver; llvm-gcc worked as-is before already + - Better support for contributed arc4random.c file + - Do not spin if unlink(2) fails on $HISTFILE, from Decklin Foster + - Dump the perl(1) $^O variable in test.sh to logs + - Pull in latest changes from oksh + - Allow white space between a here string indicator and the string, + accidentally discovered by twkm (#ksh, freenode) + - Allow fd specifications outside the 0‥9 range for I/O redirections, + and bounds check them to be lower than the FDBASE definition, + currently still 10 if MKSH_SMALL, 24 otherwise (unportable) + - Improve the regression test suite: for one test, we had a bizarre + constraint telling it won’t work on UWIN, which was based upon false + assumptions, but Tru64 would fail it since its cat(1) unexpectedly + outputs some error messages (fix by closing stderr for cat); another + test would unexpectedly print no error message on Solaris (fix by + making the error message optional in the perlre(1) used) + - Switch back to en_US.UTF-8 for glibc, Debian can do both, Mandriva + fails on en_US.utf8 (XXX no libc5 auto-detection to disable it) + - IRIX also has no UTF-8 locale at all, confirmed by Elias Pipping + - Fix regression test suite for MKSH_SMALL + - Bring in latest changes from oksh (OpenBSD ksh, not DeliLinux crap) + - Fix abuse and unsafe use of str_save() and str_nsave() + - Optimise the implementations of str_save() and str_nsave() + - If MKSH_AFREE_DEBUG is defined, guard against afree()ing a pointer + which has not been allocated from the given pool, from Todd C. Miller + - Fix attempt to free a pointer to stack (function-local) storage when + redefining a function containing a call to the “time” built-in, + discovered by Elias Pipping, patch by Jared Yanovich, help from + Todd C. Miller + - Protect a little against people not running “./test.sh -v” but + calling it with, for instance, GNU bash (as homsn did…) + - Honour $PERL environment variable in test.sh, improve scanning for + Perl, do not use potentially undefined $^O, print Perl version + - Add as requirement (dietlibc) + - Work around bug in BSD/OS 3.1 /bin/ksh (PD KSH v5.2.8 96/08/19) + - Add regression tests from OpenBSD’s suite + - Use better CPPFLAGS for AIX, Minix 3 (from pdksh) + - Expose the “s ≠ NULL” str_[n]save_() API and use it where the string + can never be NULL (local stack storage), from gcc-4.2 warnings + - Clean up pointer-to-integer-cast warnings in the mirtoconf process + * New debian-policy version: 3.8.0.1 + - DEB_BUILD_OPTIONS: add -Wall to default CFLAGS, fix “noopt” handling, + add “nostrip” handling, ignore “parallel=«n»” as we cannot specify a + maximum value to Build.sh + - Convenience copies: switch from a contributed arc4random.c file to + using the new libbsd Debian package, 10x Hector, Guillem et Aurelien! + * debian/control: sync Description field with upstream suggestion + * Rename menu entry from "MirBSD ksh" to "MirBSD Korn Shell" for clarity + * Add a mksh-static binary, for initrd, initramfs, installer, rescue + * Integrate translation updates, ありがとう; Closes: #483506 + * Integrate translation updates, tack; Closes: #491950 + + -- Thorsten Glaser Tue, 22 Jul 2008 20:42:23 +0000 + +mksh (33.4-1) unstable; urgency=low + + * New upstream release; changelog: + - Move a portability define from sh.h to the setmode.c helper, as it’s + only needed there, and we want to use the latter from MirMake as well + - SECURITY: when spawning mksh on a new terminal, for example with + “sudo mksh -lT/dev/ttyC7”, flush all of that tty’s I/O first + - dot.mkshrc: ensure “ls” is no alias, don’t hardcode its path + * As dash won’t be the default /bin/sh without the current alternative + handling / debconf mechanism in lenny (as per the mail from Martin + Zobel-Helas), there is no need to act regarding our debconf scripts + and /bin/sh ability, so I think this Closes: #469675 + + -- Thorsten Glaser Fri, 11 Apr 2008 17:38:02 +0000 + +mksh (33.3-1) unstable; urgency=low + + * New upstream release; changelog: + - Handle Ultrix mmap(2) having a different prototype (returning a caddr_t + instead of a void * and not defining MAP_FAILED; making Ultrix 4.5 a + fully supported platform + - Decrease code size and optimise (using puts-style functions instead of + printf-style functions for fixed strings; bool instead of int) + - Correct behaviour of “export”, “export -p”, “readonly”, “readonly -p”, + “typeset”, “typeset -p”, “typeset” and their respective descriptions in + the manual page; problem reported by Danijel Tasov + - Work around dup2(2) problem (preserving the close-on-exec flag) on + Ultrix using code from mirbsdksh-1.11, lost in oksh + - Clean up Build.sh a little more + - Correct quotes and some other stuff in the regression tests; fix for + running with old Perl (5.002 or so, Linux 2.0, BSD/OS) + - Export the new “__progname” and “__perlname” environment variables to + the suite run from check.t in check.pl + - Do not mistake IBM xlC and VisualAge for different things, thanks to + Pascal “loki” Bleser from OpenSuSE for information on them + + -- Thorsten Glaser Wed, 02 Apr 2008 21:45:54 +0200 + +mksh (33.2-1) unstable; urgency=low + + * New upstream release; changelog: + - Fix some minor code issues remarked by MIPSpro + - Port to SGI IRIX 6.5 (uname: IRIX64) using gcc and MIPSpro + - Scan for a lot more compilers; add support for MIPSpro + - Ignore if the OS doesn’t define MAP_FILE for mmap(2) + - Use sys/types.h as sys/mkdev.h dependency + - Enable OSF/1 V2.0 /bin/sh to run Build.sh + - Add strcasecmp(3) proto for Ultrix 4.5 only (imake style) + - Add S_ISLNK if the OS doesn’t define it + - Use tempnam(3) if mkstemp(3) not found – not recommended + - Reduce dependency on certain OE facilities: printf(1), fgrep(1) being + able to scan for two patterns at the same time, perl5 being named perl + - New -T- option for dæmonisation, cf. man page + - Port to BSDi BSD/OS 3.1 (gcc 1.42 and gcc 2.7.2.1 supported) + - Simplify the dot.mkshrc file and make it more robust + - Report OE and $CC version in Build.sh, for logs + - Fix look’n’feel of the mksh(1) manual page, so that it still looks best + in AT&T nroff(1), looks much better in GNU groff (the PDF version we + place on the website), and looks some better and gains the ability to + copy’n’paste from it for GNU gnroff -Tutf8, originally prompted by + Patrick “aptituz” Schoenfeld and “lintian -viI mksh*.changes”, but then + improved (and nroff hacked) by tg@ a lot + - Shut up some gcc warnings (explicit braces; cast MAP_FAILED) + - Try to get rid of the test “if the compiler fails correctly” by using + the errorlevel of the $CC process (except with Microsoft Visual C++ + which returns non-zero even on success sometimes), thus supporting + DEC C on OSF/1 (and, quite possibly, gcc3 on Mac OSX Leopard) + - If revoke(2) and flock(2) are found, check if they’re declared + - Promote Tru64 to a fully supported operating environment, even though + it needs a plethora of _*_SOURCE defines and has SIGMAX instead of NSIG; + OSF/1 V4.0 and Tru64 (OSF/1 V5.1) are supported with both gcc and + HP/Compaq/DEC C in various versions + - Generalise the workaround for incompatible sig_t across the platforms + that need it (currently, OSF/1 and PW32) + - Shut up annoying warning about gcc 2.7.2.3, 2.8.1, 2.95.x not knowing + the “-std=gnu99” and “-std=c99” options without setting proper errorlevel + * Remove debdiffs for things included in upstream: + - manpage diff + - displaying of OS and compiler versions before build + * Update arc4random.c file from MirBSD contrib repository for now, until we + have libbsd in Debian !kfreebsd sid (coming soon I hope) + - fixes “warning: ignoring return value of ‘read’, declared with attribute + warn_unused_result” occuring on e.g. Fedora GNU/Linux + * Integrate translation updates, merci; Closes: #471009 + + -- Thorsten Glaser Fri, 28 Mar 2008 20:34:00 +0000 + +mksh (33.1-2) unstable; urgency=low + + * Help backporters by specifying explicitly versioned debconf/cdebconf + dependencies, thanks Patrick “aptituz” Schoenfeld for mentioning + * Integrate manpage diffs from mksh-current to fix “lintian -viI”, also + from aptituz, and a couple of other issues (' vs ’ vs ´, ' vs ‘ vs `, + - vs ‐ vs − vs – vs —, ^ and ~ in the Postscript version) + * Add a debian/watch file, idea from aptituz too, hints from uscan(1) + + -- Thorsten Glaser Tue, 04 Mar 2008 00:31:08 +0000 + +mksh (33.1-1) unstable; urgency=low + + * New upstream release; summary of changes: + - Sync with OpenBSD ksh (no real functional changes) + - Enhance the print builtin with two new escape sequences: \xAB + parses the next up to two hexadecimal digits AB and outputs a + raw octet (byte) whose ordinary value is AB; \uABCD parses up + to four hexadecimal digits and outputs the UTF-8 (CESU-8) re- + presentation of the unicode codepoint U+ABCD from the BMP + (Basic Multilingual Plane), not depending on the locale + - The . (“dot”) command (and its counterpart source) needs an + argument (the script to source); from Debian pdksh package + - In the lexer, do not expand aliases if there is an opening + parenthesis just after the token (from Debian pdksh). This + fixes the namespace issue that caused a POSIX function de- + finition stop() { … } to fail due to “stop” being a built- + in Korn shell alias. Now, aliases are removed when a POSIX + function with the same name is defined; Korn functions are + still different: their definition does not fail, but the + alias retains its precendence (unchanged behaviour) + - Accordingly, do not disable built-in aliases in POSIX mode any more + - Since POSIX mode now only turns off braceexpand mode (which + can then be turned back on), do not handle being called as -sh + or sh specially any longer + - Clean up the source code: make some constants private to the + only file using it; optimise; comment some code; improve + portability with regards to stupid tools in /usr/bin (or + /usr/xpg4/bin) and foreign compilers + - Implement “here strings” (like ksh93 or zsh; GNU bash col- + lapses white space if the string is not double-quoted): you + can now replace “print -r -- "$foo" | command” with + “command <<<"$foo"” with the very same semantics as + “command < Sun, 02 Mar 2008 16:12:59 +0000 + +mksh (32.1-1) unstable; urgency=low + + * New upstream release; summary of changes: + - Checks for symbol declarations are compile time checks, not link + time checks; fixes (optional) arc4random on AIX + - Widen the range for array indicēs to the entire unsigned 32-bit + integer range (enough for ino_t on BSD); wrap numbers outside of + that range into it for simplicity (e.g. foo[-1] = foo[4294967295]) + - Fix an internal error when using a pipeline as co-process + - Relax requirement on compilation environment to provide certain types + - Optimise some more for size (struct padding; functions → macros, …) + * Integrate galician translation, Closes: #447947 + + -- Thorsten Glaser Thu, 25 Oct 2007 18:36:27 +0000 + +mksh (31.4-1) unstable; urgency=low + + * New upstream release; summary of changes: + - Support pcc (the ragge version of the Portable C Compiler) + - Add pushd/popd/dirs functions (csh) and precmd/chpwd hooks (zsh) + to dot.mkshrc which now requires readlink(1) with -f; requested + by many (e.g. some Gentoo users; XTaran of symlink.ch) + - Enable colour escapes in dot.mkshrc since almost nobody groks how + to do it right from the manual + - Remove -DMKSH_NEED_MKNOD checks from Build.sh, people should use + the HAVE_MKNOD environment variable + - Implement parallel make in Build.sh (not used by Debian) + - Fix another busy-loop spinning problem introduced by an icc warning, + thanks to spaetzle@freewrt.org for keeping to bug me to look for it, + as it affected GNU/Linux most, followed by Solaris, rarely BSD + - Improve standard integer type detection in Build.sh + - Cleanups in code, build script and manual page + - Clean up Build.sh and “test … -o …” doesn’t exist in Bourne + - Detect if the non-standard u_int32_t type, which was unfortunately + used by the OpenBSD project in designing the standard arc4random(3) + API, is present (which it isn’t on Solaris), and, if not, emulate + it using the standard uint32_t (ISO C99) from , which we + fake as needed (if the standard integer types are not present, e.g. + on PW32 and OSF/1); change mksh as well as the arc4random.c + contribution to not use these non-standard types + - Remove unused types from the faked file + * Integrate updated translation into portugués, Closes: #444218 + * debian/rules: wait for script(1) to return, in case it runs + asynchronously; we have seen weird results on Debian and Fedora + + -- Thorsten Glaser Mon, 15 Oct 2007 18:23:01 +0000 + +mksh (31.2-1) unstable; urgency=low + + * New upstream minor release (R31b); summary of changes: + - Fix a syntax error in Build.sh checking for TenDRA + - Fix typo (blsk → bksl) in check.t test naming + - Autoscan for uint32_t, u_int etc. presence + - Fix some memory leaks, mostly by NetBSD® via OpenBSD + - The “unset” builtin always returns zero, even if the variable was + already unset, as per SUSv3 (reported by Arkadiusz Miskiewicz via + pld-linux and oksh) + - In tab-completion, escape the question mark, reminded by cbiere@tnf + - Fix a busy-loop problem, Debian #296446 via oksh + - Fix a few display output problems in the build script + - Shut up some gcc warnings on Fedora; beautify some code + - Support OSF/1 with gcc2.8, thanks to Jupp Schugt + - Fix gcc4 detection of __attribute__() on non-SSP targets + * debian/control: sync description with that of packages for other OSes + * debian/menu: Apps → Applications, as per Lintian + * debian/rules: do not run the testsuite with script on Debian GNU/HURD, + because some translators seem to be unable to cope with the chroot + * arc4random.c: use uint_t consistently, helps compiling on OSF/1 + + -- Thorsten Glaser Tue, 11 Sep 2007 14:00:20 +0000 + +mksh (31.1-1) unstable; urgency=low + + * New upstream release (R31); summary of changes: + - Support the TenDRA compiler (possibly also Ten15, not tried) + - Begin supporting Fabrice Bellard’s Tiny C Compiler (tcc on Debian + cannot link due to duplicate symbols in GNU libc, thus unfinished) + - Improve some mirtoconf checks (most notably, mknod(2) and macros) + - Add new emacs editing command “clear-screen” (ESC ^L) as requested + by D. Adam Karim + - Support building for MidnightBSD + - Add new shell alias “source”, semantics like the GNU bash builtin + - Add new shell option “set -o arc4random”, controlling whether + rand(3) or arc4random(3) is used for the $RANDOM value, use + arc4random_pushb(3) if it exists + - Add new builtin “rename” (just calls rename(2) on its arguments), + for rescue purposes (like renaming ld.so) + - Fix the inofficial OpenBSD port, from D. Adam “Archite” Karim, 10x + - Disable the less(1) history file by default (privacy issues) in the + sample dot.mkshrc file; mention other things in etc_profile (the + additional sample mentioned on the mksh website) + * Put the arc4random.c file under version control + * Clean up the copyright file (rm commented stuff from Debian experimental) + * Mention /dev/tty is also needed in debian/rules pre-build echo + + -- Thorsten Glaser Fri, 07 Sep 2007 19:34:25 +0000 + +mksh (30.1-1) unstable; urgency=low + + * New upstream major release (R30); summary of changes: + - Build on and for Solaris, Linux and MirBSD with Sun's C compiler + - No longer build a statically linked shell by default; do not try, + do not provide any means; user has to use LDFLAGS instead. + - Remove some probably dead mirtoconf checks + - Remove commented out -fwhole-program --combine check and still + active -fno-tree-vrp bug workaround thing, the latter because the + bug seems to only appear for functions that also exist as a builtin + (which was declared with the nonnull attribute) + - Fix a long-standing typo, 10x moritz@obsd + - Prefer more common signal names (SIGCHLD) over uncommon ones (SIGCLD) + - Quieten gcc and support SUNpro 5.8 on Solaris 10 on sparc64 + - Optimise signal handling and detection; enable compilers whose + præprocessor doesn't have -dD to generate list of signals + - Optimise mirtoconf meta-checks for persistent history etc. + - Fix a bug preventing manual page generation on Solaris + - Add support for the Intel® C Compiler and quieten it a little; + fix a few minor buglets (mostly type conversion) its too verbose + warnings show, as well as some errno ab-/mis-use + - Remove support for honouring the CPP environment variable; + $CC -E - is simply used instead in the places where $CPP was used + previously, because that was used in other places already, and + to prevent it from behaving differently from the $CC used + - If a file called arc4random.c is lying around in the source directory + at mirtoconf time, scan for and use the file if + arc4random(3) isn't found otherwise. From Debian GNU/kFreeBSD. + - If the basename of argv[0] starts with “sh”, activate FPOSIX early, + preventing some typical ksh aliases from being defined + - If FPOSIX, don't pre-define aliases (except integer and local) to + benefit operating environments that never heard of the great Korn Shell… + - #if defined(MKSH_SMALL) || defined(MKSH_NOVI) disable the vi editing mode + - Don't try to execute ELF, a.out, COFF, gzip or MZ binaries + - Can be built on HP-UX (PA-RISC and IA64) with gcc or HP C/aC++ + - Support x=(a b c) bash-like array initialisation + - Support ${foo:2:3} bash-like substring expansion + - Many mirtoconf improvements, fixes; speed-up; better portability + - Enable compilation using Microsoft C/C++ Standard Compiler + - Add UWIN build target using various compilers with the cc wrapper + - Fix struct padding mistakes uncovered by the Microsoft compiler + - Fix double initialisation / unused value assignment errors + unveiled by Borland C++ Builder 5.5 + - Fix superfluous code detected by gcc 4.2 + - Fix large file support for OSes that require CPPFLAGS contains + -D_FILE_OFFSET_BITS=64 – it was detected but not actually used + in the build; thanks to hondza for the problem report! + - Give the lexer a bigger state stack if !MKSH_SMALL + - Prepare for addition of make(1)-style search/replace operations; + correct the code for other substitution expansion operations + - Default $CC to cc not gcc, this is no non-unix-ware ☺ + - Support AIX with gcc and xlC; clean up code to warning-free + - Prefer well-known signal names to alphabetically earlier ones + - Fix a bug delivering ERR and EXIT pseudo-signals to traps combined + with “set -e”, thanks Clint Pachl and Otto Moerbeek for the hint + * Update German translation, Closes: #428590 (still pending resolution + of the dash-as-/bin/sh and debconf common field issue described in + http://thread.gmane.org/gmane.linux.debian.devel.release/17423 so + please do not submit new translations until that issue is resolved) + * Reflect changes in the description in debian/control + + -- Thorsten Glaser Thu, 26 Jul 2007 20:25:02 +0000 + +mksh (29.6-2) unstable; urgency=low + + * Re-run debconf-updatepo which was missed after we changed note into error + * Fix arc4random on HURD by integrating it into the Build.sh script and + scanning for prerequisite headers + + -- Thorsten Glaser Sun, 10 Jun 2007 07:51:06 +0000 + +mksh (29.6-1) unstable; urgency=low + + * New upstream formal release; summary of relevant changes: + - Remove some redundant or unused functions + - Fix several horizontal scrolling, display, scrollbar, etc. bugs + unveiled by David Ramsey + - Fix a few bugs found by Coverity Scan + - Optimise dot.mkshrc sample file; add a speed alias + - Fix a few shortcomings in the build system + * Pull in arc4random support + * Make it possible to install mksh as /bin/sh the same way as + dash does, copy the necessary files from dash (my apologies to + the translators, I simply search'n'replaced the term dash by mksh) + * Install dot.mkshrc as /etc/skel/.mkshrc conffile + + -- Thorsten Glaser Mon, 28 May 2007 18:12:23 +0000 + +mksh (29.3-1) unstable; urgency=low + + * New upstream formal release; summary of changes: + - portability fixes (darwin, hp-ux, solaris, new port to aix) + - size optimisation if utf-8 mode is assumed by default (not in Debian) + - small manual page fixes + - Do not scan for and use "-fwhole-program --combine" because it's the + cause of at least http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408850 + and breakage with FORTIFY_SOURCE on SuSE; thanks to Pascal Bleser (yaloki), + Marcus Rueckert (darix), Martin Zobel-Helas, Steve Langasek (vorlon) for + tracking this bug down in two different places; Closes: #421518 + * remove the possible workaround mentioned in the changes for 28.9.20070309 + because the problem has been solved upstream + + -- Thorsten Glaser Mon, 30 Apr 2007 21:53:12 +0000 + +mksh (29.2-1) unstable; urgency=low + + * New upstream formal release; summary of changes: + + a plethora of UTF-8 fixes: + - display control characters U+0080..U+009F the same as U+0000..U+001F, + i.e. a caret followed by the character corresponding to the control + character XOR 0x0040, treat their width as 2 subsequently + - fix crash (cpu hog in spinning loop) on meta-tab + backspace + - strip off UTF-8 byte order mark at beginning of input + - if a BOM is encountered, switch on utf-8 command line editing mode + + in utf-8 command line editing mode, handle invalid input more strictly: + - if in x_literal(), i.e. the ^V mode (bind to quote), allow it as before + - if it's the start of an invalid multibyte sequence, reject with a beep + (e.g. if trying to input latin1 chars) + - if it's an invalid or partial multibyte sequence, reject silently + -> this makes command line editing much more robust + + other bug fixes: + - in a rare condition (error path), the wrong function was used to copy + a string that could contain embedded NULs (encoded format), leading to + memory access past malloc'd area + - in the same path, fix an out-of-bounds access inherited from openbsd ksh + -> discovered on Debian GNU/Linux experimental ia64, glibc 2.5-beta + + new functionality: + - if execve() fails, before passing the file to $EXECSHELL, open it and + try to parse a shebang line; if we find one, do it ourselves + (the good part of this is that it even works when there is a UTF-8 BOM + before the shebang magic sequence) + - for shebang processing, not only NUL or LF but also CR terminate the line + - enhancements to the "dot.mkshrc" sample file (which is now regularily + used upstream as well) + - if the internal function exchild() fails, don't just tell the user that + it failed, tell him WHAT failed (unless -DMKSH_SMALL) + + code cleanup changes: + - remove unused functions, macros + - fix typos, errors, etc. + - shut up gcc 4.1.2 warnings + - Build.sh cygwin vs unix cleanup/simplification + - shrink manual page to 39 DIN A4 pages when output as postscript + + reliability changes: + - if $CC supports -fstack-protector-all, add it to $CFLAGS + - if $CC supports -fno-tree-vrp, add it to $CFLAGS if $CC is subject to + the bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30785 + - add mirtoconf check for "large file support", requested by bsiegert@, + needed for some *nix, idea and implementation hints from GNU autoconf + - add zsh workaround to Build.sh, just in case (untested) + * disable the possible workaround mentioned in the changes for 28.9.20070309 + because I was unable to verify/test it; maybe it only applies to the glibc + in experimental anyway, we'll see to that later + * add a comment about the regression test needing openpty() to debian/rules + * remove non-ASCII (i.e. high-bit7) characters from diff/changelog + * slightly enhance package description + * properly indent homepage link in description, thanks KiBi (kfreebsd team) + + -- Thorsten Glaser Wed, 25 Apr 2007 11:36:42 +0000 + +mksh (28.9.20070309) experimental; urgency=low + + * Add possible workaround for #408850 by disabling -std=gnu99 (untested) + so that this package at least compiles on Alpha until the bug + can be fixed + * Restore Debian prefix in copyright file accidentally lost in 28.9.20070304 + * Do not build-depends-on-essential-package-without-using-version, remove + explicit dependency on bsdutils + + -- Thorsten Glaser Sat, 10 Mar 2007 01:12:20 +0000 + +mksh (28.9.20070304) experimental; urgency=low + + * Due to failures like this one: + ``cat: /build/buildd/mksh-28.9.20070218/builddir/screenlog.0: + No such file or directory'' + in http://experimental.ftbfs.de/fetch.php?&pkg=mksh&ver=28.9.20070218&arch=powerpc&stamp=1171913314&file=log&as=raw + - remove the use of GNU screen to run the testsuite again + - use 'script' from the Debian bsdutils package) to run the + regression test suite within a controlling tty + (this is experimental) + * New upstream release candidate; summary of changes: + - Work around Solaris /usr/ucb/tr, Solaris /usr/xpg4/bin/tr, + Minix 3 /usr/bin/tr, and SUSv3 deficiencies + - Fix compilation on more platforms (Interix, Cygwin, Linux 2.0 libc5, + Debian GNU/kFreeBSD, Debian GNU/HURD, ...) + - Use autoconfiguration for persistent history stuff + - Fix the code (add "const" in like 1001 places) to be able to + build without -Wno-cast-qual (hope it's safe now) + - Optionally use const-debugging versions of strchr(3), strstr(3), + to work around deficiencies in ANSI C + - The above directly led to our own strcasestr(3) implementation + for OSes which don't have it + - Optimise dot.mkshrc macros + - Remove shadowing warnings for more OSes + - Support old ash(1) versions in Build.sh + - Support use of _NSIG for NSIG + - Optimise ctags(1) generation + * Honour ${CC} + + -- Thorsten Glaser Tue, 6 Mar 2007 03:44:58 +0000 + +mksh (28.9.20070218) experimental; urgency=low + + * New upstream development snapshot; summary of changes: + - fix 'hd' alias in dot.mkshrc example to not run off + an ANSI standard 80 column screen; simplify + - integrate MKSH_NEED_MKNOD and MKSH_ASSUME_UTF8 with Build.sh + + -- Thorsten Glaser Sun, 18 Feb 2007 20:34:48 +0000 + +mksh (28.9.20070216) experimental; urgency=low + + * New upstream development snapshot; summary of changes: + - if MKSH_SMALL, don't include -T support and don't scan + for revoke() function + - new #ifdef MKSH_NEED_MKNOD to embed mknod(8) even if + MKSH_SMALL is enabled + - do not scan for revoke() on GNU/Linux since it always fails + - simplify GNU/Linux CPPFLAGS and use them for GNU/HURD and + GNU/kFreeBSD (tested on Debian experimental, thanks to the + ftbfs.de autobuilder and Michael "azeem" Banck) + - fix the 'bind' (no args) builtin output + - new #ifdef MKSH_ASSUME_UTF8 to not check setlocale() and + nl_langinfo(CODESET) if we want to always enable the utf-8 + command line editing mode + - tabcomplete a newline to singlequote+newline+singlequote + instead of backslash+newline which is eaten; thanks to + Thomas E. "TGEN" Spanjaard for noticing + - remove shebang line from check.pl which isn't +x anyway + * control: add ed(1) as suggested package, for history editing + * control, rules: add GNU screen as build dependency; use it to + provide a tty to the regression test suite so it can succeed in + the Debian autobuilding mechanism; tested on i386-linux, i386-hurd + * control: only the emacs editing mode is utf-8 safe (fix description) + + -- Thorsten Glaser Fri, 16 Feb 2007 20:32:52 +0000 + +mksh (28.9.20070118) experimental; urgency=low + + * New upstream development snapshot; summary of changes: + - autoconfify compiler flags, c preprocessor + - add option to avoid pulling in getpwnam(3) in !MKSH_SMALL + - scan for certain headers, types; improve portability + - speed up autoconfiguration process in failure case + - finally fix static vs dynamic linking issues + - fix manpage (.Nm macro) glitch with GNU nroff 1.15 + - improve auto-detection of which regression tests are valid + - mention failure to revoke(2) is possibly insecure + * As a result of upstream changes, simplify debian/rules + * Testsuite failues are not fatal for Debian + * Please note: this is a development snapshot from CVS, but this + one is deemed "gamma stadium" (i.e. more stable than beta, and + ready for public consumption by a broad mass of testers). + + -- Thorsten Glaser Thu, 18 Jan 2007 20:57:40 +0000 + +mksh (28.9.20070117) experimental; urgency=low + + * Add -fwrapv to Debian CFLAGS to prevent unexpected code behaviour + * New upstream development snapshot; summary of changes: + - Don't expand ~foo/ if MKSH_SMALL, spares getpwnam(3) call + - Fix and autoconfify signal list generation + - Build.sh now uses $TARGET_OS as "uname -s" output for cross builds + - Set flag for regression tests that can't succeed if MKSH_SMALL + - Don't even check for setlocale(3) if MKSH_SMALL, unless overridden + by user / build environment + - Scan for C Preprocessor, use $CPP if $CC -E fails + - Fix possible nil pointer dereferences and signal name mismatches + - Scan for __attribute__((...)) and -std=gnu99 (req'd on Solaris 10) + - Correct $LDSTATIC logic, unbreak -d, don't let the user override (or + need to) $SRCS, $sigseen + - Simplify TIOCGWINSZ handling, no need to catch SIGWINCH any more; + window size changes are processed after input line editing ends (i.e. + the lines are entered or ESC # (emacs mode) is pressed) and at + startup; ^L (redraw) can't change window size on the fly + - Add -fwrapv to standard CFLAGS, just to be safe, like with when I + added -fno-strict-aliasing; this is pending a bug fix in gcc, see + GCC PR#30477 + * Please note: this is a development snapshot from CVS as well; + it may be included into Debian experimental, but is not recom- + mended for Debian testing. + + -- Thorsten Glaser Sat, 17 Jan 2007 09:32:11 +0000 + +mksh (28.9.20070106) experimental; urgency=low + + * New upstream development snapshot; summary of changes: + - Fix UTF-8 locale detection and segfaults + - Use RLIMIT_AS if RLIMIT_VMEM is not available + * Please note: this is a development snapshot from CVS as well; + it may be included into Debian experimental, but is not recom- + mended for Debian testing. + + -- Thorsten Glaser Sat, 06 Jan 2007 18:55:09 +0000 + +mksh (28.9.20061211) experimental; urgency=low + + * New upstream development snapshot; summary of changes: + - Spelling and wording fixes in the manual page and copyright file; + keep the latter in sync with the latest MirOS licence template + - One correct cast for the ulimit builtin + - Portability #warning for developers (not seen on BSD, but + yields a TODO for Debian) + * Please note: this is a development snapshot from CVS as well; + it may be included into Debian experimental, but is not recom- + mended for Debian testing. If you already have 28.9.20061121, + like the SuSE guru repository of loki, you do not need this + minor update. + + -- Thorsten Glaser Mon, 11 Dec 2006 21:53:42 +0000 + +mksh (28.9.20061121) experimental; urgency=low + + * Add -fno-strict-aliasing to default CFLAGS, as per upstream suggestion + * New upstream development snapshot; summary of changes: + - Fix portability of regression tests using fgrep(1), twice + - Fix description of $RANDOM in manual page + - Fix build under OpenSolaris Build 47 (reported in IRC) + - Use easier __RCSID() stuff from MirOS #9-current + - Don't shebang with spaces in test.sh creation + - Remove -fno-strength-reduce from default CFLAGS, the compiler bug was + fixed between gcc 2.7.2 and gcc 2.7.2.1... + - Avoid unaligned memory access causing SIGBUS on IA-64 on Debian + - Convert to autoconf-style check for function and header file existence + of , arc4random(3), arc4random_push(3), setlocale(3) and + LC_CTYPE, nl_langinfo(3) and CODESET, getmode(3) and setmode(3), + strcasestr(3), and strlcpy(3) + - Add set -o utf8-hack aka mksh -U which changes the Emacs editing mode + to an experimental CESU-8 aware multibyte mode (not implemented using + wide chars unless internally needed; does not require OS support); check + setlocale(LC_CTYPE, "") and nl_langinfo(CODESET) if found to auto-enable + utf-8 mode in interactive shells + - Simplify and clean up code; try to remove or replace function calls by + smaller equivalents; spot a few non-fatal off-by-one errors + - If Build.sh is called with -DMKSH_SMALL in the CPPFLAGS environment + variable, the built-in mknod(8) will not be included, and other + functionality and verbose usage messages will be excluded; some macros + will be turned into functions to save space and to check if the + utf8-hack should be enabled, nl_langinfo(3) is not called. The -T + option to mksh(1) and persistent history are not supported. + - Hand-optimise the code to be small, even in the normal build + - Unbreak the -d option to Build.sh + - Check for cc options -Wno-error, -fwhole-program --combine, and (if + MKSH_SMALL) -fno-inline and use them if they don't fail + - The autoconf-style ("mirtoconf") checks have been enhanced, + improved and be made more verbose by default + - Rewrite a few functions both to save space and to simplify/unify the + code; also spotted a few bugs in existing (inherited) code + - Fix format string mistakes and wrong function and data prototypes + - Correct zero-padding for right-justified strings; add regression test + - EXECSHELL is now ${EXECSHELL:-/bin/sh} again + - Remove duplicate code if feasible; rewrite remaining code to solve all + use cases, or use standard library functions such as qsort(3); rework + the ctypes and chtypes stuff, get rid of libc/ctype.h + - Change the eaccess() code to not use setreuid(2) and friends, like + OpenBSD ksh and apparently pdksh. I'm not too sure about the + implications, except that they only affect setuid shell scripts. + - Use setresuid(2) and friends, and setgroups(3) and instead + of seteuid(2), setuid(2) etc. on operating systems that support them + - Work around (i.e. remove) all but two -Wcast-qual issues + - Work around a bug in the GNU implementation of the Berkeley mdoc macros + which comes with GNU groff (only visible in MirOS with groff -mgdoc, but + shows on other operating systems), discovered by crib in IRC + - $RANDOM is always an unsigned 15-bit decimal integer, for all Korn shell + derivates; idea from twkm in IRC + - Improve/correct description of typeset command in manpage, and + implementation of typeset -p in mksh + - Remove the non-standard emacs-usemeta and vi-show8 shell options, assume + the user either has a 7-bit environment, an 8-bit clean terminal, or a + UTF-8 environment (preferred), and the dummy sh option + - Build.sh fix for conservative (old) versions of gcc; help Debian + * Mention UTF-8 support in the Debian control file's Description field + * PLEASE NOTE: this is not intended to be uploaded into testing, because + it is based upon a CVS checkout of mksh-current, and not of a formal + release. The "mksh 28.9.yyyymmdd" series is based upon CVS snapshots of + mksh-current (mksh R29-beta), and subject to changes. This part of the + changelog might differ in the following mksh-29.0-1 upload to Debian. + This code is *not* well-tested and may have been broken on various other + operating systems and maybe architectures; it may have introduced further + memory leaks. It is recommended to only use it to evaluate mksh's recent + development and help finding bugs and fixing them. No warranty, as usual. + + -- Thorsten Glaser Tue, 21 Nov 2006 21:49:44 +0000 + +mksh (28.0-2) unstable; urgency=low + + * Fix unaligned memory access on IA-64 (same fix was applied + upstream for the next full release) + + -- Thorsten Glaser Sat, 30 Sep 2006 19:59:10 +0000 + +mksh (28.0-1) unstable; urgency=low + + * sample file (dot.mkshrc) is now in upstream + * New upstream release; summary of (Debian user relevant) changes: + - Fix some more -Wchar-subscripts + - Adjust manual page to the fact that mksh can be used as + /bin/sh although it's not specifically designed to + - Correct and enhance book citation list in the manual page + - Bring back the "version" editing command in both emacs and + vi modes, at ESC ^V like AT&T ksh93r+ + - Fix typo which resulted in the wrong names for signals being + printed (error codes were used instead) on GNU/Linux, Solaris + and GNU/Cygwin. Ease changing signame/siglist sources. + - Some more code, manual page, build system and regression test + changes, cleanup and redundancy removal + - Merge a few OpenBSD changes, yielding better multiline prompt + support and textual improvements in the manual page + - Adjust $PS1 sizing, printing, and redrawal routines + for mksh behaviour and single- and multiline prompts + - For the AT&T $PS1 hack (second char = CR), do not + output the delimiting characters any more, even if they + are printable - fixes platforms without non-printable + characters (Interix, Cygwin) and prompt size calculation + - Calculate length of prompt in lines and columns-of-last-line + instead of using some tricks to skip the beginning of the prompt, + resulting in correct redrawing of prompts with ANSI colour codes + - Correct displaying of prompts spanning more than one line + and/or with embedded newlines or carriage returns; correct + documentation of $PS1 and the redraw editing command + - Change one of the testsuite "expected failure" tests from bug + to feature - it might actually be required by BSD make + - Enable to bind key sequences which consist of the usual optional + one or two praefices and the control character, as well as an + optional trailing tilde (if the trailing character is not a tilde, + it's processed as usual, but processing of the editing command is + postponed until after the trailing character has been read) + - Bind the NetBSD(R) wscons (vt220 / wsvt25), GNU screen and + XFree86(R) (xterm-xfree86) "home", "end" + and "delete" keys to ^A, ^E and ^D, respectively, except + that "delete" does not act as logoff switch + - Make sure ^T is bound to 'transpose' as documented + (bug spotted by hondza) + - Remove the 'stuff' and 'stuff-reset' editing commands + - Correct the manual page regarding the 'abort' command, its + interaction with 'search-history' and how to exit the latter + - Bring back "set -o posix" turning off 'braceexpand' + - Mention IRC support channel and mailing list in manual page + - Make the "last command of a pipeline is executed in a + subshell" issue a dependable mksh feature + - Improve regression test comments and a few tests + - If $RANDOM is generated from arc4random(3), display at + most 31 bits of it like nbsh(1), instead of only 15 bits. + + -- Thorsten Glaser Sat, 9 Sep 2006 11:49:07 +0000 + +mksh (27.4-2) unstable; urgency=low + + * Fix build if zsh is used as build shell by forcing /bin/sh + + -- Thorsten Glaser Fri, 7 Jul 2006 19:25:32 +0000 + +mksh (27.4-1) unstable; urgency=low + + * New upstream release; summary of changes: + - build system fixes (honour CPPFLAGS, ...) + - documentation fixes (manual page date/version) + - only source ${ENV:-~/.mkshrc} for interactive (FTALKING) shells + (change in behaviour towards principle of least surprise) + - fix "char subscripts" warnings + * Be more verbose on build, to aid debugging the buildd logs + * Install a sample ~/.mkshrc file showing how flexible mksh is and + providing a bash-like $PS1 to the user + * Add persistent (official) homepage to package description + + -- Thorsten Glaser Tue, 4 Jul 2006 15:42:23 +0000 + +mksh (27.2-1) unstable; urgency=low + + * New Debian Standards-Version, no changes for us + * New upstream release; summary of changes: + - emacs-usemeta now behaves like vi-show8 to facilitate + e.g. japanese UTF-8 input on the command line (such as + filenames); be careful with 0x80-0x9F + - portability cleanup and speed-up + - GNU groff compatible manual page + - add ~/.mkshrc processing, requested by Jari Aalto for + the Debian-based Stem Desktop; see manual page for details + - illustrate a few tricks (e.g. setting $PS1) in manual page + - enhance testsuite + - incorporate some more code cleanup by OpenBSD + - reference the O'Reilly books in the manual page + * As a result, remove some patches now in upstream + * Add ed(1) as build dependency, needed for regression tests + + -- Thorsten Glaser Wed, 31 May 2006 18:58:16 +0000 + +mksh (26.2-2) unstable; urgency=low + + * There was another .St -susv3 in the manual page; + replace it by the expanded version. + * No comma in front of "which" in English (copyright file) + + -- Thorsten Glaser Thu, 2 Feb 2006 18:08:34 +0000 + +mksh (26.2-1) unstable; urgency=low + + * New upstream release; summary of relevant changes: + - Change quoting policy (regarding backslash-doublequote) in + here documents to conform to SUSv3 (to migrate, change all + occurences of backslash-doublequote to just doublequote) + - Update documentation + - Clean up code + - Fix some more GCC 4 warnings + * Remove no longer needed workaround + + -- Thorsten Glaser Mon, 30 Jan 2006 12:03:02 +0000 + +mksh (25.0-1) unstable; urgency=low + + * New upstream release; summary of changes: + - add a builtin: mknod (can do pipes and devices) + - remove 'version' editor binding and remap emacs ^V to + quote-meta ('literal') + - fix redraw and window resize problems; COLUMNS and LINES + are now updated as soon as the new size is set + - allow < and > for test and [, not only [[ + - if an array index is out of bounds, tell which one + - document quoting policy in here documents + - correct some mistakes in the manual page + - fixes for GCC 4 warnings + - code and build system simplifications + * As a result, simplify debian/rules accordingly + * Copy all "non-standard" licences into the copyright file + * Work around GNU groff not having .St -susv3 + + -- Thorsten Glaser Wed, 26 Oct 2005 09:27:39 +0000 + +mksh (24.0-1) unstable; urgency=low + + * New upstream release; relevant changes are: + - no longer look at argv[0] to determine if restricted shell + - changes to $EDITOR and $VISUAL no longer affect + the current editing mode + - emacs on, emacs-usemeta off is now the default editing mode + - the special "posix" and "sh" modes are gone + - code, test suites and documentation have been cleaned up a little + - Korn's bizarre /dev/fd hack is now no longer supported + - undo fix for Debian PR #71256 which turned to be bogus + and break BSD make + - fix compilation and invocation of test suite with whitespace + in the pathnames for real, this time + * Fix typo in description; Closes: #317785 + * Note that this is no superset of pdksh any more in description + * New debian-policy version + + -- Thorsten Glaser Tue, 12 Jul 2005 12:25:11 +0000 + +mksh (23.0-1) unstable; urgency=low + + * New upstream version + * Clarify licence + + -- Thorsten Glaser Wed, 22 Jun 2005 14:40:56 +0000 + +mksh (22.3-1) unstable; urgency=low + + * Update upstream source to mksh R22d + * Remove some superfluous whitespace + + -- Thorsten Glaser Sun, 5 Jun 2005 16:45:42 +0000 + +mksh (22.2-2) unstable; urgency=low + + * Rename postinst, prerm, menu to mksh.{postinst,prerm,menu} + * Always run testsuite + * Install the binary with 755 permissions + * Remove superfluous grep in rules + (All of the above based upon suggestions by sponsor Bastian Blank) + * Use dh_install instead of homegrown calls (patch by Bastian Blank) + * Regenerate .orig.tar.gz with MirBSD cpio since GNU cpio generates + invalid ustar archives (broken mtime) + + -- Thorsten Glaser Thu, 2 Jun 2005 07:47:33 +0000 + +mksh (22.2-1) unstable; urgency=low + + * Initial Release + + -- Thorsten Glaser Sat, 28 May 2005 22:02:17 +0000 --- mksh-40.4.orig/debian/watch +++ mksh-40.4/debian/watch @@ -0,0 +1,6 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/watch,v 1.2 2009/08/01 15:33:42 tg Exp $ + +version=3 +# convert upstream versioning to Debian version numbers +opts="uversionmangle=s/^([0-9]+)$/$1.1/;s/^([0-9]+)b$/$1.2/;s/^([0-9]+)c$/$1.3/;s/^([0-9]+)d$/$1.4/;s/^([0-9]+)e$/$1.5/;s/^([0-9]+)f$/$1.6/;s/^([0-9]+)g$/$1.7/;s/^([0-9]+)h$/$1.8/;s/^([0-9]+)i$/$1.9/" \ +http://www.mirbsd.org/MirOS/dist/mir/mksh/ mksh-R([0-9]+[b-i]?)\.cpio\.gz --- mksh-40.4.orig/debian/mtest.t +++ mksh-40.4/debian/mtest.t @@ -0,0 +1,44 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mtest.t,v 1.5 2011/12/10 14:26:33 tg Exp $ +#- +# Catch the most basic failures to run (broken ABI, signals, dietlibc bug) +# Failures to pass these leads to the binary being thrown away, if run + +name: mtest-builtin +description: + Minitest: can run a builtin +time-limit: 3 +stdin: + echo foo +expected-stdout: + foo +--- +name: mtest-external +description: + Minitest: can run an external utility and return +time-limit: 3 +stdin: + echo baz | /usr/bin/tr z r + echo baz +expected-stdout: + bar + baz +--- +name: mtest-ascii1 +description: + Part of dollar-quoted-strings +stdin: + printf '<\1\n'|while read x;do while [[ -n $x ]];do typeset -i16 hv=1#${x::1};x=${x:1};echo -n "$hv ";done;done;echo . +expected-stdout: + 16#3c 16#1 . +--- +name: mtest-brkcontin +description: + Check that break and continue work; used by test.sh itself + and broken at least once on *buntu +stdin: + for x in "echo 1" false "echo 2"; do $x && continue; echo 3; break; done; echo 4 +expected-stdout: + 1 + 3 + 4 +--- --- mksh-40.4.orig/debian/mksh32.xpm +++ mksh-40.4/debian/mksh32.xpm @@ -0,0 +1,294 @@ +/* XPM */ +static char *mksh32[] = { +/* $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh32.xpm,v 1.1 2009/08/01 17:43:00 smultron Exp $ */ +"32 32 256 2", +/* colours */ +" c None", +". c #0E0705", +"+ c #0F0907", +"@ c #100A08", +"# c #110B0A", +"$ c #120D0B", +"% c #150E05", +"& c #130E0C", +"* c #160F06", +"= c #140F0E", +"- c #171008", +"; c #15100F", +"> c #181109", +", c #161110", +"' c #111310", +") c #18120A", +"! c #161211", +"~ c #1D110C", +"{ c #171312", +"] c #1D120D", +"^ c #141513", +"/ c #1A140D", +"( c #1E130E", +"_ c #191514", +": c #1F140F", +"< c #151714", +"[ c #191615", +"} c #1F1510", +"| c #1C1610", +"1 c #1E170B", +"2 c #1D1711", +"3 c #22160D", +"4 c #211612", +"5 c #1B1817", +"6 c #1D1812", +"7 c #181917", +"8 c #221713", +"9 c #20190F", +"0 c #1D1918", +"a c #1F1914", +"b c #1D1A19", +"c c #201A15", +"d c #201B16", +"e c #241A16", +"f c #1F1C1B", +"g c #1C1D1B", +"h c #211C17", +"i c #221C17", +"j c #231D18", +"k c #1E1F1D", +"l c #221E1D", +"m c #241E19", +"n c #261F15", +"o c #231F1E", +"p c #20211F", +"q c #24201F", +"r c #26211B", +"s c #252120", +"t c #252120", +"u c #28221D", +"v c #222421", +"w c #232422", +"x c #2B241A", +"y c #282423", +"z c #2A241E", +"A c #2A241F", +"B c #292524", +"C c #2B2520", +"D c #252724", +"E c #2C2621", +"F c #272826", +"G c #2B2726", +"H c #2D2722", +"I c #2F281E", +"J c #2E2822", +"K c #2F2924", +"L c #352820", +"M c #302A25", +"N c #2F2A29", +"O c #2A2C29", +"P c #2F2B2A", +"Q c #332D28", +"R c #2E2F2D", +"S c #322E2D", +"T c #332F2E", +"U c #352F2A", +"V c #34302F", +"W c #30322F", +"X c #37312B", +"Y c #363231", +"Z c #38322C", +"` c #383433", +" . c #3A342E", +".. c #3B342F", +"+. c #343633", +"@. c #353734", +"#. c #3B3736", +"$. c #3D3731", +"%. c #373936", +"&. c #383937", +"*. c #3C3837", +"=. c #3F3933", +"-. c #3E3A39", +";. c #403A34", +">. c #413A35", +",. c #403B3A", +"'. c #423B36", +"). c #3B3D3A", +"!. c #413C3B", +"~. c #433C36", +"{. c #3D3E3C", +"]. c #4A3D39", +"^. c #433F3E", +"/. c #453F39", +"(. c #40413F", +"_. c #484035", +":. c #4D3F36", +"<. c #454140", +"[. c #414341", +"}. c #48423C", +"|. c #474241", +"1. c #504239", +"2. c #434542", +"3. c #494443", +"4. c #4B443E", +"5. c #51433A", +"6. c #52433A", +"7. c #544436", +"8. c #53453C", +"9. c #4C4746", +"0. c #4E4741", +"a. c #484947", +"b. c #4E4948", +"c. c #59493B", +"d. c #4A4C4A", +"e. c #4F4B4A", +"f. c #514B45", +"g. c #584A41", +"h. c #504C4A", +"i. c #524D4C", +"j. c #5E4C39", +"k. c #534E4D", +"l. c #4E504D", +"m. c #5F4D3A", +"n. c #4F514E", +"o. c #614F3B", +"p. c #58514B", +"q. c #515350", +"r. c #64523E", +"s. c #635244", +"t. c #545553", +"u. c #5D5449", +"v. c #6D533C", +"w. c #5B5756", +"x. c #705438", +"y. c #6F543E", +"z. c #695743", +"A. c #5D5957", +"B. c #69584A", +"C. c #5B5D5A", +"D. c #6B5A4C", +"E. c #5D5F5C", +"F. c #795C3A", +"G. c #65605F", +"H. c #7B5E3C", +"I. c #7D5F3E", +"J. c #686362", +"K. c #7C614A", +"L. c #666765", +"M. c #7E634B", +"N. c #88623D", +"O. c #816448", +"P. c #686967", +"Q. c #8A643F", +"R. c #696B68", +"S. c #856745", +"T. c #8C6641", +"U. c #85684B", +"V. c #8E6842", +"W. c #6C6E6B", +"X. c #896A48", +"Y. c #936C40", +"Z. c #717370", +"`. c #966E3C", +" + c #787372", +".+ c #956F49", +"++ c #976F44", +"@+ c #98703E", +"#+ c #A07141", +"$+ c #9B7347", +"%+ c #777976", +"&+ c #A4743E", +"*+ c #797B78", +"=+ c #9E764A", +"-+ c #7A7C79", +";+ c #817C7B", +">+ c #A77747", +",+ c #A37948", +"'+ c #A87848", +")+ c #AC7A45", +"!+ c #AE7B3F", +"~+ c #858784", +"{+ c #B97F45", +"]+ c #B58145", +"^+ c #B4814B", +"/+ c #8B8D8A", +"(+ c #C28646", +"_+ c #C98C45", +":+ c #CC8E47", +"<+ c #D18D48", +"[+ c #989A97", +"}+ c #D1934C", +"|+ c #D79246", +"1+ c #D99348", +"2+ c #9D9F9C", +"3+ c #DB954A", +"4+ c #9EA09D", +"5+ c #DF9745", +"6+ c #A1A3A0", +"7+ c #E19947", +"8+ c #E29A48", +"9+ c #A3A5A1", +"0+ c #E39C49", +"a+ c #A4A6A3", +"b+ c #EA9B4B", +"c+ c #E69E4B", +"d+ c #A6A8A5", +"e+ c #ED9D46", +"f+ c #A7A9A6", +"g+ c #E9A046", +"h+ c #A9ABA8", +"i+ c #F0A048", +"j+ c #EBA248", +"k+ c #AAACA9", +"l+ c #ACAEAB", +"m+ c #F5A445", +"n+ c #F4A44C", +"o+ c #AEB0AD", +"p+ c #F6A546", +"q+ c #F8A647", +"r+ c #B0B2AE", +"s+ c #B1B3AF", +"t+ c #B2B4B1", +"u+ c #B4B6B3", +"v+ c #B6B8B4", +"w+ c #B7B9B6", +"x+ c #B8BAB7", +"y+ c #B9BBB8", +"z+ c #BCBEBB", +"A+ c #C0C2BE", +"B+ c #C1C3BF", +"C+ c #C2C4C1", +"D+ c #C4C6C3", +"E+ c #C6C8C5", +"F+ c #C7C9C6", +"G+ c #CACCC9", +/* pixels */ +" ", +" ", +" ", +" t+t+t+t+t+t+o+h+a+6+6+d+k+r+t+t+t+t+t+t+t+ ", +" f+-+P.E.t.d.2.).+.R F w p k 7 7 g k v D O W @.{.[.a.q.C.-+9+ ", +" Z.0 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ F %+ ", +" A.& & & ' _ 0 0 f l q s y B G B y y s q o l f f 0 , & & _ W. ", +"v+n.= = = ` >.N.>.>.>.~.>.>.>.]+].>.>.>.~.!.7.!+>.>.S = = , L. ", +"w+3., , , ~.@+7+#+>.0.!.>.>.>.m+:.>.>.>.~.4.m.b+>.>.` = , , C. ", +"y+{., , _ F._+{+F.c.7+b+_+1+>.m+o.3+o.)+5+1+z.j+1+(+*., , , l.y+", +"x+%., , 0 j.g+1+y.g.c+=+'+1+8.q+7+I.~.j+.+u.B.m+6.q+_.^ , , 3.x+", +"s++._ _ f >.1.:+e+z.8+=+,+1+D.q+}+>+0.U.}+8+r.b+>.n+6.< _ _ (.o+", +"k+V _ _ o H.&+<+e+j.8+=+,+1+s.q+B.e+s.$+O.e+v.b+>.n+6.0 _ , &.f+", +"d+T _ _ q 1.T.:+m.:.++K.M.V.1.,+p.S.x.++^+X.6.Y.>.`.L = , @ ` 6+", +"6+N 2 2 q >.>.Q.>.>.b.i.b.>.~.i.i.|.>.4.i.f.>.$.z > > + @ @ T 2+", +"4+N 2 2 q >.>.>.>.>.i.i.4.>.^.i.i.~.>.0.h.#.i > > > > . # # V 6+", +"9+Y a a q >.>.>.>.!.i.i.}.>.|.i.i.$.K U J i > > > > > + $ $ ` a+", +"h+#.c c l >.>.>.>./.i.i.^.$.,.=.Q > > H H z E z j > > @ % % *.h+", +"r+,.i i m >.>.>.;.~.,.K | > u u 4 > > H E m ( > j 8 > @ * * ,.o+", +"w+|.i i c Q z e > > > > / | 8 / > > > ( > > > > r 2 > @ > > !.u+", +"A+9.i e , > > > / / j z r j j r z z u r j i i z i > > # > > |.y+", +"D+h.~ ~ $ = > > z C 8 > > > > > > > > ( | 4 4 > > > = $ ~ ~ 3.C+", +"E+C.~ ~ > & > 4 r 8 > > > > > > > > > > > > > > > > # > ~ ~ w.E+", +" Z.: : : $ $ # # # # # @ # # # # # # # # # # $ # # = : : : R.F+", +" ~+9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 n *+ ", +" [+M 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 $./+ ", +" B+;+G.w.k.9.|.>.$. .X Q M I x z H M Q U Z ..>.|.b.w.J. +/+z+ ", +" G+G+G+G+G+E+A+y+v+s+l+h+h+o+u+y+B+F+G+G+G+G+G+G+ ", +" ", +" ", +" ", +" "}; --- mksh-40.4.orig/debian/source.lintian-overrides +++ mksh-40.4/debian/source.lintian-overrides @@ -0,0 +1,5 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/source.lintian-overrides,v 1.9 2011/12/31 02:54:17 tg Exp $ + +# desired method of keeping changes is CVS +# as long as etch backports are required +mksh source: direct-changes-in-diff-but-no-patch-system * --- mksh-40.4.orig/debian/mksh.preinst +++ mksh-40.4/debian/mksh.preinst @@ -0,0 +1,50 @@ +#!/bin/sh +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.preinst,v 1.2 2011/11/19 22:41:03 tg Exp $ + +set -e + +# This maintainer script can be called the following ways: +# +# * new-preinst "install" [$old_version] +# * new-preinst "upgrade" [$old_version] +# * old-preinst "abort-upgrade" $new_version +# Essential packages and Pre-Depends are available. Pre-Depends have +# been configured once, but may be unpacked or Half-Configured only, +# or, for "abort-upgrade", Half-Installed if their upgrade failed. + +case $1 in +install) + ;; + +upgrade) + # drop diversion of /bin/sh if it was ours + if test -n "$2" && \ + dpkg --compare-versions "$2" le '40.2-1'; then + for i in /bin/sh /usr/share/man/man1/sh.1.gz; do + div=$(dpkg-divert --list $i) + if [ -n "$div" ] && [ -z "${div%%*by mksh}" ]; then + distrib=${div% by mksh} + distrib=${distrib##* to } + mv $distrib $i + dpkg-divert --package mksh --remove $i + fi + done + :>/bin/mksh.dropdebconf + fi + ;; + +abort-upgrade) + ;; + +*) + echo >&2 "preinst called with unknown subcommand '$1'" + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- mksh-40.4.orig/debian/mksh16lg.xpm +++ mksh-40.4/debian/mksh16lg.xpm @@ -0,0 +1,191 @@ +/* XPM */ +static char *mksh16lg[] = { +/* $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh16lg.xpm,v 1.1 2009/08/01 17:49:01 smultron Exp $ */ +"16 16 169 2", +/* colours */ +" c None", +" . c #2A221C", +" X c #615448", +" o c #636261", +" O c #A5A5A5", +" + c #654E38", +" @ c #5D5C5B", +" # c #2D2622", +" $ c #2B2420", +" % c #1A120C", +" & c #201815", +" * c #858382", +" = c #1F1814", +" - c #1D1612", +" ; c #C08545", +" : c #131312", +" > c #8D8D8D", +" , c #17100C", +" < c #8B8B8B", +" 1 c #150E0A", +" 2 c #140E09", +" 3 c #686562", +" 4 c #858585", +" 5 c #65615F", +" 6 c #A97742", +" 7 c #836341", +" 8 c #1D1815", +" 9 c #818181", +" 0 c #130E0B", +" q c #777777", +" w c #666563", +" e c #737373", +" r c #A37849", +" t c #4C3D2F", +" y c #A6A6A5", +" u c #6F6F6F", +" i c #6C5A4B", +" p c #5D472F", +" a c #9C9C9B", +" s c #332D2A", +" d c #CD8D47", +" f c #616161", +" g c #959494", +" h c #A47543", +" j c #171615", +" k c #A37342", +" l c #161414", +" z c #151413", +" x c #1B130F", +" c c #7B5D3F", +" v c #131211", +" b c #7E7C7A", +" n c #11100F", +" m c #170F0B", +" M c #7A7876", +" N c #898888", +" B c #535353", +" V c #757271", +" C c #593E24", +" Z c #838282", +" A c #BA854B", +" S c #5A4A3C", +" D c #644C32", +" F c #7B7A7A", +" G c #75593C", +" H c #946C40", +" J c #B47F45", +" K c #B27D43", +" L c #433C39", +" P c #413A37", +" I c #6F6E6E", +" U c #3F3835", +" Y c #181512", +" T c #1D140D", +" R c #6B6A6A", +" E c #665544", +" W c #483A2D", +" Q c #131110", +" ! c #CD8E49", +" ~ c #201A16", +" ^ c #16100C", +" / c #140E0A", +" ( c #130C09", +" ) c #1B1614", +" _ c #B4B4B4", +" ` c #181411", +" ' c #684724", +" ] c #A2A2A2", +" [ c #2C2521", +" { c #261F1B", +" } c #1D1C1C", +" | c #211916", +". c #969696", +".. c #1F1714", +".X c #1E1713", +".o c #171616", +".O c #1C1511", +".+ c #8E8E8E", +".@ c #150F0A", +".# c #0F0E0E", +".$ c #140F09", +".% c #140D09", +".& c #868686", +".* c #767473", +".= c #462F19", +".- c #534C4A", +".; c #735C45", +".: c #262321", +".> c #7A7A7A", +"., c #C68947", +".< c #BE8649", +".1 c #785D43", +".2 c #6C6C6C", +".3 c #161311", +".4 c #5B5A58", +".5 c #B5834A", +".6 c #9A6F40", +".7 c #686868", +".8 c #312011", +".9 c #916A41", +".0 c #261E1A", +".q c #646464", +".w c #241C18", +".e c #231C17", +".r c #221A16", +".t c #7C634A", +".y c #181716", +".u c #5C5C5C", +".i c #1C1410", +".p c #2B2622", +".a c #908F8F", +".s c #5A5A5A", +".d c #1A120E", +".f c #986D41", +".g c #17100B", +".h c #100F0E", +".j c #140E08", +".k c #9E754A", +".l c #664D34", +".z c #5F5B58", +".x c #DF984B", +".c c #5D5956", +".v c #946B40", +".b c #211E1B", +".n c #110C08", +".m c #443D3A", +".M c #7A6044", +".N c #2F2722", +".B c #1E150E", +".V c #646363", +".C c #2E2924", +".Z c #171614", +".A c #7D5F40", +".S c #1C150F", +".D c #141211", +".F c #131210", +".G c #19110C", +".H c #878685", +".J c #CBCBCB", +".K c #C28848", +".L c #716E6C", +".P c #865F38", +".I c #C08646", +".U c #6D6A68", +".Y c #140D0A", +".T c #7F6348", +".R c #20160F", +".E c #6F6E6D", +".W c #3B3430", +/* pixels */ +" ", +" _.+ 9 q.2.q.u B B.s f.7 u q < _", +".& j.# n v z.Z.y.o.Z l :.F.h } >", +" e Q.: P P.m.v P P P.m.v P.b.D 4", +" R.3 W.f.9 E.I c S.6.1., H.C.3.>", +".V Y D K J.k.x.5.T.< i d k p ` I", +" @ ).l 6 6 r !.K X.A A ;.P C 0 o", +".4 8 t G G.t 7.;.M h + '.=.8.n o", +" w ~ s P L.-.W U #.w $.w.O ( 2.E", +".*.e.p [.0 = -.r x.O.O x.r.Y.g F", +" Z.S.$ m { &.i.i.X | |.. m 1 % N", +" g T , ^.d 2.%.j.Y /.Y 1.@.G.B. ", +" O ..R.R.R.R.R.R.R.R.R.R.R.R.N ]", +".J a.H b V.U 5.c.z 3.L M *.a y.J", +" ", +" "}; --- mksh-40.4.orig/debian/mksh.manpages +++ mksh-40.4/debian/mksh.manpages @@ -0,0 +1,3 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.manpages,v 1.4 2010/07/17 23:08:59 tg Exp $ +#- +mksh.1 --- mksh-40.4.orig/debian/mksh.examples +++ mksh-40.4/debian/mksh.examples @@ -0,0 +1,3 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.examples,v 1.2 2010/07/17 23:08:59 tg Exp $ +#- +dot.mkshrc --- mksh-40.4.orig/debian/mksh.docs +++ mksh-40.4/debian/mksh.docs @@ -0,0 +1,6 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.docs,v 1.4 2011/03/03 20:22:49 tg Exp $ +#- +builddir/README.Debian.gz +debian/mtest.t +check.pl +check.t --- mksh-40.4.orig/debian/README.Debian +++ mksh-40.4/debian/README.Debian @@ -0,0 +1,55 @@ +$MirOS: contrib/hosted/tg/deb/mksh/debian/README.Debian,v 1.19 2012/02/11 17:00:58 tg Exp $ +___________________________________________________________________________________________ + +Notes for the mksh binary package +================================= + +* After installation, it is strongly recommended to copy the file + /etc/skel/.mkshrc into your home directory to get a nicer prompt, + pushd/popd/dirs functionality, some aliases, etc. (you can then + customise it; reading the manual page also often helps). + Note that /etc/skel/.mkshrc sources /etc/mkshrc (which is the + upstream-provided file) by default and contains some (commented + out) examples to set the locale and editor. Change the file once + copied into the home if you do not want this. + +* Due to a bug in dash (Debian #540512), mksh cannot (at this time) + be installed as /bin/sh by automated means. It will however work + if done manually (change the symlink as root) for the most recent + versions (wheezy/sid, squeeze-backports, lenny-backports-sloppy). + Use one of these (mksh-static is suitable, e.g. on slow platforms): + $ sudo ln -sf mksh /bin/sh + $ sudo ln -sf mksh-static /bin/sh + There have been efforts, several times, to fix the /bin/sh issue, + but to no avail. The debconf questions to install mksh as /bin/sh + on lenny and older systems are now gone even in the backports. + +* /bin/mksh is built with the following options: + - extra hardening flags: +all + - eglibc (dynamically linked) + - the printf builtin + - calling as sh or -sh invokes "set -o sh" + +* /bin/mksh-static is built with the following options: + - extra hardening flags: +all but no PIE + (position independent code), as this is a static executable + - dietlibc, if available, eglibc otherwise (statically linked) + + klibc might be a viable choice some day; patches in progress + - the printf builtin + - calling as sh or -sh invokes "set -o sh" + - -DMKSH_SMALL + - no locale support; uses getenv on LANG/LC_CTYPE/LC_ALL + +* The following testsuite failures, especially on the autobuilder + network, are harmless and can be ignored: + - utf8bom-2 (mksh-full only) + - heredoc-tmpfile-8 (on slow machines) + Failures in dollar-quoted-strings or history-subst-4 (#523086) + are errors in dietlibc on the respective architectures. These + have been fixed past Debian squeeze and *buntu oneiric but may + still occur on backports; except history-subst-4 [hppa], they + are tested for, and on failure rebuilt against eglibc, on non- + cross non-nocheck builds. + +Details (generated during package build) can be found below: + --- mksh-40.4.orig/debian/mksh.prerm +++ mksh-40.4/debian/mksh.prerm @@ -0,0 +1,43 @@ +#!/bin/sh +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.prerm,v 1.8 2011/11/19 22:41:03 tg Exp $ + +set -e + +# This maintainer script can be called the following ways: +# +# * prerm "remove" +# * old-prerm "upgrade" $new_version +# * conflictors-prerm "remove" "in-favour" $package $new_version +# * deconfigureds-prerm "deconfigure" "in-favour" +# $package_being_installed $pbi_version ["removing" +# $conflicting_package $cp_version] +# The package and dependencies are at least Half-Installed; dependencies +# have previously been configured and not removed. +# +# * new-prerm "failed-upgrade" $old_version +# Called when 'old-prerm "upgrade"' fails; new package not unpacked, all +# other constraints the same as above. + +case $1 in +remove|deconfigure) + update-alternatives --remove ksh /bin/mksh + update-alternatives --remove ksh /bin/mksh-static + remove-shell /bin/mksh + remove-shell /bin/mksh-static + ;; + +upgrade|failed-upgrade) + ;; + +*) + echo >&2 "prerm called with unknown subcommand '$1'" + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- mksh-40.4.orig/debian/control +++ mksh-40.4/debian/control @@ -0,0 +1,50 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/control,v 1.65 2012/02/11 17:00:59 tg Exp $ +# +Source: mksh +Section: shells +Priority: optional +Maintainer: Thorsten Glaser +Homepage: http://mirbsd.de/mksh +# The list of dietlibc-dev architectures is copied from its control file. +# On other architectures, mksh-static links against eglibc (yuck…) +# note to porters: dropping the dietlibc-dev B-D is fine, will use eglibc then +# but do not unversion the B-D where it is versioned, older versions are buggy +# (not all buggy versions are excluded - but caught by the testsuite, run it!) +Build-Depends: bsdmainutils, debhelper (>= 5), ed, + locales [!avr32] | belocs-locales-bin [!avr32], + dietlibc-dev [alpha amd64 arm armeb i386 ia64 mips mipsel powerpc ppc64 sparc], + dietlibc-dev (>= 0.33~cvs20111108-5~) [armel armhf s390 s390x sparc64] +Standards-Version: 3.9.2 +# First word is the $CVSROOT (-d arg) string, second word the module. +# Upstream is on the same server, in the "mksh" module. +Vcs-CVS: :ext:_anoncvs@anoncvs.mirbsd.org:/cvs contrib/hosted/tg/deb/mksh +Vcs-Browser: http://cvs.mirbsd.de/contrib/hosted/tg/deb/mksh/ + +Package: mksh +Architecture: any +Multi-Arch: foreign +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: ed +Description: MirBSD Korn Shell + mksh is the successor of the Public Domain Korn shell (pdksh), + a Bourne/POSIX compatible shell which is largely similar to the + original AT&T Korn Shell (ksh88/ksh93). + It includes bug fixes and feature improvements, in order to produce a + modern, robust shell good for interactive and especially script use. + mksh has UTF-8 support (in string operations and the Emacs editing + mode). The code has been cleaned up and simplified, bugs fixed, + standards compliance added, and several enhancements (for extended + compatibility to other modern shells, as well as a couple of its + own) are available. + This shell is Debian Policy 10.4 compliant and may be used as /bin/sh + on Debian systems, in both /bin/mksh and /bin/mksh-static flavours. + . + The mksh-static binary is a version of mksh, linked against dietlibc + (if dietlibc exists for that Debian architecture), and optimised for + small code size, for example for use on initrd or initramfs images, + installation or rescue systems, or /bin/sh on slow architectures. + It omits some leaf features to be even smaller. + . + A sample ~/.mkshrc is included in /usr/share/doc/mksh/examples and + provided as /etc/mkshrc conffile, which is sourced by another file + /etc/skel/.mkshrc users are recommended to copy into their home. --- mksh-40.4.orig/debian/mksh.menu +++ mksh-40.4/debian/mksh.menu @@ -0,0 +1,12 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.menu,v 1.4 2009/08/01 17:51:01 tg Exp $ +#- +# mksh16lg.xpm provides an alternative icon based on the mksh logo +# mksh16.xpm is a bitmap creation especially for this size +# mksh32.xpm is the mksh logo tweaked and scaled down to be useful +# +?package(mksh):needs="text" \ + section="Applications/Shells" \ + title="mksh" longtitle="MirBSD Korn Shell" \ + icon16x16="/usr/share/pixmaps/mksh16.xpm" \ + icon32x32="/usr/share/pixmaps/mksh32.xpm" \ + command="/bin/mksh -l" --- mksh-40.4.orig/debian/copyright +++ mksh-40.4/debian/copyright @@ -0,0 +1,102 @@ +This package was debianised by Thorsten Glaser on +Sat, 28 May 2005 22:02:17 +0000. + +$MirOS: contrib/hosted/tg/deb/mksh/debian/copyright,v 1.26 2012/02/11 17:00:59 tg Exp $ + +It was downloaded via "debian/rules get-orig-source". This both +makes using CVS snapshots easier and is needed because upstream +distfiles are in cpio format, and tar-in-tar is discouraged. + + +Licence: + +The MirBSD Korn Shell is covered by the MirOS Licence, which +is OSI approved, as reproduced below. + +Binaries of the MirBSD Korn Shell on systems whose libc does +not provide a strlcpy function will additionally contain an +implementation under the ISC Licence, which is OSI approved +and also reproduced below. + +All Debian binaries of mksh R39 and up also pull in the UCB code +SLOB printf.c to have a printf(1) builtin (also OSI approved). + +mksh16.xpm is hand-drawn; mksh16lg.xpm and mksh32.xpm are exports +of https://www.mirbsd.org/pics/mksh.svg (the mksh logo). + + +The MirBSD Korn Shell (mksh) is +Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + 2011, 2012 + Thorsten "mirabilos" Glaser +All rights reserved. + +The mksh logo is +Copyright © 2008, 2009 + Lukas U. +Copyright © 2008, 2009 + Thorsten "mirabilos" Glaser + +Provided that these terms and disclaimer and all copyright notices +are retained or reproduced in an accompanying document, permission +is granted to deal in this work without restriction, including un‐ +limited rights to use, publicly perform, distribute, sell, modify, +merge, give away, or sublicence. + +This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to +the utmost extent permitted by applicable law, neither express nor +implied; without malicious intent or gross negligence. In no event +may a licensor, author or contributor be held liable for indirect, +direct, other damage, loss, or other issues arising in any way out +of dealing in the work, even if advised of the possibility of such +damage or existence of a defect, except proven that it results out +of said person’s immediate fault when using the work as intended. + + +strlcpy.c is +Copyright (c) 2006, 2008, 2009 + Thorsten Glaser +Copyright (c) 1998 + Todd C. Miller + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +printf.c is +Copyright (c) 1989 + The Regents of the University of California. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. --- mksh-40.4.orig/debian/meat +++ mksh-40.4/debian/meat @@ -0,0 +1,375 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/meat,v 1.33 2012/02/11 17:01:00 tg Exp $ +#- +# Design: this thing is intended to build two mksh binaries, +# mksh-full and mksh-static (with the latter being statical- +# ly linked) according to DEB_BUILD_OPTIONS set: +# - nocheck: do not run mksh's regression test suite +# - noopt: build mksh with -O0, for eglibc builds only +# - nodbg: do not build with debugging info (for eglibc builds) +# - nostrip: handled by dh_strip, so ignored here +# - parallel=n: currently ignored, maybe -flto=jobserver could use it +# - mksh-firstbuilt: do not run a simple test for operational +# functionality, but use the first built binary (e.g. cross-builds) +# - mksh-static=x: use library x (comma-separated list) for this, +# values for x are: klibc dietlibc eglibc +# - nomksh-small: do not build mksh-static with -DMKSH_SMALL +# +# Default values are: +# - mksh-static=dietlibc,eglibc +# if mksh-firstbuilt is set: +# - mksh-static=eglibc on certain targets (see below for details) +# +# If we are cross-building, mksh-firstbuilt will be set. + + +# --- functions --- +buildok=0 +normalise() { + varname=$1 + eval varvalue=\$$varname + newvalue= + unset newvalue + for tmpvalue in $varvalue; do + newvalue=$newvalue${newvalue+ }$tmpvalue + done + eval $varname=\$newvalue +} +logbuildinfo() { + where=$1 + { + echo "Build information for $where mksh" + fgrep 'set -A check_categories' builddir/$where/test.sh + echo "From: $startdate" + $CC --version 2>&1 | grep ^gcc + echo "Result: $buildinfo (broken&1 | sed 's/^/| /' + echo "Date: $(date -u)" + } >builddir/buildinfo.$where +} +trybuild() { + where=$1 + normalise CC + normalise CFLAGS + normalise CPPFLAGS + normalise LDFLAGS + normalise LIBS + cd builddir/$where + echo "Attempting compilation of mksh in $where with CC='$CC'" + echo "CFLAGS='$CFLAGS' CPPFLAGS='$CPPFLAGS'" + echo "LDFLAGS='$LDFLAGS' LIBS='$LIBS'" + + buildok=0 + arg='-r -c lto' + buildinfo=broken + gotbin=0 + startdate=$(date -u) + set -x + CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ + LIBS="$LIBS" sh ../../Build.sh $arg && test -f mksh && gotbin=1 + set +x + test -f Rebuild.sh && test x"$HAVE_CAN_COMBINE" != x"0" && \ + if test $gotbin = 0; then + echo 'Build with combine *FAILED*, retrying without.' + echo '=== note: for better optimisation, fix your gcc! ===' + sh Rebuild.sh && test -f mksh && gotbin=1 + fi + if test $gotbin = 0; then + echo "Build attempt failed." + cd ../.. + return + fi + if test $firstbuilt = 1; then + echo "Got a binary, using first built." + buildinfo=firstbuilt + cd ../.. + buildok=1 + logbuildinfo $where + return + fi + echo "Running simple checks on the binary." + perl ../../check.pl -s ../../debian/mtest.t -p ./mksh -v 2>&1 | \ + tee mtest.log + if grep '^Total failed: 0$' mtest.log >/dev/null; then + echo "Simple tests okay." + else + echo "Simple tests failed." + cd ../.. + return + fi + buildinfo=checked + if test $nocheck = 0; then + echo "Running mksh regression test suite." + if test x"$(uname -s)" = x"GNU"; then + # script(1) fails on Debian GNU/Hurd in pbuilder + if test -e ../../../attended; then + ./test.sh -v + else + ./test.sh -v -C regress:no-ctty + fi 2>&1 | tee utest.log + else + echo "This needs /dev/tty and /dev/ptmx in the chroot." + echo >test.wait + script -qc './test.sh -v 2>&1 | tee utest.log; x=$?; rm -f test.wait; exit $x' + maxwait=0 + while test -e test.wait; do + sleep 1 + maxwait=$(expr $maxwait + 1) + test $maxwait -lt 900 || break + done + fi + if grep '^pass .*:KSH_VERSION' utest.log >/dev/null 2>&1; then + echo "Regression test suite run." + else + echo "Regression tests apparently not run." + echo "Failing this build." + cd ../.. + return + fi + buildinfo=regressed + resultest=$(grep '^[FPT]' utest.log 2>&1 | fgrep -v \ + -e 'Testing mksh for conformance' \ + -e 'This shell is actually') + fi + cd ../.. + buildok=1 + logbuildinfo $where +} + +# --- main code --- + +LC_ALL=C; export LC_ALL +topdir=$(pwd) +# get maximum of hardening flags +DEB_BUILD_MAINT_OPTIONS="hardening=+all" +export DEB_BUILD_MAINT_OPTIONS + +# pull environment configuration +for varname in DEB_BUILD_ARCH DEB_BUILD_GNU_TYPE DEB_HOST_GNU_TYPE; do + eval x=\$$varname + test x"$x" = x"" || continue + x=$(dpkg-architecture -q$varname) + eval $varname=\$x +done + +rm -rf builddir +mkdir builddir builddir/full builddir/static + +echo "Building the mksh package on '$DEB_BUILD_ARCH' with DEB_BUILD_OPTIONS '$DEB_BUILD_OPTIONS'" +echo "Values (not used) from environment: CFLAGS='$CFLAGS' CPPFLAGS='$CPPFLAGS' LDFLAGS='$LDFLAGS'" + +# parse options +nocheck=0 +noopt=0 +nodbg=0 +firstbuilt=0 +static=unset +small=1 + +if test x"$DEB_BUILD_GNU_TYPE" = x"$DEB_HOST_GNU_TYPE"; then + firstbuilt=0 +else + echo Using first built binary because we are cross-compiling + echo "from $DEB_BUILD_GNU_TYPE to $DEB_HOST_GNU_TYPE here." + firstbuilt=1 +fi + +for i in $DEB_BUILD_OPTIONS; do + case $i in + (nocheck) nocheck=1 ;; + (noopt) noopt=1 ;; + (nodbg) nodbg=1 ;; + (mksh-firstbuilt) firstbuilt=1 ;; + (mksh-static=*) static=${i#*=} ;; + (nomksh-small) small=0 ;; + esac +done + +# set default values for CC, CFLAGS, CPPFLAGS, LDFLAGS +test -n "$CC" || CC=gcc; dCC=$CC +echo "Using compiler: '$dCC'" +if test $noopt = 1; then + x=-O0 +else + x=-O2 +fi +test $nodbg = 1 || x="$x -g" +dCFLAGS=$(dpkg-buildflags --get CFLAGS 2>/dev/null) || dCFLAGS=$x +dCPPFLAGS=$(dpkg-buildflags --get CPPFLAGS 2>/dev/null) +dLDFLAGS=$(dpkg-buildflags --get LDFLAGS 2>/dev/null) +echo "Values from dpkg-buildflags: CFLAGS='$dCFLAGS' CPPFLAGS='$dCPPFLAGS' LDFLAGS='$dLDFLAGS'" +dCFLAGS="$dCFLAGS -Wall -Wextra" +HAVE_CAN_WALL=0; export HAVE_CAN_WALL +# Debian #499139 +dCPPFLAGS="$dCPPFLAGS -DMKSH_BINSHREDUCED" +# Debian #532343, #539158 +USE_PRINTF_BUILTIN=1; export USE_PRINTF_BUILTIN +# avoid needing a Build-Conflicts on libbsd-dev +HAVE_LIBUTIL_H=0; export HAVE_LIBUTIL_H + +# avr32 currently has no locales +if test x"$DEB_BUILD_ARCH" = x"avr32"; then + HAVE_SETLOCALE_CTYPE=0; export HAVE_SETLOCALE_CTYPE +fi + +# set mksh-static default values if none given +if test x"$static" = x"unset"; then + static=dietlibc,eglibc + case $firstbuilt$static:$DEB_BUILD_ARCH in + (*:hppa) + # revisit once dietlibc and lsb-release are built + # and this arch has caught up (meat,v 1.32 e.g.) + static=eglibc + ;; + esac +fi + +# validate mksh-static arguments +static=$(echo x,"$static" | sed 's/^x,//' | tr , ' ') +for x in $static; do + case $x in + (klibc|dietlibc|eglibc) ;; + (*) + echo "Error: invalid library '$x' in DEB_BUILD_OPTIONS" + exit 1 + ;; + esac +done + +# create a locale if we are to run the testsuite +test x"$HAVE_SETLOCALE_CTYPE" != x"0" && if test $nocheck = 0; then + echo Creating locale for the regression tests + mkdir builddir/tloc + # cf. Debian #522776 + localedef -i en_US -c -f UTF-8 builddir/tloc/en_US.UTF-8 || \ + echo Warning: testsuite failures may occur + LOCPATH=$topdir/builddir/tloc; export LOCPATH +fi + +# build mksh-full +CC=$dCC +CFLAGS=$dCFLAGS +CPPFLAGS=$dCPPFLAGS +LDFLAGS=$dLDFLAGS +LIBS= +echo Building mksh-full... +trybuild full +if test $buildok = 0; then + echo Build of mksh-full failed. + exit 1 +fi + +# build mksh-static +sCC=$dCC +sCFLAGS= +# drop optimisation, debugging and PIC flags for mksh-static +for x in $dCFLAGS; do + case $x in + (-O*|-g*|-fPIE) ;; + (*) sCFLAGS="$sCFLAGS $x" ;; + esac +done +sCPPFLAGS=$dCPPFLAGS +sLDFLAGS= +for x in $dLDFLAGS; do + case $x in + (-pie|-fPIE) ;; + (*) sLDFLAGS="$sLDFLAGS $x" ;; + esac +done +sLIBS= +test $small = 0 || sCPPFLAGS="$sCPPFLAGS -DMKSH_SMALL" +# no locale support in mksh-static needed +HAVE_SETLOCALE_CTYPE=0; export HAVE_SETLOCALE_CTYPE + +buildok=0 +for x in $static; do echo Building mksh-static with $x; case $x in +(klibc) + if test -z "$(which klcc 2>/dev/null)"; then + echo ... skipping, klcc not found + continue + fi + CC=klcc + CFLAGS="$sCFLAGS -fno-stack-protector -g" + CPPFLAGS="$sCPPFLAGS -DMKSH_NO_LIMITS" + LDFLAGS="$sLDFLAGS -static" + LIBS=$sLIBS + HAVE_CAN_COMBINE=0; export HAVE_CAN_COMBINE + trybuild static + unset HAVE_CAN_COMBINE + ;; +(dietlibc) + if test -z "$(which diet 2>/dev/null)"; then + echo ... skipping, diet not found + continue + fi + CC="diet -v -Os $sCC" + CFLAGS=$sCFLAGS + CPPFLAGS=$sCPPFLAGS + LDFLAGS=$sLDFLAGS + LIBS=$sLIBS + echo "Note: all warning: dereferencing pointer 'p' does break" \ + "strict-aliasing rules come from dietlibc, not mksh!" + trybuild static + ;; +(eglibc) + CC=$sCC + CFLAGS="-Os $sCFLAGS" + CPPFLAGS=$sCPPFLAGS + LDFLAGS="$sLDFLAGS -static" + LIBS=$sLIBS + trybuild static + ;; +esac; test $buildok = 0 || break; done +if test $buildok = 0; then + echo Build of mksh-static failed. + exit 1 +fi + +echo Logging build information... +{ + cat debian/README.Debian + echo Build information for mksh${1}: + for v in DEB_BUILD_GNU_TYPE DEB_HOST_GNU_TYPE DEB_BUILD_OPTIONS; do + eval x=\$$v + echo "| $v='$x'" + done + echo Dependencies: + dpkg-query -W $(for wasn in ./usr/lib/libc.so ./usr/lib/*/libc.so \ + locales .=diet .=klcc .=as .=ld .=strip; do + case $wasn in + (.=*) wasn=.$(which ${wasn#.=} 2>/dev/null) ;; + esac + case $wasn in + (./*) + for wasn in ${wasn#.}; do + test -e $wasn && dpkg -S $wasn | sed 's/:.*$//' + done + ;; + (.*) ;; + (*) + echo $wasn + ;; + esac + done | sort -u) | column -t | sed 's/^/| /' + echo ---- + cat builddir/buildinfo.full + echo ---- + cat builddir/buildinfo.static + echo ---- + dpkg-parsechangelog -n1 | grep '^Version:' + date -R +} | gzip -n9 >builddir/README.Debian.gz +echo All builds complete. +exit 0 --- mksh-40.4.orig/debian/mksh.postinst +++ mksh-40.4/debian/mksh.postinst @@ -0,0 +1,65 @@ +#!/bin/sh +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.postinst,v 1.7 2011/11/19 22:41:03 tg Exp $ + +set -e + +# This maintainer script can be called the following ways: +# +# * new-postinst "configure" [$most_recently_configured_version] +# The package is unpacked; all dependencies are unpacked and, when there +# are no circular dependencies, configured. +# +# * old-postinst "abort-upgrade" $new_version +# * conflictors-postinst "abort-remove" "in-favour" $package +# $new_version +# * postinst "abort-remove" +# * deconfigureds-postinst "abort-deconfigure" "in-favour" +# $failed_install_package $fip_version ["removing" +# $conflicting_package $cp_version] +# The package is unpacked; all dependencies are at least Half-Installed, +# previously been configured, and not removed. In some error situations, +# dependencies may not be even fully unpacked. +# +# * postinst "triggered" "${triggers[*]}" +# For trigger-only calls, i.e. if "configure" is not called. + +# remove debconf data from old versions of this package +if test -e /bin/mksh.dropdebconf; then + set +e + echo purge | debconf-communicate mksh >/dev/null 2>&1 + rm -f /bin/mksh.dropdebconf + set -e +fi + +case $1 in +configure) + update-alternatives --install /bin/ksh ksh /bin/mksh 12 \ + --slave /usr/bin/ksh usr.bin.ksh /bin/mksh \ + --slave /usr/share/man/man1/ksh.1.gz ksh.1.gz \ + /usr/share/man/man1/mksh.1.gz + update-alternatives --install /bin/ksh ksh /bin/mksh-static 11 \ + --slave /usr/bin/ksh usr.bin.ksh /bin/mksh-static \ + --slave /usr/share/man/man1/ksh.1.gz ksh.1.gz \ + /usr/share/man/man1/mksh.1.gz + add-shell /bin/mksh + add-shell /bin/mksh-static + ;; + +abort-upgrade|abort-remove|abort-deconfigure) + ;; + +triggered) + ;; + +*) + echo >&2 "postinst called with unknown subcommand '$1'" + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- mksh-40.4.orig/debian/mksh16.xpm +++ mksh-40.4/debian/mksh16.xpm @@ -0,0 +1,26 @@ +/* XPM */ +static char *mksh16[] = { +/* $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh16.xpm,v 1.2 2009/08/01 16:45:41 tg Exp $ */ +"16 16 3 1", +/* colours */ +"# c #F9A74B", +"* c #990000", +" c None", +/* pixels */ +" ", +" ** ** ", +" ********** ", +" *** ** ** ", +" ** ** ** ", +" ** ** ** ", +" ** ** ** ", +" ", +" # # ## # # ", +" # # # # # # ", +" # # # # # ", +" ## ## #### ", +" # # # # # ", +" # # # # # # ", +" # # ## # # ", +" " +}; --- mksh-40.4.orig/debian/rules +++ mksh-40.4/debian/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# $MirOS: contrib/hosted/tg/deb/mksh/debian/rules,v 1.85 2011/12/11 18:54:16 tg Exp $ + +LC_ALL:=C +export LC_ALL + +# for "debian/rules get-orig-source" +#ORIGTGZ_SOURCE:= -D'2011/06/05 20:00' +#ORIGTGZ_DESTINATION:= 40~0.20110605 +# built from R40-stable branch: R40c+ +#ORIGTGZ_SOURCE:= -rmksh-R40stable -D'2011-11-26 18:30' +# build from R40d tag +ORIGTGZ_SOURCE:= -rmksh-R40d +ORIGTGZ_PRINTF:= -rmksh-R40 +ORIGTGZ_DESTINATION:= 40.4 + +# shut up build log checkers that don’t know what they are doing +# Debian #492377, #572252; as well *buntu +_shutup:= 2>&1 | sed \ + -e 's!conftest.c:\([0-9]*\(:[0-9]*\)*\): error:!cE(\1) -!g' \ + -e 's!conftest.c:\([0-9]*\(:[0-9]*\)*\): warning:!cW(\1) -!g' \ + +build-indep: + +build-arch: debian/.build_stamp + +debian/.build_stamp: + dh_testdir + sh debian/meat ${ORIGTGZ_SOURCE} ${_shutup} + mv builddir/static/mksh builddir/static/mksh-static + @:>$@ + +clean: + dh_testdir + -rm -f debian/.*_stamp + -rm -rf builddir + dh_clean + +binary-indep: build-indep + +binary-arch: build-arch + dh_testdir + dh_testroot + # a build log checker may be nice but not backport-friendly; honestly + if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi + dh_installchangelogs + dh_installdocs + # we install this gzip’d already + rm -f debian/mksh/usr/share/doc/mksh/README.Debian + dh_installexamples + dh_install + dh_installmenu + dh_installman + install -m 644 dot.mkshrc debian/mksh/etc/mkshrc + dh_link + dh_strip + dh_compress + cd debian/mksh/usr/share/man/man1 && ln -sf mksh.1.gz mksh-static.1.gz + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + gzip -d ../mksh_${ORIGTGZ_DESTINATION}.orig.tar.gz + rm -rf $@.tmp + # there we are... + ls -l mksh_${ORIGTGZ_DESTINATION}.orig.tar.gz --- mksh-40.4.orig/debian/mksh.install +++ mksh-40.4/debian/mksh.install @@ -0,0 +1,6 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/mksh.install,v 1.12 2011/02/19 17:36:48 tg Exp $ +#- +builddir/full/mksh bin +builddir/static/mksh-static bin +debian/.mkshrc etc/skel +debian/mksh*.xpm usr/share/pixmaps --- mksh-40.4.orig/debian/.mkshrc +++ mksh-40.4/debian/.mkshrc @@ -0,0 +1,39 @@ +# $MirOS: contrib/hosted/tg/deb/mksh/debian/.mkshrc,v 1.6 2011/11/26 00:04:29 tg Exp $ +#- +# Skeleton ~/.mkshrc file adding a level of indirection + +# check if this is really mksh # {(( +case $KSH_VERSION in +*MIRBSD\ KSH*) ;; +*) return 0 ;; +esac # } + +# source the system-wide mkshrc file +[[ -s /etc/mkshrc ]] && . /etc/mkshrc + +# prepend $debian_chroot support to PS1 +p=$'\001' +if [[ ${PS1:1:1} = $'\r' ]]; then + p=${PS1:0:1} + PS1=${PS1:2} +else + p=$'\001' +fi +PS1=$p$'\r${debian_chroot:+'$p$'\e[0;1m'$p'($debian_chroot)'$p$'\e[0m'$p'}'$PS1 +unset p + +: put your local alias/function definitions, patches, etc. here + +#unset LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_IDENTIFICATION LC_MONETARY \ +# LC_NAME LC_NUMERIC LC_TELEPHONE LC_TIME +#p=en_GB.UTF-8 +#set -U +#export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p +# +#p=$(whence -p jupp) +#[[ -n $p ]] || p=$(whence -p jstar) +#[[ -n $p ]] && export EDITOR=$p VISUAL=$p +# +#unset p + +: make sure this is the last line, to ensure a good return code --- mksh-40.4.orig/debian/source/format +++ mksh-40.4/debian/source/format @@ -0,0 +1 @@ +1.0