1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 22:32:12 +02:00
Commit graph

3311 commits

Author SHA1 Message Date
Joshua Krusell
9728f535e2 36039: Restart socket commands on EINTR 2015-08-10 12:32:33 +01:00
Barton E. Schaefer
df5f825538 36033: a few more queue_signals() to protect global state changes 2015-08-09 17:37:23 -07:00
Barton E. Schaefer
a88415cbf7 36026: zero freed pointers in zftp cleanup_() in case the module is re-loaded after unloading 2015-08-09 16:13:52 -07:00
Barton E. Schaefer
9958684574 36022 fix bug that some loop constructs could not be interrupted, revise signal queueing
There are two underlying ideas here:  (1) Keeping signals queued around
anything that's doing memory management (including push/pop of the heap)
has become crucial.  (2) Anytime the shell is going to run a command, be
it buitin or external, it must be both safe and necessary to process any
queued signals, so that the apparent order of signal arrival and command
execution is preserved.
2015-08-09 16:13:52 -07:00
Peter Stephenson
17d52d69ec Fix retying variables in opposite order.
Now gives an error.
Add test.
2015-08-09 19:10:01 +01:00
Peter Stephenson
249999cfb4 36025: Fix completion aftoer "foo=bar; setopt ".
Done by catching a case that doesn't seem to be handled otherwise,
so there's some hope it doesn't screw up too much.
2015-08-09 18:40:54 +01:00
Daniel Shahaf
1122d83a6e 36008: trap: Fix listing of traps created under non-alias non-canonical signal spelling 2015-08-08 21:43:49 +00:00
Jun-ichi Takimoto
b0ebabdc65 35929: protect FDT_PROC_SUBST by #ifdef 2015-08-09 00:06:57 +09:00
Jun-ichi Takimoto
d09dc4562a 35928: '%-m' should work even if not supported by strftime(3)
Also clarify document.
2015-08-08 03:39:51 +09:00
Daniel Shahaf
32669e77f4 unposted: Typo fix. 2015-08-04 10:41:25 +00:00
Oliver Kiddle
3d9a8073c2 35963: simplify condition found by coverity to include tautology 2015-07-31 15:01:30 +02:00
Barton E. Schaefer
c0a80171ee 35953: fix handling of command substitution in math context 2015-07-29 22:36:45 -07:00
Peter Stephenson
b3aa3b7791 35910: Don't add to raw lex buffer if lex stopped.
This was causing a segmentation violation in completion when parsing
an incomplete math expression, e.g. 'echo $((3*4)<TAB>'.
2015-07-25 21:50:55 +01:00
Peter Stephenson
dd8079e041 35809: fix $((...)) completion by _expand widget.
This changes internal quoting of the form still including tokens
not to add unnecessary internal backslashes.
2015-07-25 21:36:54 +01:00
Peter Stephenson
771381c2ce 35908: fix $((...)) completion in expand-or-complete widget 2015-07-25 20:22:23 +01:00
Barton E. Schaefer
84495e3415 35882: read-command has ZLE_NOTCOMMAND 2015-07-24 17:04:30 -07:00
Oliver Kiddle
0f02b27ab0 35864: add sysopen, sysseek and systell to system module 2015-07-24 12:36:35 +02:00
Peter Stephenson
8f8b82bc6c 35883: Don't attempt to back up over history if expanding alias 2015-07-24 10:19:00 +01:00
Peter Stephenson
bbd4cae6ad 35872: protect against NULL pointers in unmeta 2015-07-23 10:04:09 +01:00
Peter Stephenson
28a962f557 35849: close fd's from process substitution after fork
Leaving these hanging in parent could cause deadlock: test added.
2015-07-23 09:34:11 +01:00
Peter Stephenson
49ff2e00dc 35854: ensure history character unget doesn't recurse infinitely 2015-07-23 09:32:24 +01:00
Peter Stephenson
9a82a86757 35793: avoid undefined behaviour shifting signed number 2015-07-23 09:31:12 +01:00
Oliver Kiddle
b4aff3bc52 35824: allow highlighting of just pasted text and put text from bracketed paste in cut buffers 2015-07-23 05:36:27 +02:00
Oliver Kiddle
aee8aebd67 35814: POSTEDIT needs to be unmetafied 2015-07-23 05:22:46 +02:00
Joshua Krusell
855ceea901 35939: fix select polling in ztcp and zsocket 2015-07-22 13:06:56 -07:00
Barton E. Schaefer
a1f8d4ffc7 35826: add getsparam_u() to return unmetafied string, use it for a number of references to non-special params 2015-07-22 12:52:24 -07:00
Barton E. Schaefer
f3e8f4cf7a 35581, 35582: output array assignments with spaces inside the parens 2015-07-22 12:43:09 -07:00
Barton E. Schaefer
a0862f6381 35799: with NO_EXEC, parse parameter subscript expressions 2015-07-15 17:51:41 -07:00
Oliver Kiddle
5911aca85f 35737: (tweaked c.f. Peter: 35759): use new undo limit for minibuffer and beep when limit is reached 2015-07-14 00:30:45 +02:00
Peter Stephenson
2833299312 35708: add UNDO_LIMIT_NO 2015-07-09 19:29:59 +01:00
Peter Stephenson
3af55c858f 35751: Fix ERR_RETURN and ERR_EXIT in "else" 2015-07-09 14:59:20 +01:00
Mikael Magnusson
e402747dd6 35745: ztrftime: Pass everything unhandled to the system strftime() 2015-07-09 15:32:55 +02:00
Peter Stephenson
04675eca4c unposted: remove compiler error in completion code 2015-07-07 12:48:30 +01:00
Barton E. Schaefer
a9add3de54 35694: fix handling of history modifiers applied across all elements of an array parameter value 2015-07-06 16:35:05 -07:00
Oliver Kiddle
68a5a5f453 35704: compadd -E 0 should imply -J and -2 2015-07-06 22:40:47 +02:00
Peter Stephenson
26d5d2eeac 35692: cfp_matcher_range used wrong raw character 2015-07-05 18:52:00 +01:00
Peter Stephenson
290354ff46 35688: Improved attempt to turn case wordcode into text. 2015-07-05 18:15:43 +01:00
Peter Stephenson
f2b2271fbe Turning case parsed as multiple alternatives back into text.
Also add test.
2015-07-04 11:01:47 +01:00
Oliver Kiddle
a257525afc 35681: fix day of month initialisation 2015-07-03 22:59:27 +02:00
Oliver Kiddle
acb05d1616 35674: make an undo event for initial buffer contents 2015-07-03 22:56:03 +02:00
Han Pingtian
38145b255a 35665: better handling for command line completion match handling 2015-07-02 16:28:14 +01:00
Peter Stephenson
2afdb3985a 35668: Improved fix for command/proc subst starting in alias.
Use input flag to suppress the unwanted backtracking.

Add test for the extra case covered.
2015-07-02 10:01:42 +01:00
Peter Stephenson
dce1f33c02 35667: fix command substitution that starts but doesn't finish in alias 2015-07-01 21:44:50 +01:00
Peter Stephenson
7708849b21 35655: APPEND_CREATE option for POSIX copmatible NO_CLOBBER 2015-06-29 19:01:31 +01:00
Oliver Kiddle
6e57de8ee2 35637: remove the now unused module hook for reverse-menu-complete 2015-06-29 01:59:43 +02:00
Oliver Kiddle
44c56f3af5 35627: make reverse-menu-complete start with the last match in
menu selection
2015-06-29 01:54:44 +02:00
Oliver Kiddle
fbc97e72e8 35623: fix menu-selection where initial selection
would not be displayed without scrolling
2015-06-29 01:46:39 +02:00
Peter Stephenson
93e5234532 35643: Redirections after typeset assignments were broken. 2015-06-28 17:47:02 +01:00
Barton E. Schaefer
811027a22a 35642: signal queueing in zcontext_save_partial() 2015-06-27 15:53:21 -07:00
Peter Stephenson
eb08892dcf 35635: a bit more consistency about making elements local 2015-06-27 21:19:26 +01:00
Barton E. Schaefer
ef08028346 35634: handle failure of gettempname() in namedpipe() 2015-06-27 12:50:40 -07:00
Peter Stephenson
420bfcfc66 35623: All is_array assignments should be treated as having a value. 2015-06-27 17:46:03 +01:00
Peter Stephenson
77a0278bcc 35615: fix completion after tyepset 2015-06-26 17:56:44 +01:00
Peter Stephenson
42b9037ae5 35613: Handle array slices in typeset 2015-06-26 14:55:35 +01:00
Peter Stephenson
9265e49ccb typeset silent on repeated typeset x=() 2015-06-25 17:45:15 +01:00
Peter Stephenson
b16d754d9c 35604: create empty arrays in typeset with array=() 2015-06-25 17:01:48 +01:00
Jun-ichi Takimoto
0d7be4af0d 35550: fix backspace in interactive menu-select 2015-06-25 00:23:25 +09:00
Han Pingtian
77130df674 35514: [[:foo:]] tests in completion should be more specific 2015-06-24 14:56:32 +01:00
Peter Stephenson
7b46509e92 35590: tweak and test text output from typeset 2015-06-24 14:32:15 +01:00
Peter Stephenson
39b28980f3 various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except
for no "+=" and no GLOB_ASSIGN.

Documented in typeset builtin doc and mentioned in release notes.

Tests to ensure basic sanity.

Enabled by default, can be turned off by "disable -r" with typeset
family of commands.
2015-06-24 10:21:12 +01:00
Peter Stephenson
2118390dc1 unposted: add missing (void) argument list to bracketedestring() 2015-06-23 11:28:47 +01:00
Peter Stephenson
7d588bc158 33566: regex module fix for unmatched parentheses 2015-06-22 17:35:38 +01:00
Oliver Kiddle
98687fa1de 35474, 35492: support the bracketed paste mode of newer terminal emulators 2015-06-19 00:15:38 +02:00
Oliver Kiddle
0a0ba5e664 35487, 35496: don't reinstate previous incremental search string
when search direction changes
2015-06-19 00:01:42 +02:00
Mikael Magnusson
e55c167083 35476: Allow setting $0 when POSIX_ARGZERO is not set 2015-06-17 02:26:17 +02:00
Barton E. Schaefer
2cfe892414 35493: erase $_ when the command line is an assignment 2015-06-16 17:03:39 -07:00
Barton E. Schaefer
19b37ef565 35482: be consistent about how argzero is allocated 2015-06-16 17:02:53 -07:00
Peter Stephenson
f1923bdfa6 Add non-metafied character length handling.
Use this in regex module and add test using $'\ua0'.

Rename mb_metacharinit() to mb_charinit() as it does not involve
metafied characters.
2015-06-12 09:30:39 +01:00
Peter Stephenson
40446a9827 35416: Turn on MULTIBYTE in all emulations.
This now includes sh.
2015-06-08 09:50:26 +01:00
Oliver Kiddle
ac26fafa03 35412: fix for - flag when formating strings with printf 2015-06-07 23:07:26 +02:00
Barton E. Schaefer
229bc3cc74 35350: extend "fc -I" to cover listing of "internal" history events only 2015-06-06 12:31:47 -07:00
Peter Stephenson
2abba7243a 35386: expand tabs where useful in builtins outputing function.
Also add to zed -f.

Option is -x <numm>.
2015-06-05 11:21:22 +01:00
Oliver Kiddle
4804a7c5ff 35360 (replacing 35357): fix for configuring zpty on FreeBSD without
pty.ko loaded
2015-06-03 23:54:09 +02:00
Mikael Magnusson
4dc4e23376 GLOB_ASSIGN should only affect scalar assignments 2015-06-02 16:09:35 +02:00
Peter Stephenson
099e717c15 35359: Improved math parsing and errors.
Check for bogus trailing ")" at end of top-level parse.

Extend some math error messages to indicate they are math errors.
2015-06-02 10:21:55 +01:00
Baptiste Daroussin
aab6bdc366 35357: FreeBSD needs HAVE_POSIX_OPENPT for zpty 2015-06-02 09:21:24 +01:00
Peter Stephenson
93e72ed1e9 35353: print -x and print -X expand tabs 2015-06-02 09:17:04 +01:00
Peter Stephenson
75cafccc0a 35343: Avoid $#name length handling for POSIX_IDENTIFIERS 2015-05-31 16:40:14 +01:00
Barton E. Schaefer
911edc5ea4 users/20238: add "fc -L" to operate only on the local shell history
Also avoid invoking the editor on empty results.
2015-05-30 15:22:09 -07:00
Peter Stephenson
e88610b786 35326: $#- was misparsed as ${#-} 2015-05-29 16:06:47 +01:00
Peter Stephenson
cba1d41ffc 2037: ${functions[foo]} shouldn't be unmetafied.
When passed back from the parameter-specific "get" handler it's
still in the shell's internals, so remains metafied.

This caused mayhem with UTF-8 characters in function bodies.
2015-05-29 12:17:18 +01:00
Peter Stephenson
2b08d0ed67 35318: POSIX_BUILTINS behaviour for getopts.
It needs to keep OPTIND, as well as the index within the
string pointed to by OPTIND, global in this case.
2015-05-28 18:32:39 +01:00
Peter Stephenson
cb596a55d9 35306: "test -z \(" failed due to parse confusion 2015-05-27 21:25:55 +01:00
Daniel Shahaf
9fcc105ff6 35127#1: Fix _describe/compdescribe problem with unsorted groups 2015-05-23 10:05:06 +00:00
Peter Stephenson
2f6a8a6c6c Tweak test for function level of exit.
Sometimes local level jumps so we need an inequality instead
of an equality.
2015-05-22 23:37:45 +01:00
Peter Stephenson
a95f2c6071 35250: Fix case documentation (SH_GLOB) 2015-05-21 10:43:32 +01:00
Peter Stephenson
afb78f5d14 35248: treat fully parenthised zsh patterns as complete case patterns again 2015-05-21 10:25:07 +01:00
Barton E. Schaefer
af957f2ed6 35231: make mkevnstr() safe for NULL value 2015-05-20 10:14:04 -07:00
Peter Stephenson
ff19094669 35193: Add "unalias -a". 2015-05-18 16:57:08 +01:00
Peter Stephenson
2d6569e590 35184: Additional case fix for 35168.
Lexical analysis flags got screwed up after a "|", so we
didn't parse patterns properly, in particular those with parentheses.
2015-05-18 12:06:43 +01:00
Peter Stephenson
52aeb9aaeb 35168: Improve parsing of case patterns.
"|" is now found properly by looking for words that come
from the lexical analyser, rather than hacking a pattern
returned in one dollop.

Update some completion functions that need extra quoting
as a result.

Add test for new parsing.

Update version number to 5.0.8-dev-3 because of wordcode
incompatibility.
2015-05-18 09:56:00 +01:00
Peter Stephenson
d52bf91659 35155: cmdpop() could be called erroneously on error 2015-05-15 20:26:08 +01:00
Peter Stephenson
0da0a0b9c7 35153: nested math substitution 2015-05-15 10:19:53 +01:00
Peter Stephenson
59a874f94e 35151: improved check for parameter q and b flags 2015-05-15 09:58:17 +01:00
Peter Stephenson
e86720190e 35131: allow "[]" to match empty character set.
This only works if there's no further "]" in the pattern,
since if there is the first "]" has to match a literal character.
2015-05-15 09:35:24 +01:00
Oliver Kiddle
63ffbab84d Øystein Walle: 34841 (tweaked): allow grouping of thousands in printf format string 2015-05-14 22:56:24 +02:00
Peter Stephenson
85a4cf9b36 35110: don't implicitly initialize restricted integers to zero 2015-05-14 09:28:57 +01:00
Oliver Kiddle
08fb0f6602 35092: fix for numeric arguments from vi operator pending mode 2015-05-13 23:07:09 +02:00
Peter Stephenson
f454ee26a8 35114: zformat -a multibyte char widths 2015-05-13 21:02:48 +01:00
Peter Stephenson
ec57c91b58 users/20203: nested functions in always blocks when exit pending 2015-05-13 16:17:04 +01:00
Peter Stephenson
d756f4eafd 35078: Add backslash quoting to parameter (b) flag from 35067. 2015-05-11 09:40:00 +01:00
Peter Stephenson
6269db883a 35067: Add (b) parameter flag for pattern char backslashing.
Doc tweak from Daniel in 35071.

Includes test.
2015-05-10 19:19:34 +01:00
Mikael Magnusson
bb2362e2c0 Don't treat NUL as a combining character 2015-05-10 01:59:08 +02:00
Jun-ichi Takimoto
a6db0b41ca 35064: rename ISPRINT to ZISPRINT to avoid conflict 2015-05-09 16:02:37 +09:00
Peter Stephenson
f855801fb9 35059: fix, document, test readonly -p.
Don't output specials as can't be reconstructed.

Output arrays in a useful order.
2015-05-08 12:53:18 +01:00
Peter Stephenson
60c6bcdeae 35054: readonly -p + POSIXBUILTINS fix.
Now displays unset variables marekd readonly
2015-05-07 12:10:16 +01:00
Barton E. Schaefer
aa34d2f165 35046: unwind cmdstack when erroring out of lexing a parameter expansion in braces 2015-05-06 07:46:15 -07:00
Peter Stephenson
e6638bbd70 35032: Handle SIGCONT for process better.
Update job status as well as process status.
2015-05-05 19:17:36 +01:00
Oliver Kiddle
9afbe051b9 35029: improvements to newline handling for vi-mode word movement 2015-05-04 21:51:06 +02:00
Mikael Magnusson
1e6fb1a4f0 Fix two bugs in typeset_setbase 2015-05-04 04:26:11 +02:00
Peter Stephenson
bf258a1c07 34992: POSIX fix for readonly variables.
With POSIXBUILTINS, variables can be marked readonly if unset.
Also, variables can't have the readonly flag removed.
2015-04-29 15:54:49 +01:00
Peter Stephenson
c96a993d51 34989: AUTO_CD needs to call cd --.
Otherwise directories looking like options do the wrong thing.
2015-04-28 20:42:26 +01:00
Peter Stephenson
df5115a741 34979: Preserve job text when doing shell job fix.
This handles list_pipe_text in execlist() along with other
variables that are saved and restored and, in the special
case of source, cleared.
2015-04-28 09:22:37 +01:00
Peter Stephenson
9f9a16f43c 34977: more reliable test if preprocessor is GNU 2015-04-28 09:20:15 +01:00
Barton E. Schaefer
a9c8b6a076 34966: "whence -v" for a function reports whether the function is autoloaded or its source file when known 2015-04-25 12:54:17 -07:00
Barton E. Schaefer
fae07f65a3 34965: consistent use of zalloc/zrealloc/zfree 2015-04-25 12:40:35 -07:00
Barton E. Schaefer
0164457a19 34961: $TZ is implicitly local in builtin strftime (originally workers/34602 from workers/34596) 2015-04-25 10:57:44 -07:00
Barton E. Schaefer
f8fb6ebae8 34961: clean up declarations of quote() and quotebreak() 2015-04-25 10:51:54 -07:00
Barton E. Schaefer
89a689e693 34961: replace a couple of free() with zfree() for consistency 2015-04-25 10:48:43 -07:00
Peter Stephenson
e0cdf39fd9 34955: save and restore list_pipe_job with its friends
This is needed to stop source() messing up job control.
2015-04-24 16:34:51 +01:00
Peter Stephenson
2e48eceb1a 34921: handle error in recursive par_event().
Here documents in an interrupted list caused bad juju.
2015-04-17 22:43:38 +01:00
Peter Stephenson
de22f2bfa6 34919: update interrupt parse error for ZLE cases.
Covers both send-break and push-input.
2015-04-17 17:37:26 +01:00
Peter Stephenson
4508d25710 34905: no parse error after keyboard interrupt.
Handled generally, though only showing up in special nested
cases.

Also fix ZLE so it doesn't cancel the interrupt flag when
not actually returning from a local keymap.
2015-04-17 10:23:58 +01:00
Peter Stephenson
3bf8cab82e 34900: assignment before an "exec".
Without POSXIBUILTIN: restore after, so we only get side effects.

With POSXIBUILTIN: keep set variable
2015-04-15 21:16:17 +01:00
Peter Stephenson
493fe2b444 unposted: rewrite Nularg math handling to be like other cases 2015-04-15 18:14:27 +01:00
Peter Stephenson
2ef4b38461 34892 (slightly tweaked): math evaluation fix
An empty expression resulting from substitution includes a
Nularg, which needs handling the same as an empty string.
2015-04-15 10:20:06 +01:00
Peter Stephenson
a2c579050f 34887: Fix POSIX_BUILTINS with assignment.
In the form
  var=val command special-builtin-or-func
the var is restored after execution, unlike the case where "command"
is absent.

Clear up case in code that handles this.

Add tests.
2015-04-15 09:44:19 +01:00
Barton E. Schaefer
d4f50f2d18 34851: fix thinko from 34093 that short-circuited some "whence -m" searches 2015-04-06 10:26:57 -07:00
Barton E. Schaefer
1fa68938dc 34837: avoid loss of original file path when applying colon-modifiers in glob qualifiers 2015-04-03 09:55:11 -07:00
Peter Stephenson
f1c702f2a4 34817: Catch some errors earlier when reading history.
Mostly for the case of an interrupt.

