dana
c23a0d84b0
48614: getopts: Calculate OPTIND according to POSIX_BUILTINS
2021-05-03 18:11:38 -05:00
Bart Schaefer
71b747567e
47704: POSIX export and readonly ignore "-p" when parameter names also appear
2021-04-18 14:26:12 -07:00
Bart Schaefer
82ff9f24f1
48560: add TYPESET_TO_UNSET option to remove initialization of parameters
...
Changes typeset such that ${newparam-notset} yields "notset" and
"typeset -p newparam" does not show an assignment to the parameter. This
is similar to the default behavior of bash and ksh, with minor differences
in typeset output.
Also add tests for some POSIX incompatibilities plus minor changes for test
harness robustness.
2021-04-18 13:58:09 -07:00
Peter Stephenson
6bef719302
users/26509: fix for r -L
...
fc with the -L option should ignore remote entires, rather than
reading them and treating them as an error.
2021-02-18 21:37:08 +00:00
Martijn Dekker
9c0533931c
48073: Add fc -s as POSIX way of rerunning command without starting editor
2021-02-17 10:21:08 +00:00
Bart Schaefer
465738fc25
47895: Remove trailing spaces from "print -ac" output lines.
2021-02-04 17:52:22 -08:00
Jun-ichi Takimoto
b6ba74cd4e
47301: Fix print -v metafication
2020-10-25 23:05:19 +01:00
Matthew Martin
4e471c3f89
46168: Update $PWD and call chpwd hook after normalizing path
2020-07-03 21:17:58 -05:00
Mikael Magnusson
ed23768f77
typeset: Fix leaving corrupted entries in paramtab
2020-06-05 15:42:31 +02:00
Daniel Shahaf
4d2bcf2fe7
45729: internal: Add a second parameter to zlinklist2array(), analogously to hlinklist2array().
...
Will be used in the next commit.
2020-05-03 01:27:36 +00:00
Peter Stephenson
66ee4918a1
45660: Fix crash setting vi or emacs mode on command line.
...
Delay setting the option until the module system is set up.
2020-04-09 21:46:20 +01:00
Peter Stephenson
a6a1b28b98
45487: Missing mod_export declarations for AIX
2020-02-24 10:55:48 +00:00
Daniel Shahaf
faa476a4ed
45302: bin_umask(): Queue signals around umask().
...
Otherwise, a signal handler might create files while the temporary umask
is in effect.
2020-01-15 19:49:45 +00:00
Daniel Shahaf
ae7e291873
45066: internal: Document forklevel, locallevel, and exit_pending.
2019-12-18 06:01:50 +00:00
Daniel Shahaf
8bc4400762
45058: internal: Add symbolic names to possible values of zexit()'s "from_where" parameter. No functional change.
2019-12-17 05:12:36 +00:00
Daniel Shahaf
06c2a625b3
unposted: Update comment to reflect variable rename in 41012 (= zsh-5.3.1-182-gd7110d8f0).
2019-12-17 02:46:32 +00:00
Peter Stephenson
cb4dc95643
45009: POSIX_CD needs to suppress some forms of option.
...
Otherwise forms of argument allowed by POSIX are interpreted as
options instead.
2019-12-12 10:47:00 +00:00
Martijn Dekker
c578f0a08b
45004: Fix typos in comments
2019-12-11 02:37:39 +00:00
Daniel Shahaf
72c6dbe1be
unposted: functions -c: Fix typo
2019-10-10 03:45:02 +00:00
Peter Stephenson
4fae525726
Copy functions using functions -c old new.
...
Documentation and test.
2019-08-03 19:53:51 +01:00
Bart Schaefer
5415e1d4df
44502: Quote function name for "autoload -X"
2019-07-08 17:56:57 -07:00
Martijn Dekker
700ec49581
44469: correct error on missing option argument
2019-07-01 09:42:22 +01:00
Martijn Dekker
1b1cb44161
44443: POSIX allows exporting readonly variables
2019-06-23 18:36:50 +01:00
Oliver Kiddle
fae7c85331
44284: combination of -T and -p to typeset crashed the shell.
2019-05-14 23:36:59 +02:00
Oliver Kiddle
d66fd7fcf5
44291: printf with argument specifier out of range for an int crashed the shell
2019-05-14 23:18:32 +02:00
dana
78fb8aaccf
44198: Add cd_silent option to suppress all cd output
2019-04-12 14:00:19 -05:00
Peter Stephenson
0d3a786b7c
43669: ensure explicit exit status is used over implicit
2018-10-10 11:17:58 +01:00
Peter Stephenson
bbccbe0c85
43660: extend 43653 when final exit is implicit.
...
Combine logic for case after committed to exit (shell_exiting) with
case where exit occurred in a function we nee to unwind (exit_pending).
Add sarky note for future generations to be confused at.
2018-10-09 14:38:26 +01:00
Peter Stephenson
9ede8c657f
43656: special tied arrays don't have tieddata
2018-10-09 11:21:47 +01:00
Peter Stephenson
d768a7492a
43653: explicit exit from EXIT trap overrides exit status
2018-10-09 10:05:05 +01:00
Peter Stephenson
f99f7dca75
43616: Various parameter setting and display fixes.
...
Mostly to do with typeset -p and tied variables and their interaction.
Some general tied variable fixes.
2018-10-08 10:10:42 +01:00
Jörg Thalheim
03a51a6f09
GitHub #28 : Add missing math.h include for builtins
...
math.h is required for isnan/isinf
2018-09-10 13:05:46 +00:00
Peter Stephenson
eada7e1138
43077: Fix shift builtin status.
...
If the math evaulation to get the shift count failed the status
wasn't passed back from the builtin.
2018-06-20 12:09:43 +01:00
Peter Stephenson
ee7dda7806
42785: Allow redefining math function to work silently.
...
Previously it failed with an error message that the function
was already defined. This is inconsistent with most other
aspects of shell usage.
2018-05-17 09:32:26 +01:00
Oliver Kiddle
a93abe1170
42488: test cases for 42369 and address some issues in the code
2018-05-13 10:13:42 +02:00
Oliver Kiddle
d8753f47bb
42601: tidy up code for set -A/+A to not increment a NULL pointer and to be more efficient
2018-04-07 18:48:00 +02:00
Peter Stephenson
2cbf6b6a19
42332: Special case unsigned printf formats.
...
For constants we can avoid a conversion to signed by examining
the expression before passing to math eval.
2018-01-31 09:14:40 +00:00
Peter Stephenson
5f6a52c06c
42156: new CHECK_RUNNING_JOBS option demanded by bash groupies
...
Also new job options.
Also suppress debug error if rows or columns are reported as zero as
this is normal without a physical terminal.
2017-12-22 20:21:23 +00:00
dana
755f8571d4
42063: getopts errors now report "+" in front of option where appropriate
2017-12-01 09:19:13 +00:00
Martijn Dekker
bf04ffb542
41866: No error unsetting nonexistent function for POSIXBUILTINS
2017-11-02 20:03:45 +00:00
Peter Stephenson
728f2adfc8
Add typeset -p1, like typeset -p with newlines
2017-10-01 17:53:56 +01:00
Peter Stephenson
54b3958440
First go at var=([key]=value) syntax.
...
Works for both normal and typeset case, also var+=...
Still to do: allow to be mixed with straight array assignment,
improve typeset -p, implement [key]+=value.
2017-09-13 20:54:00 +01:00
Peter Stephenson
2ef3dff65a
41668: New --emulate option on invocation.
...
This sets the shell emulation mode similarly to ARGV0=... which
doesn't work from other shells.
Note that this gives more comprehensive emulation than running
emulate within the shell.
2017-09-11 10:12:17 +01:00
Peter Stephenson
eb783754bd
41284: Fix NULL dereference in cd.
...
This happened in sh compatiblity mode if HOME was not set
and cd was used with no argument.
2017-06-13 15:41:00 +01:00
Peter Stephenson
d5c22d356b
41244: Add zmodload -s option.
...
Doesn't complain if module is unavailable, but prints more
obscure errors.
Use existing low-level silent flag by passing through
intermediate module loading hierarchy.
2017-06-12 10:10:23 +01:00
Peter Stephenson
d7110d8f01
41012: Fix premature exit from nested function in EXIT trap.
...
Also add check so we don't delay an exit if we were already in
an EXIT trap for the main shell, as we should in that case leave
immediately.
2017-04-27 18:56:18 +01:00
Peter Stephenson
47c05f6b66
40622 with typos fixed: functions -Ms.
...
This adds the capability for mathematical functions based on shell
functions to have a string argument. Module functions have had
this for a long time.
2017-03-01 10:01:01 +00:00
Peter Stephenson
f5272bccd8
40536: Prepend directory to $fpath.
...
Used if parent function is autoloaded by absolute path so
as to find functions in the same suite without shell code
modification.
2017-02-13 16:32:50 +00:00
Barton E. Schaefer
e51c9c17af
40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant.
2017-01-29 08:30:14 -08:00
Peter Stephenson
3e5badb0c9
40404: Only quote command in whence output with -v.
2017-01-24 11:12:41 +00:00