1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-02 21:36:05 +02:00
Commit Graph

410 Commits

Author SHA1 Message Date
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
Peter Stephenson c861b17bbf 40391: Add WARN_NESTED_VAR option and functions -W.
These are companions to WARN_CREATED_GLOBAL, warning when a variable
from an enclosing scope is altered.
2017-01-23 09:50:57 +00:00
Peter Stephenson 4d6097657c 40375: autoload with explicit path mustn't trash already loaded function.
Also remove unnecessary dupstring() on already duplicated string
when expanding =cmd.
2017-01-18 09:57:55 +00:00
Peter Stephenson c2f1951ba3 40369: code should have been committed with 0a2d92f98 2017-01-17 10:05:32 +00:00
Peter Stephenson 178e62dbfe 40342: Add directory name cache for autoload file paths.
This renders "autoload /blah/blah/*" as efficient as use of
fpath.
2017-01-12 20:56:20 +00:00
Peter Stephenson 33799ae2b0 40335: More care with autoload function path.
If doing "autoload -X", the path present might actually be location
of file containing the function with the autoload -X.  Add
an explicit flag to say it's a directory for autoload.
2017-01-12 13:54:29 +00:00
Peter Stephenson 47b7f2adef unposted: more care with shell function filename.
When updating shfunc structure to change filename we should be
careful to free whatever's there already, we may now be the
directory in which to find the function definition.  After loading
the field contains the full name of the file.
2017-01-11 12:11:22 +00:00
Peter Stephenson f26d1ba6b0 Add features associated with autoloading a function using an absolute
path.

-d defaults to normal fpath

-r remembers the path without actually loading.  May be combined with -d.

-R does the same but it's an error if not found

-X can now take a directory path: this is used to output not yet loaded
functions that have an associated path.
2017-01-11 11:26:13 +00:00
Barton E. Schaefer dc1f3aae60 40179: fix handling of "printf -" and "printf --"
unposted: regression test for 40179 / 37467
2016-12-14 11:01:09 -08:00
Barton E. Schaefer efd3baf2a2 40134: silence spurious compiler warnings. 2016-12-10 19:13:53 -08:00
Daniel Shahaf a81f280bfa 40010: builtins: Say 'bad option: +x', not 'bad option: -x', when +x was passed. 2016-11-28 07:16:38 +00:00
Oliver Kiddle ee1222454e unposted: fix printf -v to an array without format string reuse 2016-11-23 11:52:12 +01:00
Peter Stephenson a62e1640bc 39958: Add extra byte to PATH_MAX allocations.
This ensures we've got enough space for a null, although this
isn't always needed.
2016-11-17 19:49:17 +00:00
Peter Stephenson a57977d01a 39870: ensure exit trap can always run 2016-11-08 13:02:57 +00:00
Barton E. Schaefer d91ffb1db2 39838: another missing unqueue_signals() 2016-11-05 13:49:07 -07:00
Oliver Kiddle 5c28031ea6 39834: when print used with -v and -l, include a final newline
Also complete print -S option and make further use of the
new printf to an array feature in other completion functions.
2016-11-05 00:31:01 +01:00
Oliver Kiddle 4b41e33cbc 39389: when printf -v is used with an array use separate elements each time the format is reused 2016-11-05 00:27:47 +01:00
Barton E. Schaefer ab81b98c49 39758: revise 39704 for array and hash parameters; more POSIXBUITINS tweaks for
export

39704 was commit 0f5e670, forgot to reference article number in that log.

"typeset -p" outputs "typeset" for array and hash parameters, even when
exported, because those types can be marked export but are never pushed
to the enviroment.

For POSIXBUILTINS, "export var" does not implicitly set $var, and its
export state is preserved when assigned (but not when explicitly unset).
2016-10-29 11:56:50 -07:00
Peter Stephenson 7e7e2d7e63 39678: metafication of printf %q argument and result 2016-10-19 10:39:58 +01:00
Peter Stephenson 276197d1d1 36108: command -[vV] assumed -p 2016-10-11 15:16:17 +01:00
Peter Stephenson 4ab3fcc90d 39545: Add some missing unqueue_signals().
All of these are added simply to fit existing logic in other branches.
2016-10-03 13:43:20 +01:00
Barton E. Schaefer 3608fa7961 39509: in the event the current directory has been removed, use chasedots semantics for "cd ..". 2016-09-30 15:52:08 -07:00