Peter Stephenson
7d1877da4e
41608 (plus tests): restore ERR_EXIT before function.
...
There was an exception to the usual ERR_EXIT pattern that causes
problems when executing a function in an else branch. It seems
the exception is no longer needed as the regression tests pass
without it.
2017-08-29 19:52:18 +01:00
Peter Stephenson
97d4bdbc7e
41590 modified as 41595: make ERR_RETURN more logical.
...
It now operates separately at each function depth.
To keep ERR_EXIT global, make the noerrexit variable usd bit flags.
Extend tests.
2017-08-24 19:46:20 +01:00
Peter Stephenson
ddb8675901
posted but has not shown up: fix fd problem in subshell.
...
Record fd's that have been saved in fdtable and if the shell
forks close them as they will never be restored.
2017-08-15 20:49:23 +01:00
Peter Stephenson
74aff4106a
41542: Fix pcre logic for extracting matched parentheses.
...
When we went off the end of the array but measured the length
implicitly, we got lucky before. After 41308 we were looking up lengths
in stale memory.
Rename some variables, clean up the logic, be easier to understand.
Add tests.
2017-08-14 11:17:48 +01:00
Phil Pennock
b5f40f4156
41527 (tweaked for heap memory): fix [[ -<cond> ]] from modules
2017-08-11 15:02:06 +01:00
Peter Stephenson
cfd34c75ac
41504: make empty strings work in case patterns with no leading parenthesis
2017-08-09 19:57:47 +01:00
Peter Stephenson
a9b579a9d3
Revert "41499 (with one further tweak): POSIX_STRINGS behaviour."
...
This reverts commit 2eacbef919
.
Conflicts:
ChangeLog
2017-08-08 19:04:49 +01:00
Peter Stephenson
2eacbef919
41499 (with one further tweak): POSIX_STRINGS behaviour.
...
Ignore a terminating delimiter when splitting as separators
despite being called separators are terminators.
2017-08-07 18:47:43 +01:00
Martijn Dekker
a51cd62b45
41484: Make ${(q+)...} quote backsleshes.
2017-08-03 21:32:20 +01:00
Peter Stephenson
d4b94b5e83
41464, 41466: With POSIX_BUILTINS, exec only executes sexternal commands.
...
Document the default behaviour and add a test.
2017-07-27 09:22:04 +01:00
Peter Stephenson
a3b3f00575
41420: "{.." wasn't check for brace expansion properly
2017-07-13 17:20:24 +01:00
Sebastian Gniazdowski
b31f947795
41402: Delay has_tokens() in ecstrcode as may not be needed
2017-07-09 17:38:01 +01:00
Sebastian Gniazdowski
e556f9c78d
41402: Add hasher to ecstrcode to reduce string comparisons
2017-07-09 17:34:55 +01:00
Peter Stephenson
a955065cda
Delay processing "disown" for superjob.
...
This is a job forked from the current shell when a job partly
running from the current shell was suspended. When all associated
processes started from the main shell are finished the job is
continued and at this point the disown can complete.
2017-07-04 09:40:45 +01:00
Maxime de Roucy
cdd9402224
Avoid invalid access with isearch in completion list
2017-07-04 09:38:23 +01:00
Sebastian Gniazdowski
6116fdb277
41375: GDBM interface bug fixes
2017-07-03 10:02:01 +01:00
Peter Stephenson
ae10f88bfb
41386: when backgrounding a STAT_CURSH job, remove the flag.
...
This typical applies to a STAT_SUPERJOB. It prevents it from
getting copied interrupts as a foreground process.
2017-07-02 21:00:56 +01:00
Peter Stephenson
e8edd42f7f
22760: fix partial string length reports with NO_MULTIBYTE
2017-07-02 20:29:00 +01:00
Peter Stephenson
e19955614f
41368: Add missing unqueue_signals() to compctl.
2017-06-27 10:12:55 +01:00
Phil Pennock
825f84c77e
41308 (tweaked): behaviour of PCRE with NUL bytes
2017-06-22 09:24:33 +01:00
Mikael Magnusson
8a62bbb46a
41319: dupstring a possibly readonly string before modifying
2017-06-19 16:18:36 -07:00
Barton E. Schaefer
9de905b22f
41322: reduce number of changes in signal queuing/blocking state during shingetline() to improve read speed
2017-06-19 16:14:32 -07:00
Barton E. Schaefer
a5ed661f25
41317: use heap allocation in getoutputfile() to plug memory leak
...
Heap is usable ever since addfilelist() of workers/31528 (commit 3c573222
).
2017-06-19 16:06:38 -07:00
Barton E. Schaefer
efae75f648
41242: zstrbcmp(...) removed in favor of zstrcmp(..., SORTIT_IGNORING_BACKSLASHES)
...
This should make sorting consistent in completion listings vs. elsewhere.
2017-06-17 10:25:43 -07:00
Stephane Chazelas
4d007e269d
41275: Leave stdin open when executing widgets
2017-06-13 21:34:55 -04: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
d4947e67cc
41239: Save and restore default history event on context stack.
...
This ensures that the default event set by an expansion in ZLE
doesn't propagate to the command line expansion.
2017-06-07 10:03:41 +01:00
Barton E. Schaefer
11d2dbda38
41225: sethparam() should not attempt to change special parameters into hashes
2017-06-05 09:45:45 -07:00
Peter Stephenson
a6135f6114
41191: Check for immortal thingies when checking for specific thingies
2017-06-01 17:56:14 +01:00
Peter Stephenson
151a4660e2
41164: Don't free a history entry if it's curline.
...
This replaces 41113 / 94014ff65b
with a simple local change for the
immediate problem. It's not entirely clear if this reflects wider
changes in the structure of the history code.
2017-05-30 09:39:32 +01:00
Sebastian Gniazdowski
284b5aaeb0
41151: propagate flags when creating new parameter
2017-05-28 13:17:26 -07:00
Sebastian Gniazdowski
ca0607c4c2
41153: finish module setup only after all error conditions have been checked
2017-05-28 13:15:06 -07:00
Sebastian Gniazdowski
62c416915b
41146: careul in GDBM freeing strings with embedded nulls
2017-05-24 15:55:42 +01:00
Sebastian Gniazdowski
135075e48c
40898: fix GDBM error handling
2017-05-24 15:53:42 +01:00
Stephane Chazelas
99fff8f15c
41142: Ensure close-on-exec is passed to moved file descriptor
2017-05-23 17:03:31 +01:00
Peter Stephenson
94014ff65b
41113 (tweaked): Save current line linkage to history ring.
...
When saving history state save whether the current history line
is linked into the ring and remove it, and restore as appropriate
later. This avoids surprises where the history ring is freed
and incorrectly frees the current state in curline, which has
a different allocation strategy.
Original patch tweaked to make restoring more logical.
2017-05-18 09:33:08 +01:00
Jun-ichi Takimoto
171e7fa4c1
41090: Replace iswprint() if unicode9 is enabled.
...
If wcwidth() or iswprint() is broken, force enable unicode9.
2017-05-12 12:10:13 +09:00
Peter Stephenson
4bb81eefbd
41096: Don't assume null termination copying string.
...
At this point the string may contain embedded nulls or not have
a null termination at all.
Also, as we always have the length memcpy() is more efficient.
2017-05-11 17:33:30 +01:00
Peter Stephenson
c7a9cf465d
40181: Fix buffer overrun in xsymlinks.
...
There was no check for copying to the internal xbuf2 for a
preliminary test.
2017-05-09 17:49:18 +01:00
Peter Stephenson
263a0c2476
41078: Empty psvar could cause bad dereference in prompt expansion
2017-05-09 09:46:23 +01:00
Peter Stephenson
af1c82d646
40173: Off-by-one error checking for {varid}.
...
This caused a single unprintable character in braces before a
redirection to be treated as an indentifier.
2017-05-08 18:00:55 +01:00
Peter Stephenson
641a764b82
users/22688: Allow mixing redirs and arguments after anon functions.
...
These are parsed differently from the case of normal functions which
can't take normal arguments at that point.
2017-05-08 17:19:22 +01:00
Peter Stephenson
f25d01a97c
Fix combination of HERE document and |&.
...
A missing flag setting up the HERE document mean that the size
of the wordcode needed to append the 2>&1 was counted incorrectly,
so the resulting wordcode was garbled.
Add test.
2017-05-08 10:54:08 +01:00
Peter Stephenson
21b195562a
41043: Close pipes in shell when disowning background job.
...
This was missing in the case of &,, causing a file descriptor leak.
2017-05-03 11:30:15 +01:00
Peter Stephenson
ed4e37e45c
41020: Fix "command -p"; "-p" was incorrectly left in command arguments
...
Also add tests for known precommand modifier issues.
2017-04-28 10:22:43 +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
408b92b168
41008: Handle expansions for precommand modifiers
2017-04-26 09:44:38 +01:00
Peter Stephenson
68466f327e
40995: Don't disable alias expansion when finding command substitution limits
...
This is needed in some unusual cases in order to identify the exit
condition without encountering a parse error.
2017-04-23 17:06:26 +01:00
Jun-ichi Takimoto
3c78f14d5c
40994: unmeta_one() need not count Meta
2017-04-23 23:58:44 +09:00