Don't try to process words when we know something's gone wrong.

Also abort history reading earlier on an interrupt.
2015-03-29 19:47:01 +01:00
Theo Buehler
b4aa9cdc76 34792: langinfo: Fix pointer type 2015-03-29 06:19:38 +00:00
Barton E. Schaefer
81ba837972 34781: add implicit space after alias expansion of tokens that form words without spacing
fixes crash when using completion immediately following such an alias
2015-03-28 21:24:27 -07:00
Barton E. Schaefer
7d2b53f65b 34804: refine POSIX_ALIAS change to preserve old behavior of [[ ]] conditionals 2015-03-28 21:08:02 -07:00
Barton E. Schaefer
ab4065623a 34788: refine errflag handling in cmd_or_math() 2015-03-27 11:54:55 -07:00
Peter Stephenson
3774bae034 34784: fix old bug with history word selection 2015-03-26 20:28:13 +00:00
Peter Stephenson
a22cb7cad2 34776: improve suppression of alias expansions from history.
Now uses the mechanism in use for other forms of suppression of
sections of input.
2015-03-25 18:00:25 +00:00
Peter Stephenson
f6be7bc19f 34759: improve implementation of last commit 2015-03-22 19:21:10 +00:00
Peter Stephenson
4fb669a72d 34758: fix yet more history / command subst interaction.
In general we need to wind back over the history text input
inside command substitution because there's no level of
the input mechanism between history and the lexer.
2015-03-22 18:44:56 +00:00
Peter Stephenson
89aca2d0a0 34752: another fix for history expansion in cmd subst 2015-03-20 11:02:23 +00:00
Peter Stephenson
f48457a695 34742: history expansion inside command substitution failed.
Needs the case of alias expansion separating out.
2015-03-19 11:10:49 +00:00
Barton E. Schaefer
32b4cb0e73 34734: further aliasing adjustments and doc
restrict token aliasing (34641) to global aliases; tighten up POSIX_ALIASES to better match spec; update Aliasing doc to cover this and clarify older behavior

2015-03-18  Peter Stephenson  <p.stephenson@samsung.com>

	* 34723: configure.ac: turn off fixed site function directory if
2015-03-18 18:01:54 -07:00
Peter Stephenson
2f3547689c 34653: move aborted vared lines to ZLE_VARED_ABORTED 2015-03-06 09:51:16 +00:00
Peter Stephenson
506eaa0a63 34651: Avoid core dump if no lexical token 2015-03-05 10:02:38 +00:00
Jun-ichi Takimoto
4bc554bb8b 34636: replace broken isprint() on Mac OS X 2015-03-05 01:48:34 +09:00
Peter Stephenson
0ac87e3f59 34641: make it possible to alias tokens 2015-03-04 15:56:17 +00:00
Barton E. Schaefer
628d2f4f8a 34634: avoid infinite recursion on (/)# extendedglob 2015-02-27 10:10:19 -08:00
Peter Stephenson
c96606cc06 34623: free history more often if "remetafying" 2015-02-23 17:38:16 +00:00
Mikael Magnusson
ed43cf2768 34615 + 34619: Remeta one frame earlier 2015-02-23 18:09:47 +01:00
Peter Stephenson
6fa63a0ce2 34606: fix up nested arithmetic substitution
Arithmetic within a parameter substitution is a special
case that needs fixing with the introduction of the new
Inparmath token.

Add test.
2015-02-22 21:32:08 +00:00
Peter Stephenson
bcc4ab792d 34604: Work around problem with changes in Meta characters.
If reading in a file that contains characters that should be
metafied but are not, fix up on the fly.  Only need when using
HIST_LEX_WORDS.
2015-02-22 20:22:40 +00:00
Barton E. Schaefer
a4ff8e6957 34590: queue_signals() around more scopes that manipulate global state 2015-02-20 18:45:36 -08:00
Peter Stephenson
b237ba0a8e 34587: ensure multibyte characters don't overflow.
They could start incorporating tokens, with bad karma.

