From 1f0b1fbaaea607e7238f2ccdf2cd81cb4d1e40d1f01c2fb2e27c88a645a8d744 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 2 Sep 2011 12:19:30 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=73 --- INIT.2010-06-21.tar.bz2 | 3 - INIT.2011-06-30.tar.bz2 | 3 + ast-ksh.2010-06-21.tar.bz2 | 3 - ast-ksh.2011-06-30.tar.bz2 | 3 + ast-msgcc.2010-06-21.tar.bz2 | 3 - ast-msgcc.2011-06-30.tar.bz2 | 3 + ksh-locale.patch | 4 +- ksh.changes | 445 ++++++++++++++++++++++++++++ ksh.spec | 47 +-- ksh93-argv.dif | 20 -- ksh93-argv0.dif | 10 - ksh93-array.dif | 62 ---- ksh93-eintr.dif | 91 ------ ksh93-export.dif | 11 - ksh93-fdfn.dif | 10 - ksh93-fdleak.dif | 10 - ksh93-heredoc.dif | 81 +++++ ksh93-ifs.dif | 41 --- ksh93-jobs.dif | 19 ++ ksh93-leak.dif | 11 - ksh93-limits.dif | 18 +- ksh93-pipe.dif | 188 ------------ ksh93-profile.dif | 22 +- ksh93-reg.dif | 39 +++ ksh93-shift_ijs.dif | 145 ++------- ksh93-signals.dif | 19 -- ksh93-sigpipe.dif | 30 -- ksh93-test.dif | 10 +- ksh93-unset-f.dif | 6 +- ksh93.dif | 176 +++++------ workaround-stupid-build-system.diff | 28 +- 31 files changed, 752 insertions(+), 809 deletions(-) delete mode 100644 INIT.2010-06-21.tar.bz2 create mode 100644 INIT.2011-06-30.tar.bz2 delete mode 100644 ast-ksh.2010-06-21.tar.bz2 create mode 100644 ast-ksh.2011-06-30.tar.bz2 delete mode 100644 ast-msgcc.2010-06-21.tar.bz2 create mode 100644 ast-msgcc.2011-06-30.tar.bz2 delete mode 100644 ksh93-argv.dif delete mode 100644 ksh93-argv0.dif delete mode 100644 ksh93-array.dif delete mode 100644 ksh93-eintr.dif delete mode 100644 ksh93-export.dif delete mode 100644 ksh93-fdfn.dif delete mode 100644 ksh93-fdleak.dif create mode 100644 ksh93-heredoc.dif delete mode 100644 ksh93-ifs.dif create mode 100644 ksh93-jobs.dif delete mode 100644 ksh93-leak.dif delete mode 100644 ksh93-pipe.dif create mode 100644 ksh93-reg.dif delete mode 100644 ksh93-sigpipe.dif diff --git a/INIT.2010-06-21.tar.bz2 b/INIT.2010-06-21.tar.bz2 deleted file mode 100644 index 00aeaf0..0000000 --- a/INIT.2010-06-21.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ac7d3b11cec48ba51550c828e79b87d8b9e4747a533dd33dccf5146a304a5583 -size 279614 diff --git a/INIT.2011-06-30.tar.bz2 b/INIT.2011-06-30.tar.bz2 new file mode 100644 index 0000000..7f1d64e --- /dev/null +++ b/INIT.2011-06-30.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb28fef39dc8545d03f8fc4d20b490f94a85267f17a77583e428bd83c3c2935f +size 294704 diff --git a/ast-ksh.2010-06-21.tar.bz2 b/ast-ksh.2010-06-21.tar.bz2 deleted file mode 100644 index 799b334..0000000 --- a/ast-ksh.2010-06-21.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:579eefa2beb40721f39261028107526f175e83c3ee6f10e7335b393ff40cc81a -size 1494273 diff --git a/ast-ksh.2011-06-30.tar.bz2 b/ast-ksh.2011-06-30.tar.bz2 new file mode 100644 index 0000000..987d826 --- /dev/null +++ b/ast-ksh.2011-06-30.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1e5670ef12985f90d6564da14a8c274ea71c5b9559d90466c5475ee4c25cd98 +size 1544488 diff --git a/ast-msgcc.2010-06-21.tar.bz2 b/ast-msgcc.2010-06-21.tar.bz2 deleted file mode 100644 index 8d221be..0000000 --- a/ast-msgcc.2010-06-21.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:333334e1032f1f7331725b731170de563246d9018bc120ae4ff62146835a2a4b -size 128376 diff --git a/ast-msgcc.2011-06-30.tar.bz2 b/ast-msgcc.2011-06-30.tar.bz2 new file mode 100644 index 0000000..037bb97 --- /dev/null +++ b/ast-msgcc.2011-06-30.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c89ca42d226367d087870f7a4f5712a52cc1bfb79d103ed40b85ca3ac0d0afbb +size 129233 diff --git a/ksh-locale.patch b/ksh-locale.patch index 47e4d2f..fc9cd2d 100644 --- a/ksh-locale.patch +++ b/ksh-locale.patch @@ -1,8 +1,8 @@ --- lib/package/ast-ksh.pkg +++ lib/package/ast-ksh.pkg 2011-07-05 16:29:57.891926052 +0000 @@ -1,4 +1,4 @@ --ast-ksh :PACKAGE: ksh93 libast libcmd libsum libdll -+ast-ksh :PACKAGE: msgcc ksh93 libpp libast libcmd libsum libdll +-ast-ksh :PACKAGE: ksh93 libast libcmd libcoshell libsum libdll ++ast-ksh :PACKAGE: msgcc ksh93 libpp libast libcmd libcoshell libsum libdll :COVERS: ksh diff --git a/ksh.changes b/ksh.changes index 9ea8491..2ca58d7 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Tue Aug 30 16:44:06 UTC 2011 - werner@suse.de + +- Implement a patch for both regressions reported here + mailman.research.att.com/pipermail/ast-developers/2011q3/000951.html + +------------------------------------------------------------------- +Mon Aug 15 16:46:10 UTC 2011 - werner@suse.de + +- Add patch from mailing list to avoid stupid crahs on empty job list. + +------------------------------------------------------------------- +Fri Jul 22 14:56:27 UTC 2011 - werner@suse.de + +- Fix a typo in the patch + +------------------------------------------------------------------- +Fri Jul 22 11:29:02 UTC 2011 - werner@suse.de + +- Add and modify a patch from David korn to be able to handle multi + byte characters at the boundary of the buffer used for parsing + here documents (bnc#705032) + ------------------------------------------------------------------- Thu Jul 7 12:48:24 UTC 2011 - werner@suse.de @@ -20,6 +43,53 @@ Mon Jul 4 15:19:20 UTC 2011 - werner@suse.de - Avoid crash on unset of function within the same function +------------------------------------------------------------------- +Thu Jun 30 16:04:22 CEST 2011 - werner@suse.de + +- Update to 2011-06-30 of ksh93u which includes our patches for + several problems (e.g. Shift.JIS, S390, bnc#697394): + 11-06-22 The shell compiler now supports process substitution. + 11-06-22 +Added code to support process substitution on systems that do + not supply the /dev/fd directory. + 11-06-21 Fixed extraneous jobs Done messages when builin is at the end of a + pipeline. + 11-06-20 Fixed two regression tests. + 11-06-20 Fixed a bug introduced on last update. + 11-06-14 A bug with pipefail in which the shell would wait for background + jobs to complete has been fixed. + 11-06-09 A bug which caused the options.sh regression test to fail on OS390 + Linux has been fixed. The bug could also have affected other systems. + 11-06-07 A number of changes to support the still undocuments namespace option + have been added. + 11-06-06 A bug in which command substitution of eval would hang when it had + standard error redirected to standard output has been fixed. + 11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed. + 11-06-01 A bug in which creating a left or right justified upper or lowercase + variable with an empty string has been fixed. + 11-06-01 A bug in which the .paths directory wasn't read when a subshell was + executed before any other command has been fixed. + 11-05-31 The shell now gives an error when a type variable is assigned to + an array instance when the array has been declared a compound variable + array. + 11-05-31 A bug in which typeset -m of an array instance did not remove the + original instance has been fixed. + 11-05-28 A bug in which typeset -m dest=src fails when src and are passed as + name references was fixed. + 11-05-28 A bug in which typeset -m "c.board[1][i]=el", where el is a compound + variable core dumps has been fixed. + 11-05-28 Two bugs in the display of arrays of compound variables with print -v + have been fixed. + 11-05-27 A bug with command substitution with the shift jis locale has been + fixed. + 11-05-25 A bug in which unset -f foo, called within function foo could cause + the shell to core dump has been fixed. + 11-05-24 A bug in unsetting arrays of compound variables that could lead to + a core dump has been fixed. + 11-05-24 A scoping bug in with typeset -m for variables passed as references + has been fixed. + 11-05-09 A bug in which 'typeset +p array[$i]' in a subshell could cause an + exception has been fixed. + ------------------------------------------------------------------- Tue Jun 14 11:36:28 UTC 2011 - werner@suse.de @@ -57,6 +127,381 @@ Fri May 13 15:29:04 UTC 2011 - werner@suse.de - Add workaround to enforce synchronization on here documents done for forked sub shell or processes (bnc#690623) +------------------------------------------------------------------- +Thu May 05 15:44:33 CEST 2011 - werner@suse.de + +- Update to 2011-05-05 of ksh93u which includes various fixes for + e.g. bnc#690623, bnc#661875, and bnc#636389, from RELEASE notes: + 11-05-03 Two more scoping bug with name references and read -C were fixed. + 11-05-03 A potential race condition which occurs when here-documents are + processed in asynchronous blocks has been eliminated. + 11-05-02 Another scoping bug with name references defined in a function has + been fixed. + 11-05-02 A bug in which the shell discards saved exit status of a job if it is + followed by a subshell execution has been fixed. + 11-04-28 The shell now checks for numerical overflows with process ids. + 11-04-28 Another scoping bug with compound variables defined by name references + inside a function has been fixed. + 11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh + regression test has been fixed. + 11-04-27 A scope binding error for name references has been fixed. + 11-04-27 Assignment of compound variable to compound array element by name + is now working. + 11-04-25 A bug in the references to two domensional compound arrays has + been fixed. + 11-04-20 A bug in which a name reference to a multidimentional index array + index, nameref x=foo[3][4], did not work correctly has been fixed. + 11-04-18 Changes were added to allow fixed size arrays of variable sized + objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. + 11-04-18 A bug in which name references to array elements could fail has + been fixed. + 11-04-11 A bug in which readonly var, where var is exported could cause var + to be unset has been fixed. + 11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite + loop has been fixed. + 11-04-05 A bug in which ${!x.} could cause a core dump has been fixed. + 11-04-04 A bug in which cleaning out the history file could terminate before + keeping all the recent history events has been fixed. + 11-03-29 A bug in which ${#array[@]} was 1 rather than 0 after issuing + typeset array[7] has been fixed. + 11-03-29 The subscript out or range message for fixed arrays has been fixed. + 11-03-29 A bug in which suspend could cause a core dump has been fixed. + 11-03-24 For the showme option added 09-09-09, commands beginning with a ; + inside an arithmetic for loop, no longer produce syntax errors. + 11-03-18 A bug in _WINIX ~domain/user expansion has been fixed. + 11-03-16 A bug in the pipefail option which could cause a script to hang + has been fixed. + 11-03-12 The shell no longer treats ${##pattern} as a syntax error. + 11-03-11 A bug in typeset -u on systems that don't supply the towctrans() + function has been fixed. + 11-03-11 A bug in which a compound assignment of the form var[sub]=(...) + would evaluate sub for each assignment has been fixed. + 11-03-07 A bug in which reassigning a compound variable to an associative + array index could incorrectly increase the count of the number + of elements has been fixed. + 11-03-04 +The tilde expansion on windows has been modifed to handle user + names of the form domain/user so that ~domain/user now expands + to the home directory of that domain user. + 11-03-03 A bug in which the width of the prompt was calculated incorectly + which cause the wrong line length for edit commands has been fixed. + 11-03-02 A bug in which a global variables set from within a function inside + a subshell can leave side effects in parent shell has been fixed. + 11-03-01 A bug in which whence -a could dump core when the first match + was due to : in PATH and the program was in the current directory. + 11-02-28 A bug in emacs mode with SHOPT_EDPREDICT (added on 10-05-20) which + disabled prediction on a line starting with # when the cursor was not + at the end of line has been fixed. + 11-02-28 The output format for compound variables with set has been fixed. + 11-02-25 A bug which could lead to a core dump occurred when a shell script + without #! is invoked by name from a parent shell that has name + references defined and the script creates name references of the + same name. + 11-02-21 The shell now fails with a syntax error when a here-document in a + command substition is not completed before the closing ) + 11-02-18 A bug in which the value of $0 in a function defined by name() + was changed to name has been fixed. + 11-02-17 A bug in which the declaration typeset var[100] did not work + correctly has been fixed. + 11-02-15 A bug in which [[ -v sh.match ]] did not work correctly has been + fixed. + 11-02-08 A bug in which opening standard output after it has been closed with + exec 1>&- doesn't work has been fixed. + 11-02-07 A bug on some systems for which a command subtitution could hang + has been fixed. + 11-01-28 A bug in file name completion for files containing both multibyte + characters shell special characters has been fixed. + 11-01-18 The .sh.match variable now shows elements that do not match as + as not set rather than an empty string. + 11-01-18 A bug with typeset -m of an array into an element of an indexed + array has been fixed. + 11-01-13 A bug in handling of arrays of compound variables inside ((...)) which + reported a syntax error been fixed. + 11-01-10 A bug in arithmetic assignment operators of the form op= for array + variables when the same array was referenced on the left and the + right hand side with different indices has been fixed. + 11-01-10 A bug in which the output of time was lost when { time...;} 2>&1 + occured inside command substition has been fixed. + 11-01-07 [[ -v sh.match[i] ]] was returning false when sh.match[i] was set. + 11-01-05 Added and modified warning messages with sh -n. + 11-01-02 Fixed bugs with typeset -l/-u/-M and arrays. + 10-12-28 Fixed a bug with typeset -l/-u/-M values in arithmetric expressions. + 10-12-26 Fixed a time parsing bug in sleep and localeconv() initialization. + 10-12-23 Prevented the shell from generating a core dump when it sends itself + a termination signal because the last command terminated with that + signal. This prevents a core dump to be overwritten by the shell. + 10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01 + when A="" B=B has been fixed. + 10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults. + 10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when + i > ${#var} has been fixed. + 10-12-16 +sleep now treats . as decimal point even in locales that use comma. + 10-12-16 +typeset -M mapname was added to generalize on toupper and tolowwer + mapping as provided with wctrans(). + 10-12-10 A bug in which typeset -l displayed namespaces as well as lower case + variables has been fixed. + 10-12-06 A bug in which a pipeline could terminate prematurely for a pipeline + whose right hand side is a builtin, and whose left hand side ends in + a simple command that has standard output redirected has been fixed. + 10-12-06 A bug in hexfloat assignments when the right hand side is a string + variable starting with 0x has been fixed. + 10-12-01 A bug in the expansion of ${$1+"$@"} which causes the last positional + parameter to disappear when it is empty has been fixed. + 10-12-01 A number of changes were made to reduce the startup time. + 10-11-29 When wait is interrupted by a signal that is caught, it now exits + with a non-zero exit status. + 10-11-29 An incorrect warning message was eliminated with the -n option for + arithmetic expressions with associative arrays. + 10-11-29 Some changes were made to slightly reduces startup time. + 10-11-24 A bug in which a name reference is make to arr[0] when arr is not + an array has been fixed. + 10-11-23 If a type definition is made without a compound variable assignment it + produces an error message and no longer shows up as a defined type. + 10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has + been fixed. + 10-11-22 A patch was made to pfsh to handle an error case. + 10-11-22 +Modified types defined in namespace so that they do not clash with + types in other namespaces. Types can be referenced using .namespace.typename. + 10-11-22 A bug which caused functions addressed as .namespace.funct to not + work has been fixed. + 10-11-22 A bug in which if nr was a name reference to an unset associative + array subscript, then ${!nr} did not output the subscript correctly + has been fixed. + 10-11-18 A bug in which shcomp -n was not processing double quotes correctly + has been fixed. + 10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a + core dump. + 10-11-17 Fixed a bug in which the error message for set -u could come out + garbeled. + 10-11-17 Modified the parser so that typeset -a var=(...) no longer checks + the first index for aliases and reserved words. + 10-11-17 A bug in which a subshell command consisted of only a for or until + command has been fixed. + 10-11-16 Fixed a bug in which typeset -u would display namespace variables + as well as upper case variables. + 10-11-16 A bug which could cause a core dump when unsetting a type variable + when there are references to type elements has been fixed. + 10-11-15 A bug which could cause a core dump when unsetting a compound + array variable when there are references to array subscripts has + been fixed. + 10-11-15 A bug in which using typeset -m to move an indexed array instance + to another array could cause the array to display incorrectly has + been fixed. + 10-11-12 A bug in which the unset discipline function for a type is called + when the type is initialized has been fixed. + 10-11-12 The sequences \< and \> are now preserved after patterns contaning + ~(E) in ${var/pattern/string} expansions. + 10-11-11 A bug in typeset -m when the variables were compound arrary instances + has been fixed. + 10-11-10 A bug in output of a compound variable with types containing types + has been fixed. + 10-11-10 Fixed ``name=value export [-p]'' to list environment. + 10-11-09 shtests resets SIGPIPE to SIG_DFL for all tests. + 10-11-09 Fixed a bug in expansion of $"..." when used in assignments. + 10-11-09 Fixed a getaddrinfo() memory leak that didn't call freeaddrinfo() + after an interrupt. + 10-11-08 Modified the behavior of set -u so that the shell terminates with + error message when when var is unset with ${!var} and ${#var}. + 10-11-02 Fix a bug in which a signal received while in a subshell could be + ignored. + 10-10-26 Fix a bug where terminal interrupt was ignored while in vi/emacs + edit search mode. + 10-10-26 Fix $'a\0b'c to expand to 'ac'. + 10-10-26 Provide user defined round() if not in . + 10-10-26 Fix bug where $((undefined_function(1))) dumped core. + 10-10-22 Provide user defined iszero() if not in . + 10-10-22 Fixed a bug with BGX compile option that could cause the shell to hang. + 10-10-22 Fixed a bug with user define math function on systems for which + char is unsigned. + 10-10-21 A bug in which function autoloaded in a function leaves a file open + has been fixed. + 10-10-20 Modified the behavior of set -u so that the shell terminates when + when var is unset with ${var op string} when op is #, % or /. + 10-10-20 Fixed a bug with the AUDIT option in which the audit file was not + not close-on-exec. + 10-10-20 +Made a number of changes and fixes for the NAMESPACE compile option + which as added on 10-06-09 but some problems still remain. + 10-10-15 Fixed a bug in which arithmetic functions (added on 10-03-24) did + not work when the function definition was in the same compound + command in which the function was referenced. + 10-10-13 A bug in which creating an associative array of compound variables + with no members as an element of a compound variable did not work + has been fixed. + 10-10-08 A bug in which killing the last command in a function defined + with function name, terminated the calling script has been fixed. + 10-10-08 A bug which could cause a core dump if IFS is unset inside a function + has been fixed. + 10-10-07 +To reduce unwanted side effects, invoking typeset without the export + option and without an assignment now causes the variables to be unset + if the variable is inherited from the environment. + 10-10-06 The closing brace for ${ command } is now a token no matter what + character follows it. + 10-10-04 The change for $'...' expansion on 10-08-09 did not expand parameters + contained in the error message and this has been fixed. + 10-10-04 A bug in which a declaration of indexed array (-a_ in a type + definition would be displayed as a compound indexed array (-C -a) + has been fixed. + 10-09-30 The C99 math funtion ldexp has been added. + 10-09-30 A bug with two dimensional arrays with expansion of the form + ${ref[0..5]} where ref is a nameref to array[i] has been fixed. + 10-09-29 A bug in which an eval with redirections invoked from a dot script + would not restore the file has been fixed. + 10-09-29 A bug in which loading a function from FPATH could leave a file + descriptor open has been fixed. + 10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being + evaluation. It allows fixed sized indexed arrays be to defined + using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays + are used the same way indexed arrays are. Currently, only fixed + arrays of fixed objects (float, int, and justifies objects) are + supported. + 10-09-22 A bug which could cause an excpetion when a function with static + variables was redefined has been fixed. + 10-09-21 A bug in the processing of (command&) which created a job in the + parent process has been fixed. + 10-09-21 A for loop optimization bug with arithmetic expression evaluation + has been fixed. + 10-09-21 A bug in which a recursive function containing a pipeline could + lead to an exception fixed after 8 levels of recursion has been + fixed. + 10-09-18 A bug in which the count of elements in an array was wrong leading + to an excpetion has been fixed. + 10-09-13 A bug which occured when both xtrace and showme options where + specified in which the xtrace option disabled showme has been fixed. + 10-09-13 A bug in which creating a reference to an array variable with any + elements could cause subsequent array elements to be treated as + compound variables has been fixed. + 10-09-09 A bug which caused ((c.ar[x][y])) to be treated as a syntax error + has been fixed. + 10-09-08 A bug in the processing of references to multidimensional arrays + in arithmetic expressions has been fixed. + 10-09-08 A bug in the handling of multi-dimensional arrays which caused + the number of elements in each dimension to be incorrect has + been fixed. + 10-09-07 The change for messages on 10-08-09 did not handle message in + assignments and this has been fixed. + 10-09-07 A bug in the indentation of compound variables in arrays when + output with print -v has been fixed. + 10-09-07 A rare bug with indexed arrays when assigned a null string that could + cause a core dump has been fixed. + 10-09-03 A number of changes were made for jobs pools. + 10-08-31 typeset -p was modified to output name references after other + variables so that the output could be used as input. + 10-08-31 A bug with typeset -p in which variables with attributes but + without attributes were not displayed correctly has been fixed. + 10-08-27 +When running a subshell, the current pool is unset. + 10-08-27 A bug in which jobs started from within for or while lists in + interactive shells could generate completion messages has been fixed. + 10-08-25 Fixed a couple of bugs related to job pools. + 10-08-24 +[[ -e /dev/xxx/ ]] can be used to check whether special files of + those names are handled by the shell. + 10-08-24 A bug in the running of a compiled dot script in which only the + first command was executed has been fixed. + 10-08-23 A bug which sometimes caused a core dump with a confgire script + has been fixed. + 10-08-20 A bug in command substitution which caused a configure script to + hang has been fixed. + 10-08-19 Eliminated unnecessary ; from output of compound variable with + typeset -p. + 10-08-17 Fixed a bug in command substitution in which under certain + circumstances a file whose size is a power of 2 plus one, and the last + character was not a new-line, could cause memory corruption. + 10-08-13 +Added static discipline functions to type similar to C++ static + class functions. + 10-08-11 A bug in time when applied to a pipeline in which the shell did + not wait for all elements of the pipeline to complete has been fixed. + 10-08-11 Restored sh_fmtq() quoting to not quote NAME= in NAME=VALUE. + 10-08-09 +Modified the expansion of message strings, $"...", so that they + are expanded each time they are referenced rather than expanding + them when the script is compiled or read in. + 10-08-06 +The process id for jobs in job pools is now of the form poolname.n + where n is the jobid in that pool. Commands that accept job names + or numbers now understand names in this format. + 10-08-05 A bug in which an assignment from within an arithmetic expression + inside a function would create a local variable has been fixed. + 10-08-04 A bug in the expanding of variables whose names contain multibyte + characters has been fixed. + 10-08-04 A bug which caused an exception when processing scripts compiled + with shcomp -n has been fixed. + 10-08-02 Tests using very small buffer sizes uncovered a number of bug most + connected with here documents which have been fixed. + 10-07-27 The format modifier , used for digit grouping with d and f formats + has been documented. + 10-07-26 cd '' now produces and error rather than changing to the current + directory. + 10-07-26 A bug in multi-byte locales which the last character of a + multi-byte character is a \ or pattern character which could occur + when the character was the last character of a command substitution + has been fixed. + 10-07-23 Another bug in the processing of ${var:offset;len} in multi-byte + locales when len is larger than the number of characters has been + fixed. + 10-07-23 Many coding changes have been made to eliminate most of the uses + of global variables in the shell code. + 10-07-22 Fixed a bug in which discipline functions were not being invoked + when it was invoked as ref.discipline where ref was a name reference + to an array instance. + 10-07-22 Fixed a bug in which discipline functions were not being invoked it + was invoked on a two dimensional array, i.e., arr[5][9].discipline. + 10-07-19 Fixed a buffering problem which occured when running a script with + ssh and the parent ssh process is killed. + 10-07-14 Modifed the parser to treat ((...)) inside [[...]] as ( (...) ) to + that it is a nested (...). + 10-07-09 A bug in the handling of process substitution inside command + substitution as part of a pipeline has been fixed. + 10-07-07 A bug in the output for compound variables containing + multi-dimensional arrays has been fixed. + 10-07-06 ksh now recovers from changes made by bash to the history file without + loosing history commands. + 10-06-25 A bug in which a large here document containing command substitutions + of a dynamically loaded function that contained a here document + could get truncated has been fixed. + 10-06-24 If after executing a script found in FPATH, if a function, builtin, + or type name corresponding to that script is not defined, the shell + now outputs an error message and returns value 126. + 10-06-23 Floating point functions that happened to return integer values + were being treated as if the function returned integers so that + integer division could be used instead of floating point division. + 10-06-22 Fixed a bug in earlier ksh93u in which an arithmetic assignment to a + variable in the global scope would instead create a local variable if + the variable had an attribute but did not have a value. + 10-06-18 Modified trap handling so that if the same signal is received when + executing the handler, it is deferred until the handler completes. + 10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit + on Linux. + 10-06-14 +The command 'typeset -T' now generates the list of type definitions + in a format that can be used as input to the shell. + 10-06-09 Put in patch from Solaris for output quoting with %q. + 10-06-09 +Made changes to the NAMESPACE compile option so that it now seems + to work. With this option, namespace { command;} will + run command in the namespace .name so that all variables and + functions created by command are accessable outside the name + space via .name.var and .name.fun. Variables and functions that + are not in the namespace are not modifed when runnning command. + 10-06-07 Change most internal interfaces to take Sh_t* argument. + 10-06-03 +Types can be loaded on first reference by putting defintions in PFPATH. + 10-06-03 +The shell is now able to parse commands which use type statements + before the typeset -T command to define the type executes. + 10-06-03 A bug in the quoting for name reference declarations which did + not properly handle [ and ] in subscripts for associative arrays. + 10-06-02 A bug in which a discipline function defined by a type instance to + override the default was not being registered has been fixed. + 10-06-02 A bug in which read -C of an associative array of compound variables + was not working has been fixed. + 10-06-02 A bug in which the error message for an unset parameter with set -u + did not contain the name of the variable has been fixed. + 10-06-01 A bug in typeset -m for moving an indexed array instance to a variable + has been fixed. + 10-06-01 A bug in which caused memory to be freed twice when unset was called + for an indexed array that had get or set disciplines has been fixed. + 10-06-01 A bug in which the %b format of printf was not preserving NUL bytes + with \0 has been fixed. + 10-06-01 A bug in the handling of name references to array variables in + arithmetic expressions has been fixed. + 10-05-28 Fixed bugs in changing attributes for two dimensional arrays. + 10-05-28 Eliminated a few unreferenced variables and a reference to + uninitialized memroy. + 10-05-27 Rewrote the subshell code to avoid using pipes an many cases. + 10-05-24 Fixed a bug which cause an exception when both -l and -s were + ------------------------------------------------------------------- Fri Mar 4 16:15:16 CET 2011 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index c8d74d4..779b4c3 100644 --- a/ksh.spec +++ b/ksh.spec @@ -36,13 +36,13 @@ Requires(post): update-alternatives Requires(preun): update-alternatives %endif AutoReqProv: on -Version: 93t -Release: 202 +Version: 93u +Release: 1 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2010-06-21.tar.bz2 -Source1: ast-ksh.2010-06-21.tar.bz2 -Source2: ast-msgcc.2010-06-21.tar.bz2 +Source: INIT.2011-06-30.tar.bz2 +Source1: ast-ksh.2011-06-30.tar.bz2 +Source2: ast-msgcc.2011-06-30.tar.bz2 Source3: CPL Source10: leak1.sh Source11: leak2.sh @@ -64,21 +64,13 @@ Patch9: ksh93-compat.dif Patch10: ksh93-suid_exec.dif Patch11: ksh93-signals.dif Patch12: ksh93-limits.dif -Patch13: ksh93-sigpipe.dif +Patch13: ksh93-unset-f.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif -Patch16: ksh93-leak.dif -Patch17: ksh93-ifs.dif -Patch18: ksh93-fdfn.dif -Patch19: ksh93-fdleak.dif -Patch20: ksh93-argv0.dif -Patch21: ksh93-export.dif -Patch22: ksh93-eintr.dif -Patch23: ksh93-array.dif -Patch24: ksh93-pipe.dif -Patch25: ksh93-argv.dif -Patch26: ksh93-unset-f.dif -Patch27: ksh93-gcc.dif +Patch16: ksh93-gcc.dif +Patch17: ksh93-heredoc.dif +Patch18: ksh93-jobs.dif +Patch19: ksh93-reg.dif Patch42: ksh-locale.patch %global use_suid_exe 0 %global use_locale 0 @@ -151,14 +143,6 @@ find share/ -type d -a -empty | xargs -r rm -vrf %patch17 %patch18 %patch19 -%patch20 -%patch21 -%patch22 -%patch23 -%patch24 -%patch25 -%patch26 -%patch27 %build AR="ar" @@ -405,6 +389,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf pushd ${test} typeset -i failed=0 ln -sf ${root}/lib ${test}/../ + rm -f pty.sh ${root}/bin/ksh.test shtests ${root}/bin/ksh.test %{S:10} ${root}/bin/ksh.test %{S:11} @@ -449,7 +434,9 @@ find share/ -type d -a -empty | xargs -r rm -vrf mkdir -p %{buildroot}%{_mandir} mkdir %{buildroot}%{_mandir}/man1 mkdir %{buildroot}%{_mandir}/man3 +%if %use_locale mkdir -p %{buildroot}%{_datadir}/locale +%endif mkdir -p %{buildroot}%{_datadir}/ksh/fun mkdir -p %{buildroot}%{_sysconfdir}/permissions.d install bin/ksh %{buildroot}/%{_lib}/ast/bin/ @@ -498,20 +485,14 @@ find share/ -type d -a -empty | xargs -r rm -vrf install -m 0644 include/ast/* %{buildroot}%{_includedir}/ast/ popd %if %use_locale - for msg in share/lib/locale/* ; do - test -d $msg || continue - mkdir -p %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES - cp -vp ${msg}/LC_MESSAGES/* %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES/ - done -%else for msg in share/locale/* ; do test -d $msg || continue mkdir -p %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES cp -vp ${msg}/LC_MESSAGES/* %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES/ done -%endif echo %%dir %{_datadir}/locale/C > ksh.lang echo %%dir %{_datadir}/locale/C/LC_MESSAGES >> ksh.lang +%endif find %{buildroot}/ -type f -o -type l | sed -r ' s:%{buildroot}:: s:(%{_datadir}/locale/)([^/_]+)(.*$):%%lang\(\2\) \1\2\3: diff --git a/ksh93-argv.dif b/ksh93-argv.dif deleted file mode 100644 index d90ca01..0000000 --- a/ksh93-argv.dif +++ /dev/null @@ -1,20 +0,0 @@ ---- src/cmd/ksh93/sh/xec.c -+++ src/cmd/ksh93/sh/xec.c 2011-06-14 13:31:32.471925963 +0200 -@@ -2914,7 +2914,7 @@ int sh_fun(Namval_t *np, Namval_t *nq, c - long mode; - char *prefix = shp->prefix; - int n=0; -- char *av[2]; -+ char *av[3]; - Fcin_t save; - fcsave(&save); - if((offset=staktell())>0) -@@ -2922,7 +2922,7 @@ int sh_fun(Namval_t *np, Namval_t *nq, c - shp->prefix = 0; - if(!argv) - { -- argv = av; -+ argv = av+1; - argv[1]=0; - } - argv[0] = nv_name(np); diff --git a/ksh93-argv0.dif b/ksh93-argv0.dif deleted file mode 100644 index 75f93d9..0000000 --- a/ksh93-argv0.dif +++ /dev/null @@ -1,10 +0,0 @@ ---- src/cmd/ksh93/bltins/misc.c -+++ src/cmd/ksh93/bltins/misc.c 2011-02-22 13:03:35.783936889 +0000 -@@ -273,7 +273,6 @@ int b_dot_cmd(register int n,char *ar - shp->st.self = &savst; - shp->topscope = (Shscope_t*)shp->st.self; - prevscope->save_tree = shp->var_tree; -- shp->st.cmdname = argv[0]; - if(np) - shp->st.filename = np->nvalue.rp->fname; - nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE); diff --git a/ksh93-array.dif b/ksh93-array.dif deleted file mode 100644 index 8723c7e..0000000 --- a/ksh93-array.dif +++ /dev/null @@ -1,62 +0,0 @@ ---- src/cmd/ksh93/sh/array.c -+++ src/cmd/ksh93/sh/array.c 2011-05-20 12:42:14.555927664 +0000 -@@ -410,7 +410,7 @@ static Namfun_t *array_clone(Namval_t *n - mq = 0; - if(nq=nv_opensub(np)) - mq = nv_search(name,ap->table,NV_ADD); -- if(nq && (flags&NV_COMVAR) && nv_isvtree(nq)) -+ if(nq && (((flags&NV_COMVAR) && nv_isvtree(nq)) || nv_isarray(nq))) - { - mq->nvalue.cp = 0; - if(!is_associative(ap)) -@@ -458,6 +458,7 @@ static char *array_getval(Namval_t *np, - { - register Namarr_t *aq,*ap = (Namarr_t*)disc; - register Namval_t *mp; -+ register char *cp=0; - if((mp=array_find(np,ap,ARRAY_LOOKUP))!=np) - { - if(!mp && !is_associative(ap) && (aq=(Namarr_t*)ap->scope)) -@@ -466,7 +467,12 @@ static char *array_getval(Namval_t *np, - if((mp=array_find(np,aq,ARRAY_LOOKUP))==np) - return(nv_getv(np,&aq->hdr)); - } -- return(mp?nv_getval(mp):0); -+ if(mp) -+ { -+ cp = nv_getval(mp); -+ nv_offattr(mp,NV_EXPORT); -+ } -+ return(cp); - } - return(nv_getv(np,&ap->hdr)); - } -@@ -667,7 +673,7 @@ static struct index_array *array_grow(Na - ap->header.hdr.dsize = sizeof(*ap) + i; - i = 0; - ap->header.fun = 0; -- if(nv_isnull(np) && nv_isattr(np,NV_NOFREE)) -+ if((nv_isnull(np)|| np->nvalue.cp==Empty) && nv_isattr(np,NV_NOFREE)) - { - i = ARRAY_TREE; - nv_offattr(np,NV_NOFREE); -@@ -1236,7 +1242,7 @@ void *nv_associative(register Namval_t * - for(;ap->cur=ap->pos; ap->pos=ap->nextpos) - { - ap->nextpos = (Namval_t*)dtnext(ap->header.table,ap->pos); -- if(ap->cur->nvalue.cp) -+ if(!nv_isnull(ap->cur)) - { - if((ap->header.nelem&ARRAY_NOCHILD) && nv_isattr(ap->cur,NV_CHILD)) - continue; ---- src/cmd/ksh93/sh/xec.c -+++ src/cmd/ksh93/sh/xec.c 2011-06-14 13:31:32.471925963 +0200 -@@ -680,7 +680,7 @@ static int set_instance(Shell_t *shp,Nam - char *sp=0,*cp; - Namarr_t *ap; - Namval_t *np; -- if(!nv_isattr(nq,NV_MINIMAL|NV_EXPORT) && (np=(Namval_t*)nq->nvenv) && nv_isarray(np)) -+ if(!nv_isattr(nq,NV_MINIMAL|NV_EXPORT|NV_ARRAY) && (np=(Namval_t*)nq->nvenv) && nv_isarray(np)) - nq = np; - cp = nv_name(nq); - memset(nr,0,sizeof(*nr)); diff --git a/ksh93-eintr.dif b/ksh93-eintr.dif deleted file mode 100644 index f166506..0000000 --- a/ksh93-eintr.dif +++ /dev/null @@ -1,91 +0,0 @@ ---- src/cmd/ksh93/sh/io.c -+++ src/cmd/ksh93/sh/io.c 2011-05-03 15:15:18.283926707 +0200 -@@ -403,6 +403,7 @@ - shp->sftable[2] = sfstderr; - sfnotify(sftrack); - sh_iostream(shp,0); -+ sh_iostream(shp,1); - /* all write steams are in the same pool and share outbuff */ - shp->outpool = sfopen(NIL(Sfio_t*),NIL(char*),"sw"); /* pool identifier */ - shp->outbuff = (char*)malloc(IOBSIZE+4); -@@ -608,7 +609,8 @@ - } - if(sp) - shp->sftable[f1] = 0; -- sh_close(f1); -+ if(shp->fdstatus[f1]!=IOCLOSE) -+ sh_close(f1); - } - return(f2); - } -@@ -1022,6 +1024,8 @@ - memset(ap, 0, ARGVAL); - if(iof&IOPUT) - ap->argflag = ARG_RAW; -+ else if(shp->subshell) -+ sh_subtmpfile(shp); - ap->argchn.ap = (struct argnod*)fname; - ap = sh_argprocsub(shp,ap); - fname = ap->argval; -@@ -2148,13 +2152,18 @@ - static ssize_t subread(Sfio_t* sp,void* buff,register size_t size,Sfdisc_t* handle) - { - register struct subfile *disp = (struct subfile*)handle; -+ ssize_t n; - NOT_USED(sp); -+ sfseek(disp->oldsp,disp->offset,SEEK_SET); - if(disp->left == 0) - return(0); - if(size > disp->left) - size = disp->left; - disp->left -= size; -- return(sfread(disp->oldsp,buff,size)); -+ n = sfread(disp->oldsp,buff,size); -+ if(size>0) -+ disp->offset += size; -+ return(n); - } - - /* ---- src/cmd/ksh93/sh/xec.c -+++ src/cmd/ksh93/sh/xec.c 2011-05-03 15:02:23.411926136 +0200 -@@ -53,6 +53,7 @@ - - #define SH_NTFORK SH_TIMING - #define NV_BLTPFSH NV_ARRAY -+#define HERE_MEM 0x1000 - - #if _lib_nice - extern int nice(int); -@@ -2606,6 +2607,7 @@ - - pid_t sh_fork(int flags, int *jobid) - { -+ Sfio_t* aux_heredocs = NIL(Sfio_t*); - register pid_t parent; - register int sig; - #if SHOPT_FASTPIPE -@@ -2625,7 +2627,23 @@ - sh.trapnote &= ~SH_SIGTERM; - job_fork(-1); - sh.savesig = -1; -+ if (sh.heredocs) -+ { -+ aux_heredocs = sftmp(HERE_MEM); -+ if (aux_heredocs) -+ { -+ sfseek(sh.heredocs,(off_t)0,SEEK_SET); -+ sfmove(sh.heredocs,aux_heredocs,(Sfoff_t)(-1),-1); -+ sfsync(aux_heredocs); -+ } -+ } - while(_sh_fork(parent=fork(),flags,jobid) < 0); -+ if (aux_heredocs) -+ { -+ if (!parent) -+ sfswap(aux_heredocs,sh.heredocs); -+ sfclose(aux_heredocs); -+ } - sh_stats(STAT_FORKS); - sig = sh.savesig; - sh.savesig = 0; diff --git a/ksh93-export.dif b/ksh93-export.dif deleted file mode 100644 index ae56d8a..0000000 --- a/ksh93-export.dif +++ /dev/null @@ -1,11 +0,0 @@ ---- src/cmd/ksh93/sh/subshell.c -+++ src/cmd/ksh93/sh/subshell.c 2011-03-04 15:13:49.867926146 +0000 -@@ -235,7 +235,7 @@ Namval_t *sh_assignok(register Namval_t - if(!sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD) - return(np); - /* don't bother to save if in newer scope */ -- if(sp->var!=shp->var_tree && shp->last_root==shp->var_tree) -+ if(sp->var!=shp->var_tree && sp->var!=shp->var_base && shp->last_root==shp->var_tree) - return(np); - if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np))) - { diff --git a/ksh93-fdfn.dif b/ksh93-fdfn.dif deleted file mode 100644 index 45fb717..0000000 --- a/ksh93-fdfn.dif +++ /dev/null @@ -1,10 +0,0 @@ ---- src/cmd/ksh93/sh/path.c -+++ src/cmd/ksh93/sh/path.c 2010-10-19 10:57:53.556425877 +0000 -@@ -747,6 +747,7 @@ int path_search(register const char *nam - return(1); - } - funload(shp,fno,name); -+ sh_close(fno); - return(1); - } - *stakptr(PATH_OFFSET) = 0; diff --git a/ksh93-fdleak.dif b/ksh93-fdleak.dif deleted file mode 100644 index e21d970..0000000 --- a/ksh93-fdleak.dif +++ /dev/null @@ -1,10 +0,0 @@ ---- src/cmd/ksh93/edit/history.c -+++ src/cmd/ksh93/edit/history.c 2010-10-21 10:35:05.567927921 +0000 -@@ -394,6 +394,7 @@ retry: - } - if(fd>=0) - { -+ fcntl(fd,F_SETFD,FD_CLOEXEC); - hp->tty = strdup(ttyname(2)); - hp->auditfp = sfnew((Sfio_t*)0,NULL,-1,fd,SF_WRITE); - } diff --git a/ksh93-heredoc.dif b/ksh93-heredoc.dif new file mode 100644 index 0000000..979f602 --- /dev/null +++ b/ksh93-heredoc.dif @@ -0,0 +1,81 @@ +|Subject: here doc bug with locales +--- src/cmd/ksh93/include/fcin.h Tue Aug 3 11:43:29 2010 ++++ src/cmd/ksh93/include/fcin.h Wed Jul 20 14:52:54 2011 +@@ -35,6 +35,8 @@ + #define fcpeek(n) ((int)_Fcin.fcptr[n]) + #define fcseek(n) ((char*)(_Fcin.fcptr+=(n))) + #define fcfirst() ((char*)_Fcin.fcbuff) ++#define fclast() ((char*)_Fcin.fclast) ++#define fcleft() (_Fcin.fclast-_Fcin.fcptr) + #define fcsopen(s) (_Fcin._fcfile=(Sfio_t*)0,_Fcin.fclen=1,_Fcin.fcbuff=_Fcin.fcptr=(unsigned char*)(s)) + #define fctell() (_Fcin.fcoff + (_Fcin.fcptr-_Fcin.fcbuff)) + #define fcsave(x) (*(x) = _Fcin) +--- src/cmd/ksh93/sh/lex.c Wed Apr 6 12:05:19 2011 ++++ src/cmd/ksh93/sh/lex.c Wed Jul 20 14:59:04 2011 +@@ -1564,7 +1564,10 @@ static int comsub(register Lex_t *lp, in + { + + if(first==lp->lexd.first) +- fcseek(cp+1-fcseek(0)); ++ { ++ const char *tp = fcseek(0); ++ fcseek(cp+1-tp); ++ } + count++; + lp->lexd.paren = 0; + fcgetc(c); +@@ -1817,18 +1820,41 @@ static int here_copy(Lex_t *lp,register + if(n!=S_NL) + { + /* skip over regular characters */ ++#if SHOPT_MULTIBYTE ++ do ++ { ++ if(fcleft()< MB_LEN_MAX && mbsize(fcseek(0))<0) ++ { ++ n = S_EOF; ++ LEN = -fcleft(); ++ break; ++ } ++ } ++#endif /* SHOPT_MULTIBYTE */ + while((n=STATE(state,c))==0); + } + if(n==S_EOF || !(c=fcget())) + { +- if(!lp->lexd.dolparen && (c=(fcseek(0)-1)-bufp)) ++ if(LEN < 0) ++ c = fclast()-bufp; ++ else ++ c= (fcseek(0)-1)-bufp; ++ if(!lp->lexd.dolparen && c) + { + if(n==S_ESC) + c--; + if(!lp->lexd.dolparen && (c=sfwrite(sp,bufp,c))>0) + iop->iosize += c; + } +- if((c=lexfill(lp))<=0) ++ if(LEN < 0) ++ { ++ n = LEN; ++ c = fcmbget(&LEN); ++ LEN += n; ++ } ++ else ++ c = lexfill(lp); ++ if(c<0) + break; + if(n==S_ESC) + { +@@ -1844,7 +1870,9 @@ static int here_copy(Lex_t *lp,register + sfputc(sp,'\\'); + } + } +- bufp = fcseek(-1); ++ if (LEN < 1) ++ LEN = 1; ++ bufp = fcseek(-LEN); + } + else + fcseek(-LEN); diff --git a/ksh93-ifs.dif b/ksh93-ifs.dif deleted file mode 100644 index 18579a3..0000000 --- a/ksh93-ifs.dif +++ /dev/null @@ -1,41 +0,0 @@ ---- - src/cmd/ksh93/sh/init.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - ---- src/cmd/ksh93/sh/init.c -+++ src/cmd/ksh93/sh/init.c 2010-10-08 12:43:27.123926224 +0000 -@@ -456,6 +456,8 @@ static void put_cdpath(register Namval_t - } - #endif /* _hdr_locale */ - -+static const void* ifs_hdr; -+ - /* Trap for IFS assignment and invalidates state table */ - static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp) - { -@@ -464,9 +466,14 @@ static void put_ifs(register Namval_t* n - ip->ifsnp = 0; - if(!val) - { -- fp = nv_stack(np, NIL(Namfun_t*)); -- if(fp && !fp->nofree) -- free((void*)fp); -+ Namfun_t *xp = nv_stack(np, NIL(Namfun_t*)); -+ if(xp) -+ { -+ if(xp == ifs_hdr) -+ xp->nofree = 1; -+ if(xp->nofree == 0) -+ free((void*)xp); -+ } - } - if(val != np->nvalue.cp) - nv_putv(np, val, flags, fp); -@@ -1597,6 +1604,7 @@ static Init_t *nv_init(Shell_t *shp) - ip->LANG_init.nofree = 1; - #endif /* _hdr_locale */ - nv_stack(IFSNOD, &ip->IFS_init.hdr); -+ ifs_hdr = (IFSNOD)->nvfun; - nv_stack(PATHNOD, &ip->PATH_init); - nv_stack(FPATHNOD, &ip->FPATH_init); - nv_stack(CDPNOD, &ip->CDPATH_init); diff --git a/ksh93-jobs.dif b/ksh93-jobs.dif new file mode 100644 index 0000000..81f677f --- /dev/null +++ b/ksh93-jobs.dif @@ -0,0 +1,19 @@ +--- src/cmd/ksh93/sh/jobs.c ++++ src/cmd/ksh93/sh/jobs.c 2011-08-15 18:43:23.005726321 +0200 +@@ -1103,7 +1103,7 @@ static struct process *job_bystring(regi + + int job_kill(register struct process *pw,register int sig) + { +- Shell_t *shp = pw->p_shp; ++ Shell_t *shp; + register pid_t pid; + register int r; + const char *msg; +@@ -1116,6 +1116,7 @@ int job_kill(register struct process *pw + errno = ECHILD; + if(pw==0) + goto error; ++ shp = pw->p_shp; + pid = pw->p_pid; + #if SHOPT_COSHELL + if(pw->p_cojob) diff --git a/ksh93-leak.dif b/ksh93-leak.dif deleted file mode 100644 index 6588c5f..0000000 --- a/ksh93-leak.dif +++ /dev/null @@ -1,11 +0,0 @@ ---- src/cmd/ksh93/sh/nvdisc.c -+++ src/cmd/ksh93/sh/nvdisc.c 2010-06-29 14:07:19.578925435 +0000 -@@ -1347,7 +1347,7 @@ Dt_t *nv_dict(Namval_t* np) - Namval_t *nv_mount(Namval_t *np, const char *name, Dt_t *dict) - { - Namval_t *mp, *pp=0; -- struct table *tp = newof((struct table*)0, struct table,1,0); -+ struct table *tp; - if(name) - { - if(nv_istable(np)) diff --git a/ksh93-limits.dif b/ksh93-limits.dif index c1c6227..9f96958 100644 --- a/ksh93-limits.dif +++ b/ksh93-limits.dif @@ -1,5 +1,5 @@ --- src/lib/libast/comp/conf.sh -+++ src/lib/libast/comp/conf.sh 2007-09-13 10:39:15.000000000 +0000 ++++ src/lib/libast/comp/conf.sh 2010-08-17 17:45:16.129814168 +0200 @@ -143,7 +143,7 @@ main() return 1; #else @@ -45,7 +45,7 @@ #include $systeminfo$headers ${tail} #undef conf -@@ -1031,7 +1043,7 @@ do eval name=\"'$'CONF_name_$key\" +@@ -1032,7 +1044,7 @@ do eval name=\"'$'CONF_name_$key\" case $flags in *[Ll]*) d= case ${conf_name} in @@ -54,7 +54,7 @@ x= ;; *) eval x='$'CONF_const_${conf_name} -@@ -1091,7 +1103,11 @@ do eval name=\"'$'CONF_name_$key\" +@@ -1092,7 +1104,11 @@ do eval name=\"'$'CONF_name_$key\" ${head} #include #include @@ -66,9 +66,9 @@ #include $systeminfo$headers ${tail} int -@@ -1105,7 +1121,11 @@ main() - *) cat > $tmp.c < #include +#include #include @@ -78,7 +78,7 @@ #include $systeminfo$headers ${tail} ${script} -@@ -1249,7 +1269,11 @@ printf("#endif\n"); +@@ -1254,7 +1274,11 @@ printf("#endif\n"); *) cat > $tmp.c < @@ -90,7 +90,7 @@ #include $systeminfo$headers ${tail} ${script} -@@ -1322,7 +1346,7 @@ ${script} +@@ -1333,7 +1357,7 @@ ${script} *[lLuU]) case $LL_suffix in ??) case $conf_limit in @@ -99,7 +99,7 @@ conf_limit=${conf_limit}L ;; esac -@@ -1357,7 +1381,7 @@ ${script} +@@ -1368,7 +1392,7 @@ ${script} *[lLuU]) case $LL_suffix in ??) case $conf_minmax in @@ -108,7 +108,7 @@ conf_minmax=${conf_minmax}L ;; esac -@@ -1533,7 +1557,11 @@ esac +@@ -1545,7 +1569,11 @@ esac cat < diff --git a/ksh93-pipe.dif b/ksh93-pipe.dif deleted file mode 100644 index 201cd7c..0000000 --- a/ksh93-pipe.dif +++ /dev/null @@ -1,188 +0,0 @@ ---- src/cmd/ksh93/include/defs.h -+++ src/cmd/ksh93/include/defs.h 2011-06-10 17:37:22.852426230 +0200 -@@ -154,7 +154,7 @@ struct limits - pid_t bckpid; /* background process id */ \ - pid_t cpid; \ - pid_t pipepid; \ -- int32_t ppid; /* parent process id of shell */ \ -+ pid_t ppid; /* parent process id of shell */ \ - int topfd; \ - int sigmax; /* maximum number of signals */ \ - int savesig; \ ---- src/cmd/ksh93/sh/io.c -+++ src/cmd/ksh93/sh/io.c 2011-06-10 18:13:02.511926423 +0200 -@@ -1076,15 +1076,18 @@ int sh_redirect(Shell_t *shp,struct iono - message = e_file; - goto fail; - } -- if(shp->subshell && dupfd==1 && (sfset(sfstdout,0,0)&SF_STRING)) -+ if(shp->subshell && dupfd==1) - { - if(sfset(sfstdout,0,0)&SF_STRING) - sh_subtmpfile(shp); -- shp->subdup |= 1<< fn; -+ if(shp->comsub==1) -+ shp->subdup |= 1<< fn; - dupfd = sffileno(sfstdout); - } - else if(shp->sftable[dupfd]) - sfsync(shp->sftable[dupfd]); -+ if(dupfd!=1 && fn < 10) -+ shp->subdup &= ~(1<fdstatus[subpipe[2]] = shp->fdstatus[1]; -@@ -112,6 +113,7 @@ static void iounpipe(Shell_t *shp) - { - int n; - char buff[SF_BUFSIZE]; -+ usepipe = 0; - close(1); - fcntl(subpipe[2], F_DUPFD, 1); - shp->fdstatus[1] = shp->fdstatus[subpipe[2]]; -@@ -135,6 +137,7 @@ static void iounpipe(Shell_t *shp) - } - sh_close(subpipe[0]); - subpipe[0] = -1; -+ tsetio = 0; - } - - /* -@@ -533,8 +536,10 @@ int sh_eval(register Sfio_t *iop, int mo - static Sfio_t *io_save; - volatile int traceon=0, lineno=0; - int binscript=shp->binscript; -+ char comsub = shp->comsub; - io_save = iop; /* preserve correct value across longjmp */ - shp->binscript = 0; -+ shp->comsub = 0; - #define SH_TOPFUN 0x8000 /* this is a temporary tksh hack */ - if (mode & SH_TOPFUN) - { -@@ -573,6 +578,7 @@ int sh_eval(register Sfio_t *iop, int mo - break; - } - sh_popcontext(&buff); -+ shp->comsub = comsub; - shp->binscript = binscript; - if(traceon) - sh_onoption(SH_XTRACE); -@@ -1245,13 +1251,16 @@ int sh_exec(register const Shnode_t *t, - { - register pid_t parent; - int no_fork,jobid; -- int pipes[2]; -+ int pipes[3]; - if(shp->subshell) - { - sh_subtmpfile(shp); -- subpipe[0] = -1; -- if(shp->comsub==1 && !(shp->fdstatus[1]&IONOSEEK) && sh_pipe(subpipe)>=0) -- iousepipe(shp); -+ if(!usepipe) -+ { -+ subpipe[0] = -1; -+ if(shp->comsub==1 && !(shp->fdstatus[1]&IONOSEEK) && sh_pipe(subpipe)>=0) -+ iousepipe(shp); -+ } - if((type&(FAMP|TFORK))==(FAMP|TFORK)) - sh_subfork(); - } -@@ -1291,7 +1300,10 @@ int sh_exec(register const Shnode_t *t, - #endif /* SHOPT_BGX */ - nv_getval(RANDNOD); - if(type&FCOOP) -+ { -+ pipes[2] = 0; - coproc_init(shp,pipes); -+ } - #if SHOPT_AMP - if((type&(FAMP|FINT)) == (FAMP|FINT)) - parent = sh_ntfork(shp,t,com,&jobid,ntflag); -@@ -1353,6 +1365,8 @@ int sh_exec(register const Shnode_t *t, - shp->pipepid = parent; - else - job_wait(parent); -+ if(usepipe && tsetio && subdup) -+ iounpipe(shp); - if(!sh_isoption(SH_MONITOR)) - { - shp->trapnote &= ~SH_SIGIGNORE; -@@ -1496,6 +1510,8 @@ int sh_exec(register const Shnode_t *t, - jmpval = sigsetjmp(buff.buff,0); - if(jmpval==0) - { -+ if(shp->comsub==1) -+ tsetio = 1; - sh_redirect(shp,t->fork.forkio,execflg); - (t->fork.forktre)->tre.tretyp |= t->tre.tretyp&FSHOWME; - sh_exec(t->fork.forktre,flags&~simple); -@@ -1523,6 +1539,8 @@ int sh_exec(register const Shnode_t *t, - if(type || !sh_isoption(SH_PIPEFAIL)) - shp->exitval = type; - } -+ if(shp->comsub==1 && subpipe[0]>=0) -+ iounpipe(shp); - shp->pipepid = 0; - shp->st.ioset = 0; - if(simple && was_errexit) -@@ -1580,14 +1598,22 @@ int sh_exec(register const Shnode_t *t, - * All elements of the pipe are started by the parent. - * The last element executes in current environment - */ -- int pvo[2]; /* old pipe for multi-stage */ -- int pvn[2]; /* current set up pipe */ -+ int pvo[3]; /* old pipe for multi-stage */ -+ int pvn[3]; /* current set up pipe */ - int savepipe = pipejob; - int showme = t->tre.tretyp&FSHOWME; - pid_t savepgid = job.curpgid; - job.curpgid = 0; - if(shp->subshell) -+ { - sh_subtmpfile(shp); -+ if(!usepipe) -+ { -+ subpipe[0] = -1; -+ if(shp->comsub==1 && !(shp->fdstatus[1]&IONOSEEK) && sh_pipe(subpipe)>=0) -+ iousepipe(shp); -+ } -+ } - shp->inpipe = pvo; - shp->outpipe = pvn; - pvo[1] = -1; -@@ -2543,7 +2569,10 @@ pid_t _sh_fork(register pid_t parent,int - if(jobid) - *jobid = myjob; - if(shp->comsub==1 && subpipe[0]>=0) -- iounpipe(shp); -+ { -+ if(!tsetio || !subdup) -+ iounpipe(shp); -+ } - return(parent); - } - #if !_std_malloc -@@ -2602,6 +2631,7 @@ pid_t _sh_fork(register pid_t parent,int - if(sig>0) - sh_fault(sig); - sh_sigcheck(); -+ usepipe=0; - return(0); - } - diff --git a/ksh93-profile.dif b/ksh93-profile.dif index d58be34..5b9456d 100644 --- a/ksh93-profile.dif +++ b/ksh93-profile.dif @@ -1,14 +1,12 @@ --- src/cmd/ksh93/sh/main.c -+++ src/cmd/ksh93/sh/main.c 2008-09-11 17:10:58.130673081 +0200 -@@ -210,17 +210,39 @@ int sh_main(int ac, char *av[], Shinit_f - } - job_init(shp,sh_isoption(SH_LOGIN_SHELL)); - if(sh_isoption(SH_LOGIN_SHELL)) -- { ++++ src/cmd/ksh93/sh/main.c 2010-08-17 17:35:18.099125448 +0200 +@@ -219,14 +219,38 @@ int sh_main(int ac, char *av[], Shinit_f + { /* system profile */ sh_source(shp, iop, e_sysprofile); ++ } + /* make sure PWD is set up correctly */ -+ path_pwd(1); ++ path_pwd(shp,1); +#if SHOPT_SYSRC + if(!sh_isoption(SH_NOEXEC)) + { @@ -34,26 +32,26 @@ + { if(!sh_isoption(SH_NOUSRPROFILE) && !sh_isoption(SH_PRIVILEGED)) { - char **files = shp->login_files; + char **files = shp->gd->login_files; while ((name = *files++) && !sh_source(shp, iop, sh_mactry(shp,name))); } } - /* make sure PWD is set up correctly */ -- path_pwd(1); +- path_pwd(shp,1); if(!sh_isoption(SH_NOEXEC)) { if(!sh_isoption(SH_NOUSRPROFILE) && !sh_isoption(SH_PRIVILEGED) && sh_isoption(SH_RC)) -@@ -228,9 +250,6 @@ int sh_main(int ac, char *av[], Shinit_f +@@ -234,9 +258,6 @@ int sh_main(int ac, char *av[], Shinit_f #if SHOPT_BASH if(sh_isoption(SH_BASH) && !sh_isoption(SH_POSIX)) { -#if SHOPT_SYSRC - sh_source(shp, iop, e_bash_sysrc); -#endif - sh_source(shp, iop, shp->rcfile ? shp->rcfile : sh_mactry(shp,(char*)e_bash_rc)); + sh_source(shp, iop, shp->gd->rcfile ? shp->gd->rcfile : sh_mactry(shp,(char*)e_bash_rc)); } else -@@ -238,10 +257,6 @@ int sh_main(int ac, char *av[], Shinit_f +@@ -244,10 +265,6 @@ int sh_main(int ac, char *av[], Shinit_f { if(name = sh_mactry(shp,nv_getval(ENVNOD))) name = *name ? strdup(name) : (char*)0; diff --git a/ksh93-reg.dif b/ksh93-reg.dif new file mode 100644 index 0000000..1e7f841 --- /dev/null +++ b/ksh93-reg.dif @@ -0,0 +1,39 @@ +--- src/cmd/ksh93/edit/edit.c ++++ src/cmd/ksh93/edit/edit.c 2011-08-30 16:07:02.059926160 +0000 +@@ -1668,7 +1668,7 @@ int ed_histgen(Edit_t *ep,const char *pa + History_t *hp; + off_t offset; + int ac=0,l,m,n,index1,index2; +- char *cp, **argv, **av, **ar; ++ char *cp, **argv=0, **av, **ar; + if(!(hp=ep->sh->gd->hist_ptr)) + return(0); + if(*pattern=='#') +@@ -1746,8 +1746,13 @@ int ed_histgen(Edit_t *ep,const char *pa + mplast->next = mp; + mplast->next = 0; + } +- ep->hlist = (Histmatch_t**)argv; +- ep->hfirst = ep->hlist[0]; ++ if (argv) ++ { ++ ep->hlist = (Histmatch_t**)argv; ++ ep->hfirst = ep->hlist[0]; ++ } ++ else ++ ep->hfirst = 0; + return(ep->hmax=ac); + } + +--- src/cmd/ksh93/sh/name.c ++++ src/cmd/ksh93/sh/name.c 2011-08-30 15:55:30.900426385 +0000 +@@ -967,7 +967,8 @@ Namval_t *nv_create(const char *name, D + if(c=='.' && (cp[1]==0 || cp[1]=='=' || cp[1]=='+')) + { + nv_local = 1; +- nv_onattr(np,nofree); ++ if (np) ++ nv_onattr(np,nofree); + return(np); + } + if(cp[-1]=='.') diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 8afefcd..b800392 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -8,7 +8,7 @@ #include #include #include "FEATURE/options" -@@ -56,8 +57,20 @@ static char CURSOR_UP[20] = { ESC, '[', +@@ -57,8 +58,20 @@ static char KILL_LINE[20] = { ESC, '[', #if SHOPT_MULTIBYTE @@ -51,7 +51,7 @@ # define gencpy(a,b) ed_gencpy(a,b) # define genncpy(a,b,n) ed_genncpy(a,b,n) # define genlen(str) ed_genlen(str) -@@ -1473,11 +1477,19 @@ static void setcursor(register Emacs_t * +@@ -1559,11 +1563,19 @@ static void setcursor(register Emacs_t * #if SHOPT_MULTIBYTE static int print(register int c) { @@ -106,8 +106,8 @@ static int _isalph(int); static int _ismetach(int); --- src/cmd/ksh93/sh/io.c -+++ src/cmd/ksh93/sh/io.c 2010-06-28 16:09:09.174925785 +0200 -@@ -1367,6 +1367,7 @@ static int io_heredoc(Shell_t *shp,regis ++++ src/cmd/ksh93/sh/io.c 2010-06-28 14:09:09.000000000 +0000 +@@ -1514,6 +1514,7 @@ static int io_heredoc(Shell_t *shp,regis if(traceon) sfprintf(sfstderr,"< %s\n",name); sfputr(outfile,name,'\n'); @@ -116,110 +116,8 @@ else { --- src/cmd/ksh93/sh/macro.c -+++ src/cmd/ksh93/sh/macro.c 2011-06-10 08:20:29.451926367 +0000 -@@ -51,6 +51,8 @@ - - #if !SHOPT_MULTIBYTE - #define mbchar(p) (*(unsigned char*)p++) -+#else -+#define mb2wc(w,p,n) (*ast.mb_towc)(&w,(char*)p,n) - #endif - - static int _c_; -@@ -494,7 +496,7 @@ static void copyto(register Mac_t *mp,in - int i; - unsigned char mb[8]; - -- n = wctomb((char*)mb, c); -+ n = mbconv((char*)mb, c); - for(i=0;i1) -+ { -+ len = mb2wc(lastw,str,len); -+ if (len < 0) -+ { -+ lastw = 0; -+ len = 1; -+ } -+ } -+#endif -+ c -= len; -+ lastc = str[c]; - str[c] = 0; - } - mac_copy(mp,str,c); -@@ -2102,7 +2135,21 @@ static void comsubst(Mac_t *mp,register - sfnputc(stkp,'\n',newlines); - } - if(lastc) -+ { -+#if SHOPT_MULTIBYTE -+ if(lastw) -+ { -+ int n; -+ char mb[8]; -+ n = mbconv(mb, lastw); -+ mac_copy(mp,mb,n); -+ lastw = 0; -+ } -+ else -+#endif - mac_copy(mp,&lastc,1); -+ lastc = 0; -+ } - sfclose(sp); - return; - } -@@ -2173,13 +2220,13 @@ static void mac_copy(register Mac_t *mp, ++++ src/cmd/ksh93/sh/macro.c 2011-05-27 13:08:05.000000000 +0200 +@@ -2341,13 +2341,13 @@ static void mac_copy(register Mac_t *mp, if(mp->pattern) { char *sp = "&|()"; @@ -347,15 +245,17 @@ #define STUB 1 --- src/lib/libast/features/wchar +++ src/lib/libast/features/wchar 2007-12-20 17:50:28.000000000 +0000 -@@ -1,5 +1,6 @@ - set prototyped +@@ -7,7 +7,8 @@ cat{ + #define _AST_WCHAR_H 1 + }end + -lib mbstowcs,wctomb,wcrtomb,wcslen,wcstombs,wcwidth stdlib.h stdio.h wchar.h +lib mbstowcs,wctomb,wcrtomb,wcslen,wcstombs,wcscpy,wcwidth stdlib.h stdio.h wchar.h wctype.h +lib iswprint,iswalpha,iswalnum,iswdigit,iswcntrl stdlib.h stdio.h ctype.h wctype.h lib towlower,towupper stdlib.h stdio.h wchar.h typ mbstate_t stdlib.h stdio.h wchar.h nxt wchar -@@ -31,6 +32,12 @@ cat <1) + #define mb2wc(w,p,n) (*ast.mb_towc)(&w,(char*)p,n) -#define mbchar(p) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) -#define mbnchar(p,n) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) #define mbinit() (mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0) #define mbsize(p) (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1)) - #define mbconv(s,w) (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1)) - #define mbwidth(w) (ast.mb_width&&((ast.tmp_int=(*ast.mb_width)(w))>=0||(w)>UCHAR_MAX)?ast.tmp_int:1) + #define mbnsize(p,n) (mbwide()?(*ast.mb_len)((char*)(p),n):((p),1)) +@@ -195,6 +193,17 @@ typedef struct #define mbxfrm(t,f,n) (mbcoll()?(*ast.mb_xfrm)((char*)(t),(char*)(f),n):0) + #define mbalpha(w) (ast.mb_alpha?(*ast.mb_alpha)(w):isalpha((w)&0xff)) +#define mbchar(p) (mbwide() ? \ + (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0) ? \ @@ -420,13 +321,13 @@ #include --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2007-12-20 18:51:50.000000000 +0100 -@@ -496,7 +496,7 @@ make cat.o ++++ src/lib/libcmd/Mamfile 2011-05-20 13:40:30.643926303 +0000 +@@ -508,7 +508,7 @@ make cat.o prev cat.c - meta cat.o %.c>%.o ${PACKAGEROOT}/src/lib/libcmd/cat.c cat + meta cat.o %.c>%.o cat.c cat prev cat.c --exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c -+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c +-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2011 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c ++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2011 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c done cat.o generated make chgrp.o prev chgrp.c diff --git a/ksh93-signals.dif b/ksh93-signals.dif index 2c075ce..7b90a91 100644 --- a/ksh93-signals.dif +++ b/ksh93-signals.dif @@ -9,25 +9,6 @@ #include "shtable.h" #include "fault.h" ---- src/cmd/ksh93/sh/jobs.c -+++ src/cmd/ksh93/sh/jobs.c 2010-03-03 14:17:34.812626467 +0100 -@@ -279,7 +279,7 @@ int job_reap(register int sig) - } - pid = waitpid((pid_t)-1,&wstat,flags); - sh_offstate(SH_TTYWAIT); -- -+#ifdef WCONTINUED - /* - * some systems (linux 2.6) may return EINVAL - * when there are no continued children -@@ -287,6 +287,7 @@ int job_reap(register int sig) - - if (pid<0 && errno==EINVAL && (flags&WCONTINUED)) - pid = waitpid((pid_t)-1,&wstat,flags&=~WCONTINUED); -+#endif - sh_sigcheck(); - if(pid<0 && errno==EINTR && (sig||job.savesig)) - continue; --- src/cmd/ksh93/sh/xec.c +++ src/cmd/ksh93/sh/xec.c 2007-12-21 13:28:04.000000000 +0100 @@ -2894,6 +2894,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons diff --git a/ksh93-sigpipe.dif b/ksh93-sigpipe.dif deleted file mode 100644 index cdbe526..0000000 --- a/ksh93-sigpipe.dif +++ /dev/null @@ -1,30 +0,0 @@ ---- src/cmd/ksh93/sh/fault.c -+++ src/cmd/ksh93/sh/fault.c 2010-06-28 14:04:13.858925163 +0000 -@@ -418,8 +418,25 @@ void sh_chktrap(void) - if(trap=sh.st.trapcom[sig]) - { - Sfio_t *fp; -- if(sig==SIGPIPE && (fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) -- sfclose(fp); -+ if(sig==SIGPIPE) { -+ sh.lastsig=SIGPIPE; -+#if 0 -+ if ((fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) -+ sfclose(fp); -+#else -+ int fd; -+ for(fd = 0; fd < sh.lim.open_max; fd++) -+ { -+ if (sh.fdstatus[fd] == IOCLOSE) -+ continue; -+ if ((sh.fdstatus[fd]&IOWRITE) == 0) -+ continue; -+ if (sferror(sh.sftable[fd]) == 0) -+ continue; -+ sh_close(fd); -+ } -+#endif -+ } - sh.oldexit = SH_EXITSIG|sig; - sh_trap(trap,0); - } diff --git a/ksh93-test.dif b/ksh93-test.dif index 913e237..d2add27 100644 --- a/ksh93-test.dif +++ b/ksh93-test.dif @@ -1,6 +1,6 @@ --- src/cmd/ksh93/bltins/test.c -+++ src/cmd/ksh93/bltins/test.c 2007-01-12 12:19:48.000000000 +0000 -@@ -59,12 +59,12 @@ typedef unsigned long Time_t; ++++ src/cmd/ksh93/bltins/test.c 2011-05-20 13:45:24.547925980 +0000 +@@ -46,12 +46,12 @@ #ifdef S_ISSOCK # if _pipe_socketpair # if _socketpair_shutdown_mode @@ -16,7 +16,7 @@ # endif # define isasock(f,p) (test_stat(f,p)>=0&&S_ISSOCK((p)->st_mode)) #else -@@ -99,7 +99,7 @@ static int test_strmatch(const char *str +@@ -86,7 +86,7 @@ static int test_strmatch(Shell_t *shp,co int match[2*(MATCH_MAX+1)],n; register int c, m=0; register const char *cp=pat; @@ -25,9 +25,9 @@ { if(c=='(') m++; -@@ -436,7 +436,7 @@ int test_unop(register int op,register c +@@ -460,7 +460,7 @@ int test_unop(Shell_t *shp,register int - int test_binop(register int op,const char *left,const char *right) + int test_binop(Shell_t *shp,register int op,const char *left,const char *right) { - register double lnum,rnum; + register double lnum = 0, rnum = 0; diff --git a/ksh93-unset-f.dif b/ksh93-unset-f.dif index 6a26c5b..3d00f4e 100644 --- a/ksh93-unset-f.dif +++ b/ksh93-unset-f.dif @@ -1,7 +1,7 @@ --- src/cmd/ksh93/sh/xec.c -+++ src/cmd/ksh93/sh/xec.c 2011-07-04 15:09:52.252426415 +0000 -@@ -2780,7 +2780,8 @@ int sh_funscope(int argn, char *argv[],i - jmpval = sigsetjmp(buff.buff,0); ++++ src/cmd/ksh93/sh/xec.c 2011-07-04 15:42:20.779925941 +0000 +@@ -3294,7 +3294,8 @@ int sh_funscope(int argn, char *argv[],i + shp->st.var_local = shp->var_tree; if(!fun) { - shp->st.filename = fp->node->nvalue.rp->fname; diff --git a/ksh93.dif b/ksh93.dif index a68e338..1ca8023 100644 --- a/ksh93.dif +++ b/ksh93.dif @@ -1,14 +1,3 @@ ---- src/cmd/ksh93/sh.1 -+++ src/cmd/ksh93/sh.1 2008-09-22 12:11:56.000000000 +0000 -@@ -201,7 +201,7 @@ separated by - .BR \(bv . - The standard output of each command but the last - is connected by a --.IR pipe (2) -+.IR socketpair (2) - to the standard input of the next command. - Each command, - except possibly the last, --- src/cmd/ksh93/bltins/print.c +++ src/cmd/ksh93/bltins/print.c 2008-05-05 11:20:21.000000000 +0000 @@ -86,7 +86,11 @@ static char* nullarg[] = { 0, 0 }; @@ -79,7 +68,7 @@ while(argv[1] && *argv[1]=='-') --- src/cmd/ksh93/data/msg.c +++ src/cmd/ksh93/data/msg.c 2007-12-20 18:01:26.000000000 +0000 -@@ -186,7 +186,7 @@ const char e_bash_login[] = "$HOME/.bash +@@ -199,7 +199,7 @@ const char e_bash_login[] = "$HOME/.bash const char e_bash_logout[] = "$HOME/.bash_logout"; const char e_bash_profile[] = "$HOME/.bash_profile"; #endif @@ -110,41 +99,32 @@ option UCB $? }end ---- src/cmd/ksh93/sh/io.c -+++ src/cmd/ksh93/sh/io.c 2008-09-11 15:16:16.000000000 +0000 -@@ -641,6 +641,7 @@ int sh_close(register int fd) - - #ifdef O_SERVICE - -+#ifdef O_SERVICE - static int - onintr(struct addrinfo* addr, void* handle) - { -@@ -656,6 +657,7 @@ onintr(struct addrinfo* addr, void* hand - sh_chktrap(); - return 0; - } -+#endif - - #endif - +--- src/cmd/ksh93/sh.1 ++++ src/cmd/ksh93/sh.1 2008-09-22 12:11:56.000000000 +0000 +@@ -200,7 +200,7 @@ separated by + .BR \(bv . + The standard output of each command but the last + is connected by a +-.IR pipe (2) ++.IR socketpair (2) + to the standard input of the next command. + Each command, + except possibly the last, --- src/cmd/ksh93/sh/lex.c -+++ src/cmd/ksh93/sh/lex.c 2010-04-08 07:13:26.070925225 +0000 -@@ -1082,11 +1082,13 @@ int sh_lex(Lex_t* lp) - } - /* backward compatibility */ - { -+ register const char * cp; - if(lp->lexd.warn) - errormsg(SH_DICT,ERROR_warn(0),e_lexnested,shp->inlineno); ++++ src/cmd/ksh93/sh/lex.c 2010-08-17 14:49:14.000000000 +0000 +@@ -1136,7 +1136,11 @@ int sh_lex(Lex_t* lp) if(!(state=lp->lexd.first)) state = fcfirst(); -- fcseek(state-fcseek(0)); -+ cp = fcseek(0); -+ fcseek(state-cp); - if(lp->arg) - { - lp->arg = (struct argnod*)stkfreeze(stkp,1); + else +- fcseek(state-fcseek(0)); ++ { ++ register const char * cp; ++ cp = fcseek(0); ++ fcseek(state-cp); ++ } + lp->lexd.paren = 1; + } + return(lp->token=LPAREN); --- src/cmd/ksh93/sh/main.c +++ src/cmd/ksh93/sh/main.c 2007-12-20 18:01:26.000000000 +0000 @@ -130,9 +130,9 @@ int sh_source(Shell_t *shp, Sfio_t *iop, @@ -159,7 +139,7 @@ #endif int sh_main(int ac, char *av[], Shinit_f userinit) -@@ -198,7 +198,7 @@ int sh_main(int ac, char *av[], Shinit_f +@@ -199,7 +199,7 @@ int sh_main(int ac, char *av[], Shinit_f } if(!sh_isoption(SH_RC) && (sh_isoption(SH_BASH) && !sh_isoption(SH_POSIX) #if SHOPT_REMOTE @@ -205,10 +185,19 @@ for v in ${v//,/ } do v=${v#*:} --- src/cmd/ksh93/tests/locale.sh -+++ src/cmd/ksh93/tests/locale.sh 2009-12-09 13:01:41.000000000 +0000 -@@ -135,11 +135,11 @@ set -- $($SHELL -c " ++++ src/cmd/ksh93/tests/locale.sh 2011-05-24 16:46:02.000000000 +0200 +@@ -62,7 +62,7 @@ done + # this locale is supported by ast on all platforms + # EU for { decimal_point="," thousands_sep="." } + +-locale=C_EU.UTF-8 ++locale=de_DE.UTF-8 + + export LC_ALL=C + +@@ -111,11 +111,11 @@ set -- $($SHELL -c " unset LC_CTYPE - export LANG=$utf_8 + export LANG=$locale export LC_ALL=C - command wc -C < $tmp/two_euro_chars.txt + command wc -m < $tmp/two_euro_chars.txt @@ -221,6 +210,21 @@ ") got=$* [[ $got == $exp ]] || err_exit "command wc LC_ALL default failed -- expected '$exp', got '$got'" +@@ -124,11 +124,11 @@ set -- $($SHELL -c " + then unset LC_CTYPE + export LANG=$locale + export LC_ALL=C +- wc -C < $tmp/two_euro_chars.txt ++ wc -m < $tmp/two_euro_chars.txt + unset LC_ALL +- wc -C < $tmp/two_euro_chars.txt ++ wc -m < $tmp/two_euro_chars.txt + export LC_ALL=C +- wc -C < $tmp/two_euro_chars.txt ++ wc -m < $tmp/two_euro_chars.txt + fi + ") + got=$* --- src/cmd/ksh93/tests/path.sh +++ src/cmd/ksh93/tests/path.sh 2008-09-11 16:02:46.000000000 +0000 @@ -269,7 +269,7 @@ builtin getconf @@ -233,30 +237,20 @@ PATH=$path --- src/cmd/ksh93/tests/signal.sh -+++ src/cmd/ksh93/tests/signal.sh 2010-03-05 13:01:05.944126021 +0000 -@@ -286,9 +286,9 @@ yes=$(whence -p yes) - do { $SHELL <<- EOF - foo() { return 0; } - trap foo EXIT -- { sleep 2; kill -$exp \$\$; sleep 3; kill -0 \$\$ && kill -KILL \$\$; } & -+ { sleep 2; kill -$exp \$\$; sleep 8; kill -0 \$\$ && kill -KILL \$\$; } & - $yes | while read yes; do -- (/bin/date; sleep .1) -+ (/bin/date; sleep .01) - done > /dev/null - EOF - } 2>> /dev/null ---- src/cmd/ksh93/tests/timetype.sh -+++ src/cmd/ksh93/tests/timetype.sh 2011-05-25 07:45:35.763926377 +0000 -@@ -58,7 +58,7 @@ - [[ ${tt[0]} == *+00:00 ]] || err_exit 'tt[0] is not yesterday' - [[ ${tt[1]} == *+00:00 ]] || err_exit 'tt[1] is not today' - [[ ${tt[2]} == *+00:00 ]] || err_exit 'tt[2] is not tomorrow' --[[ ${tt[3]} == *+14:00 ]] || err_exit 'tt[0] is not 2pm' -+[[ ${tt[3]} == *+14:00 ]] || err_exit 'tt[3] is not 2pm' - unset tt - Time_t tt=('2008-08-11+00:00:00,yesterday' '2008-08-11+00:00:00,today' '2008-08-11+00:00:00,tomorrow') - tt[3]=9am ++++ src/cmd/ksh93/tests/signal.sh 2011-05-20 13:25:48.196426330 +0000 +@@ -285,10 +285,10 @@ then for exp in TERM VTALRM PIPE + $SHELL <<- EOF + foo() { return 0; } + trap foo EXIT +- { sleep 2; kill -$exp \$\$; sleep 3; kill -0 \$\$ && kill -KILL \$\$; } & ++ { sleep 2; kill -$exp \$\$; sleep 8; kill -0 \$\$ && kill -KILL \$\$; } & + $yes | + while read yes +- do (/bin/date; sleep .1) ++ do (/bin/date; sleep .01) + done > /dev/null + EOF + } 2>> /dev/null --- src/lib/libast/disc/memfatal.c +++ src/lib/libast/disc/memfatal.c 2009-07-09 13:30:39.000000000 +0000 @@ -72,7 +72,7 @@ memfatal(void) @@ -290,7 +284,7 @@ #include "FEATURE/lib" --- src/lib/libast/features/lib +++ src/lib/libast/features/lib 2007-12-20 18:01:26.000000000 +0000 -@@ -517,14 +517,19 @@ tst lib_utime_now note{ utime works with +@@ -523,14 +523,19 @@ tst lib_utime_now note{ utime works with }end tst cross{ @@ -319,7 +313,7 @@ --- src/lib/libast/misc/procopen.c +++ src/lib/libast/misc/procopen.c 2007-12-20 18:01:26.000000000 +0000 -@@ -537,7 +537,7 @@ procopen(const char* cmd, char** argv, c +@@ -598,7 +598,7 @@ procopen(const char* cmd, char** argv, c if (!fork()) { sfsprintf(path, sizeof(path), "%d", getppid()); @@ -340,31 +334,13 @@ #define S2F_scan 1 #ifndef elementsof --- src/lib/libcmd/chmod.c -+++ src/lib/libcmd/chmod.c 2007-12-20 18:02:37.000000000 +0000 -@@ -162,7 +162,7 @@ b_chmod(int argc, char** argv, void* con - int notify = 0; - int ignore = 0; - int show = 0; ++++ src/lib/libcmd/chmod.c 2011-05-20 13:28:57.511927049 +0000 +@@ -272,7 +272,7 @@ b_chmod(int argc, char** argv, void* con + case FTS_SLNONE: + if (chlink) + { -#if _lib_lchmod +#if !defined(__linux__) && _lib_lchmod - int chlink = 0; - #endif - struct stat st; -@@ -186,7 +186,7 @@ b_chmod(int argc, char** argv, void* con - force = 1; - continue; - case 'h': --#if _lib_lchmod -+#if !defined(__linux__) && _lib_lchmod - chlink = 1; - #endif - continue; -@@ -249,7 +249,7 @@ b_chmod(int argc, char** argv, void* con - } - } - chmodf = --#if _lib_lchmod -+#if !defined(__linux__) && _lib_lchmod - chlink ? lchmod : - #endif - chmod; + chmodf = lchmod; + goto commit; + #else diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index e5fd205..b3dcf48 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -20,7 +20,7 @@ setv YACC yacc --- src/cmd/INIT/iffe.sh +++ src/cmd/INIT/iffe.sh 2008-02-14 12:15:59.000000000 +0000 -@@ -1083,7 +1083,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; +@@ -1097,7 +1097,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; --*) echo $command: $1: unknown option >&2 exit 2 ;; @@ -85,7 +85,7 @@ } --- src/cmd/ksh93/Mamfile -+++ src/cmd/ksh93/Mamfile 2008-09-11 14:45:18.000000000 +0000 ++++ src/cmd/ksh93/Mamfile 2011-05-20 13:34:19.740425655 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS -cr setv AS as @@ -104,7 +104,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -1394,7 +1394,7 @@ prev +ljobs +@@ -1421,7 +1421,7 @@ prev +ljobs prev +li prev ${mam_libsocket} prev ${mam_libsecdb} @@ -113,7 +113,7 @@ done ksh generated make shcomp make shcomp.o -@@ -1418,7 +1418,7 @@ prev ${mam_libsocket} +@@ -1445,7 +1445,7 @@ prev ${mam_libsocket} prev ${mam_libsecdb} setv CC.DLL -UCC.DLL setv SH_DICT -DSH_DICT="\"libshell\"" @@ -123,7 +123,7 @@ make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2010-06-28 15:41:28.482925307 +0200 ++++ src/lib/libast/Mamfile 2010-08-17 15:00:56.000000000 +0000 @@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS -cr setv AS as @@ -142,7 +142,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -961,7 +961,7 @@ make lcgen +@@ -995,7 +995,7 @@ make lcgen make port/lcgen.c prev std/stdio.h implicit done port/lcgen.c @@ -151,8 +151,8 @@ done lcgen generated make port/lc.tab done port/lc.tab -@@ -7165,58 +7165,31 @@ exec - test '' = 'misc/magic.tab' || ${S - done ${INSTALLROOT}/lib/file/magic generated +@@ -7258,64 +7258,37 @@ done ${INSTALLROOT}/lib/file/magic gener + make ${INSTALLROOT}/include/ast/fmtmsg.h prev comp/fmtmsg.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -173,6 +173,9 @@ -exec - ;; -exec - esac +exec - } + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/fmtmsg.h generated + make ${INSTALLROOT}/include/ast/libgen.h prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -193,6 +196,9 @@ -exec - ;; -exec - esac +exec - } + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/libgen.h generated + make ${INSTALLROOT}/include/ast/syslog.h prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -213,9 +219,9 @@ -exec - ;; -exec - esac +exec - } - make ${INSTALLROOT}/include/ast/prototyped.h - prev ${INSTALLROOT}/include/ast - exec - echo "#include <../prototyped.h>" > 1.${COTEMP}.x + prev ast_namval.h implicit + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/syslog.h generated --- src/lib/libcmd/Mamfile +++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS