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
Peter Stephenson
07c8fbe596
34943: Fixes for "command" with multiple options.
...
These need to combine properly, and alos "command -p" with either
-v or -V needs to search for builtins and then using the default
system path.
2016-09-29 11:01:00 +01:00
Daniel Shahaf
f368720b8b
39252: internal: quotestring: Drop the 'e' parameter, which no caller uses.
2016-09-11 09:22:18 +00:00
Peter Stephenson
fe3a63fa6c
39181: Add PM_SINGLE and use for compstate.
...
This flags that compstate (or any other special) can only have
a single instance and an attempt to create a new one is an error.
Given the very fiddly semantics of compstate any other usage
seems pointless.
No investigation yet of other variables that could use this.
Note it's still possible to hide such variables; only instances
that keep the special nature are affected.
2016-09-06 09:42:33 +01:00
Jun-ichi Takimoto
acad0620ef
39087: fix 'conditionally uninitialized' variables
2016-08-23 18:18:50 +09:00
Daniel Shahaf
f9b1703511
38971: Start using the new arrlen_ge() / arrlen_le() helpers.
2016-08-01 08:01:29 +00:00
Oliver Kiddle
5ea32ce2fc
38752: add comments to explain use of stdout instead of stderr for the which builtin
2016-06-29 17:04:50 +02:00
Barton E. Schaefer
769bd4070a
38630: fix infinite loop of "hash ="
2016-06-07 10:08:02 -07:00
Barton E. Schaefer
9afb67eb65
unposted: silence spurious compiler warning
2016-04-29 13:15:33 -07:00
Barton E. Schaefer
e1c745a0dc
38306: in printf formats, treat a missing precision as zero rather than as unlimited
2016-04-22 10:12:17 -07:00
Barton E. Schaefer
95663e9365
37914: reparse associative array subscripts in "unset" so keys with "[" or "]" may be backslash-escaped
...
Also fix erroneous test case this revealed.
2016-02-08 20:52:11 -08:00
Peter Stephenson
7c59c953f2
37765: Use FS_FUNC on fucstack to find autoload -X target.
...
This is better than scriptname which can be updated due to e.g.
intervening "eval".
2016-01-25 16:23:16 +00:00
Peter Stephenson
1aec003155
37722: test builtin should return status 2 on syntax error
2016-01-21 16:30:21 +00:00
Peter Stephenson
0194b4ab1d
37646: Return non-zero status from typeset assigning readonly
2016-01-15 15:53:39 +00:00
Daniel Shahaf
5731581c4c
37551: Include the builtin's name in a "bad option" error message.
...
Example: «zsh -fc 'zle -z'» now prepends "zle:" to the error message.
2016-01-10 20:22:37 +00:00
Barton E. Schaefer
424b417063
unposted: Src/builtin.c: refine READ_MSTREAM to avoid unsequenced evaluation
2016-01-08 20:36:50 -08:00
Barton E. Schaefer
fac7466d11
37513: fix typos; improve error cleanup and correct for signed/unsigned compiler warning
2016-01-06 14:05:02 -08:00
Barton E. Schaefer
a940d25b18
37504: refactor code using/simulating memstream to capture output for "print -v"
2016-01-05 12:50:12 -08:00
Barton E. Schaefer
bc703e4ad1
37503: detect incompatible "print" options, fix metafication and possible memory leak, miscellaneous cosmetics
2016-01-04 22:50:48 -08:00
Jun T
ead199291f
37501 (+ revise test): correct byte counts when simulating memstream via temp file
2016-01-04 22:29:37 -08:00
Barton E. Schaefer
63c6d1746c
37497: handle NUL bytes in "printf -v".
2016-01-02 13:57:35 -08:00
Barton E. Schaefer
03adf52414
37493: readonly + POSIX_BUILTINS == typeset -gr
2016-01-02 12:40:31 -08:00
Barton E. Schaefer
6e10224f1e
unposted: enable WARN_CREATE_GLOBAL for print -v
2015-12-31 12:44:25 -08:00
Barton E. Schaefer
15b73ea99b
37467: add "print -v var" / "printf -v var"
2015-12-31 12:38:10 -08:00
Peter Stephenson
67877f6055
37364: "test" and "[" handling of parentheses.
...
If three arguments, need to prefer binary operators if possible.
Need to look for full string for parentheses.
2015-12-09 16:40:08 +00:00
Peter Stephenson
b0323cab3b
37187: infinite loop in "hash -m"
2015-11-22 16:25:06 +00:00