Add test.
2015-02-20 16:25:54 +00:00
Barton E. Schaefer
df7a657b10 34568: use META_HEAPDUP when passing dlerror() string to metafy() 2015-02-19 08:26:03 -08:00
Peter Stephenson
2cbf9d7e65 34573: Safer failure to handle command substitution 2015-02-19 12:01:16 +00:00
Peter Stephenson
52e938bac9 34570: Another nasty command / math substituion thing.
Mark arithmetic substitutions with tokens to make sure the substitution
go knows what to do.  Before it was guessing by counting the
parentheses at the end.
2015-02-19 10:22:40 +00:00
Peter Stephenson
9b21dcada9 Fix up memory allocation for previous patch 2015-02-17 09:56:09 +00:00
Peter Stephenson
126fb61c7c 34560: Fix $(( that's actually a multiline cmd subst. 2015-02-16 17:16:57 +00:00
Peter Stephenson
8ebe18c081 34530: PRINT_EXIT_VALUE with anonymous functions.
Simpler fix, avoiding structural changes.
2015-02-16 12:37:38 +00:00
Barton E. Schaefer
2335d62548 34551: Avoid adding an extra "/" to the target path in cd_try_chdir() when the current directory is "/" 2015-02-15 20:20:03 -08:00
Barton E. Schaefer
2c13d9fb0d 34543: Prevent crash on garbage bytes inside $(...)
Garbage input (nul bytes, etc.) can cause the $(...) parser to become
confused during look-ahead and attempt to back up the input too far.
This commit catches the error but does not fix the underlying cause.
2015-02-14 10:43:10 -08:00
Peter Stephenson
daa7d99702 34546: further $_ with anon function fix.
Also add tests.
2015-02-13 21:31:31 +00:00
Peter Stephenson
7e6faf7237 34519: $_ for arguments of anonymous function 2015-02-12 19:48:50 +00:00
Barton E. Schaefer
7398fea059 34514: Back out 34485, an alternate solution needs to be worked out.
(Tweaked to keep the unrelated hunk of the E01 test.)
2015-02-12 09:27:53 -08:00
Peter Stephenson
638bccb1c5 users/19850: add pattern support to watch variable 2015-02-11 12:52:22 +00:00
Mikael Magnusson
0209635832 34490: Fix leak on print -zf/-sf error 2015-02-10 13:03:51 +01:00
Mikael Magnusson
2dbbc88d0b 34488: Fix use-after-free for print -zf and print -sf 2015-02-10 13:03:49 +01:00
Peter Stephenson
da86d6b4f2 34485: More rationalisation for anonymous functions.
Don't attempt to treat as "simple" case as there are too many
hidden problems.

Pull out some post-execution functions to a common case in
execcmd().
2015-02-09 16:39:29 +00:00
Mikael Magnusson
dfbb5e4853 34466: Fix double unmeta in rm verification 2015-02-09 05:13:34 +01:00
Jun-ichi Takimoto
1f62d8d0be 34451: use mmap() also on Mac OS X
Let MAP_ANONYMOUS be an alias to MAP_ANON if the former is not
defined.
2015-02-03 20:50:26 +09:00
Peter Stephenson
1a7473cbc1 34455: Further gdbm parameter fixes.
Fix memory leak with name of parameter.

Unset old parameter before opening db as it might close an existing
db.
2015-02-03 10:31:03 +00:00
Barton E. Schaefer
1254538a41 34447: fix assignment of key-value array to ztie'd parameter.
Add gdbmhashsetfn() for this purpose.  Erases and reorganizes the database
before bulk assign.
2015-02-02 09:46:08 -08:00
Barton E. Schaefer
3ae6fb965f 34446: add "ztie -r" and "zuntie -u", update documentation 2015-02-01 14:01:53 -08:00
Peter Stephenson
ce211bb8d1 34439: unset variable about to be tied 2015-01-30 20:03:02 +00:00
Peter Stephenson
bc8491c3dc 34430: parameter fixes for gdbm tied hash.
Probably fix the issue with correct parameter hiding or not hiding.

A little extra safety checking.

Possibly fixed a memory leak with untying.
2015-01-29 21:05:17 +00:00
Barton E. Schaefer
5751de7975 34403: refine 34399 to avoid settyinfo() when the input descriptor is not a TTY 2015-01-26 18:48:25 -08:00
Mikael Magnusson
cae0be3af6 34387: Avoid loading the main zsh binary as a module 2015-01-27 00:18:47 +01:00
Mikael Magnusson
bac2bbd058 34382: Handle NULL return from dlerror() more gracefully 2015-01-27 00:17:23 +01:00
Peter Stephenson
5136628599 Unsetting gdbm tied variable basically works.
Allows variables in nested scope.

However, explicitly untying a variable doesn't properly expose
the scope above.
2015-01-26 18:10:39 +00:00
Barton E. Schaefer
494c251cb0 34399: fix polltty thinko from 34365
Also add missing ChangeLog entry for 34365.
2015-01-25 16:07:49 -08:00
Barton E. Schaefer
2546c86244 34389: fix parsing of ">!" when read from histfile with HIST_LEX_WORDS 2015-01-25 13:15:34 -08:00
Peter Stephenson
4688de1677 34365: History lockfile backoff: randomised time.
Time doubles on each lock failure.

zsleep() provides microsecond resolution for sleep; uses nanosleep() if
available, else select via means of existing tty poll function.
2015-01-25 20:29:18 +00:00
Barton E. Schaefer
2fa11b7c54 34350, 34353: document zsh/db/gdbm module, clean up a few things in the code
Still core dumps at this revision if the tied parameter is forced to be a local and is not untied before end of scope.
2015-01-25 11:34:26 -08:00
Daniel Shahaf
f7a2fba534 34369: document error and warning codes 2015-01-25 18:08:29 +00:00
Peter Stephenson
ccd3663d4e 34383: ztrdup() should be dupstring() in new cd code 2015-01-25 18:03:20 +00:00
Peter Stephenson
12b813b589 34331: better handling of NULL in cd.
Problem was return from symbolic link expander in weird cases
where there file system isn't behaving itself properly.
2015-01-22 20:20:15 +00:00
Peter Stephenson
0e3548994e 34329: add -S option to which and where 2015-01-20 17:31:28 +00:00
Peter Stephenson
e6d9642467 users/19751: remove error on failure to close file descriptor by number.
Keep it when closing file descriptor stored in a variable, i.e.
explicitly opened by the user.
2015-01-20 09:29:22 +00:00
Peter Stephenson
c6c9f5daf2 34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
2015-01-18 22:38:57 +00:00
Peter Stephenson
e34ce85151 34319: fix alias expansion in history for command substitution 2015-01-18 16:43:26 +00:00
Peter Stephenson
aa503b592b unposted: another dubious comment in hist.c fixed 2015-01-16 20:35:41 +00:00
Peter Stephenson
0f60d18249 unposted: improve comment on hist_in_word().
Commit f2a2f28f7 was a bit less clear about how hist_in_word()
was used than it could be.
2015-01-16 20:31:11 +00:00
Peter Stephenson
f2a2f28f7b 32413: turn off history word marking in cmd subst 2015-01-16 20:12:40 +00:00
Peter Stephenson
db05cc51fa 34304: improve use of new cmd subst in completion 2015-01-16 13:20:05 +00:00
Peter Stephenson
3a99ef322d 34280: more widespread use of FORCE_FLOAT.
Add the case of variables read for use in arithmetic expressions.
2015-01-15 13:52:40 +00:00
Peter Stephenson
c7aa644390 34287: preprocessor for signal name generation.
Some gcc header files are difficult for the signames2.awk
script to process, so if the preprocessor is gcc give the
option -P to strip out the unwanted additions.
2015-01-15 13:52:40 +00:00
Peter Stephenson
5f4325a0a4 Propagate float/integer type in arithmetic assignment.
Add test.

Mention this and also floating point mod change in README.
2015-01-12 16:38:00 +00:00
Barton E. Schaefer
39a6e8a7f5 34230: call fmod() for modulo with floats 2015-01-11 11:29:17 -08:00
Peter Stephenson
968dd7387c 34234: use structures for normal and raw lexical buffer state 2015-01-11 19:12:58 +00:00
Peter Stephenson
3b32abafdb 34220: new $(...) handling needs to back up over alias expansion 2015-01-10 20:28:57 +00:00
Peter Stephenson
81ad9ed766 unposted: update copyright for new Src/context.c 2015-01-10 19:55:48 +00:00
Barton E. Schaefer
3495dc5c27 34213: in previous patch, do not change usepm if it is already set 2015-01-10 10:32:31 -08:00
Barton E. Schaefer
daa788d88b 34212: do not change unset-ness of special parameters when exporting them 2015-01-10 10:32:31 -08:00
Mikael Magnusson
573679c34b select: Fix leak of 256 bytes on every loop when zle is not used
Reproduce by
yes | head -n 1000000 | zsh -c 'select foo in a b c; do done; sleep 30; echo'

Found by Coverity (Issue 439082).
2015-01-10 08:48:18 +01:00
Mikael Magnusson
7dcaa2ff60 hist: remove wrong NULL terminator
This actually writes a NULL to some arbitrary location in the caller function's stack. Found by Coverity (Issue 1255746).
2015-01-10 08:48:18 +01:00
Peter Stephenson
cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Mikael Magnusson
bc55ddf364 Fix a typo in bin_print error message 2015-01-09 12:37:25 +01:00
Peter Stephenson
c0d01a6fe0 Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
2015-01-08 12:24:00 +00:00
Barton E. Schaefer
93846edb0d 34154/34155: reorder bin_print() to avoid leaking the output descriptor when incorrect/incompatible options were passed 2015-01-07 22:45:46 -08:00
Jun-ichi Takimoto
152b797596 34144: allocate origline by ztrdup(), not by dupstring()
If origline is allocated in heap, it will have been freed
when menuselect() is called directly as a widget.
2015-01-07 21:48:28 +09:00
Bart Schaefer
8fea30a571 34122: module: allow NULL third argument as intended
Found by Coverity.
2015-01-06 23:51:19 +01:00
Mikael Magnusson
4701b05cf7 34138: wcs_nicechar: only deref widthp if it was given 2015-01-06 23:51:18 +01:00
Mikael Magnusson
38dc59907b 34120: compctl, jobs: Check contents instead of array
text is an array in the struct, and can never be null.

Found by Coverity (Issue 1255780).
2015-01-06 23:51:01 +01:00
Mikael Magnusson
c425cc9632 34108: Don't leak ifs stuff
Found by Coverity (Issue 1255785).
2015-01-06 23:51:00 +01:00
Mikael Magnusson
6a5339fdd5 34107: getsubsargs: free ptr1 before returning
Found by Coverity (Issue 439073).
2015-01-06 23:51:00 +01:00
Mikael Magnusson
bd2175fe7d 34134: anon funcs: don't leak shf and related data
Found by Coverity (Issue 439076).
2015-01-06 23:50:37 +01:00
Mikael Magnusson
1507719d0a 34112: typeset: fix leak of oldval
Found by Coverity (Issue 1255803).
2015-01-06 23:47:30 +01:00
Mikael Magnusson
adae710eb0 34106: hist: use zhtricat instead of tricat
Found by Coverity (Issue 1255769).
2015-01-06 23:47:23 +01:00
Mikael Magnusson
5a9be69185 34113: whence: use dupstring to not leak memory
All other assignments to buf use the heap, and it's never freed. Found
by Coverity (Issue 1255786).
2015-01-06 23:47:12 +01:00
Mikael Magnusson
8035794a56 34119: complist: Fix leak of string in clnicezputs
Found by Coverity (Issue 1255808).
2015-01-06 23:47:05 +01:00
Mikael Magnusson
6c72895bc2 34105: subst: remove dead code
Found by Coverity (Issue 1255810).
2015-01-06 23:46:55 +01:00
Mikael Magnusson
9e5dc2925c 34121: compresult: Remove unneeded NULL check
The variable is set to  if NULL at the start of the function, and derefed
on the previous line. Found by Coverity (Issue 1255843).
2015-01-06 23:46:49 +01:00
Mikael Magnusson
ea6bb993e9 34104: compctl: Remove pointless check
cc has already been derefed a bunch of times leading up to here. Found
by Coverity (Issue 1255841).
2015-01-06 23:46:31 +01:00
Mikael Magnusson
221ecf5010 34115: compcore: Fix size argument to zfree
Found by Coverity (Issue 1255852), has no impact unless using
--enable-zsh-mem, and even then it is minimal.
2015-01-06 23:46:18 +01:00
Mikael Magnusson
18b60d8512 34117: zle: size_t is unsigned, use int instead
The function wctomb returns an int according to my manpage, and we
furthermore check if it is negative, and then return it, and the function
signature is int, so declaring it as an int seems to make more sense.
2015-01-06 23:46:06 +01:00
Mikael Magnusson
c935381479 34116: computil: Check for NULL before passing to strlen
The rest of this function appears to be very careful about checking these,
then forgets in this one spot. Found by Coverity (Issue 1255805).
2015-01-06 23:45:51 +01:00
Mikael Magnusson
6b79f29fb2 34118: Don't crash when writing out history if HOST is unset
Found by Coverity (Issue 1255793).
2015-01-06 23:45:26 +01:00
Mikael Magnusson
a150563fb0 34114: emulate: Handle aborting from mixed -L/-c correctly
Somehow Coverity found this (Issue 1255797, Failure to restore non-local value).
2015-01-06 23:45:09 +01:00
Barton E. Schaefer
7e7449592a 34103: fix ancient double-quote handling thinko in subst_parse_str()
This doesn't seem to have mattered, but must in some obscure cases
2015-01-06 09:34:12 -08:00
Barton E. Schaefer
f9cc5a6e56 34093: "whence" should always return nonzero when it finds that nothing matches its arguments 2015-01-06 09:33:44 -08:00
Peter Stephenson
98f465c09f 34092: fix miscount of symlink resolution for "..".
This caused problems with expanding a path with ".." in "whence -S".
2015-01-04 19:42:45 +00:00
Peter Stephenson
f9cba834cd 34091: typo with "whence -s" expansions 2015-01-04 19:05:39 +00:00
Peter Stephenson
454bb777cf users/19671: remove confusion with whence -a.
If the argument is a full path don't try to search the path for it.
2015-01-02 22:25:24 +00:00
Peter Stephenson
33d1439fdb users/19667: whence -S shows intermediate steps in symlink expansion 2015-01-02 21:32:51 +00:00
Daniel Shahaf
e11ad500dd 34070: fix starting position for memset() from 34005. 2014-12-28 20:11:09 -08:00
Takeshi Banse
1cd8023570 34064: assignment before command replaces array with export even when KSH_ARRAYS 2014-12-27 22:05:05 -08:00
Barton E. Schaefer
d6a32ddeed 34065: following an "if" condition, do not test lastval for ERR_EXIT until a new command is run
Includes unposted regression tests.
2014-12-27 21:55:58 -08:00
Peter Stephenson
89012cf94c 34015: disallow strange environment variable names.
These are ones with the top bit set in any character.
Don't import them, and don't export them.
2014-12-19 22:15:24 +00:00
Peter Stephenson
fd934e1187 34005: region_highlights memory fix
Zero uninitialised part of memory when reallocing
2014-12-19 21:55:31 +00:00
Barton E. Schaefer
95381783e9 34002: zshcalloc() in init_keymaps() 2014-12-18 18:58:25 -08:00
Barton E. Schaefer
bf075b9e0d 33992: do not attempt attachtty() for process group zero (which is possible in a linux pid namespace) 2014-12-18 18:58:25 -08:00
Peter Stephenson
ecef922df1 34008: metafy the environment on arrival in the shell 2014-12-18 19:55:53 +00:00
Peter Stephenson
f3cb9a7754 34006: unmetafy anything put into the environment 2014-12-18 19:36:03 +00:00
Peter Stephenson
04e555a92e 33981: more care with region_highlights management 2014-12-18 18:54:55 +00:00
Jun-ichi Takimoto
fe51f39dad 33978: avoid infinite loop in interactive mode
Update command line when accept-and-hold is called in the
interactive mode of menu select.
2014-12-18 03:49:51 +09:00
Jun Kuriyama
e12b515082 33984: bin_dirs() should use zputs() to print metafied directory names 2014-12-16 23:40:32 -08:00
Chirantan Ekbote
0c4cb0cc1b 33982: minimal support for pid namespaces by recognizing that GETPGRP() may return 0 2014-12-16 23:35:57 -08:00
Barton E. Schaefer
36ec763dbd 33976: fix overlapping strcpy() 2014-12-15 16:41:08 -08:00
Oliver Kiddle
1e0064e58b 33956: document key binding changes and remove ^X binding 2014-12-13 19:34:24 +01:00
Oliver Kiddle
5b7950e6ef 33846: additional default vi-mode key bindings 2014-12-13 19:32:55 +01:00
Oliver Kiddle
edb9c94025 33950: ignore KEYTIMEOUT for vi operators 2014-12-12 14:14:00 +01:00