1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-04 08:30:54 +02:00
Commit graph

561 commits

Author SHA1 Message Date
Sebastian Gniazdowski
c8005af310 40170: Fix up error resetting in curses module.
Update comment to remove confusion.  The comment was based on
incorrecto expectations, and the problems referred to seem to be fixed.
2017-03-03 10:46:23 +00:00
Jun-ichi Takimoto
0697c45ab3 40681: strftime builtin should return 1 if ztrftime() returns -1 2017-03-02 11:09:12 +09:00
Barton E. Schaefer
d00931de5c 40650: redo 40508 and 40626 with comments explaining what is actually going on 2017-02-26 12:03:56 -08:00
Daniel Shahaf
c7048cd88f Revert 40626 which broke tests. 2017-02-26 06:11:19 +00:00
Daniel Shahaf
6c476c2211 40626: Make $options re-settable.
Follow-up to 40508.

Reported-by: James McGlashan
2017-02-25 08:05:11 +00:00
Sebastian Gniazdowski
e9ce001749 40558, 40562: General improvements to zsh/db/gdbm module 2017-02-17 09:22:02 +00:00
Barton E. Schaefer
63f086d167 40524: do not free a null array 2017-02-13 18:09:34 -08:00
Daniel Shahaf
e9267adb49 40508: Make $functions re-settable. 2017-02-08 05:06:49 +00:00
Sebastian Gniazdowski
3be8e1bbdd 40507: Remove extraneous null creating GDBM records 2017-02-07 09:48:59 +00:00
Peter Stephenson
a32fb005d6 40486: Don't warn on creation of MATCH etc. in regex.
This because they are created implicitly rather than by explicit
user request, so the warning may not be useful.
2017-02-02 10:03:57 +00:00
Barton E. Schaefer
caddeca1ac 40483 (cf. Eric Freese: 40482): Remove zpty exit hook from forked processes 2017-02-01 17:11:48 -08: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
34f70c5dc0 40440: Add $functions_source hash to zsh/parameter.
This allows you to find out where a function was loaded from.
2017-01-28 19:33:27 +00:00
Jun-ichi Takimoto
f912e83505 39728: define _GNU_SOURCE on Cygwin 2016-11-07 11:36:17 +09:00
Barton E. Schaefer
26b4508ee3 39268: "zsystem flock -t 0 ..." tries only once to flock and immediately returns success or failure 2016-09-11 17:22:02 -07:00
Peter Stephenson
8d18872817 39217: fix error name generation with GCC.
Adapt the same trick as in zsh.mdd to ensure we don't get
preprocessor lines in the output.
2016-09-07 11:50:00 +01:00
Jun-ichi Takimoto
4b2810ab2d 39064: use scalbn() instead of scalb() (mathfunc.c) 2016-08-20 23:52:01 +09:00
Daniel Shahaf
f9b1703511 38971: Start using the new arrlen_ge() / arrlen_le() helpers. 2016-08-01 08:01:29 +00:00
Jun-ichi Takimoto
fff0080400 38862: strptime(3) requires _XOPEN_SOURCE on Cygwin 2016-07-19 14:54:59 +09:00
Peter Stephenson
dcffad8326 38586: Metafication problem with $functions
If treated as a complete associative array or scanned (retrieving
individual values was not affected), it incorrectly unmetafied
the value so multibyte characters got confused.

Add test.
2016-06-03 10:28:52 +01:00
Sebastian Gniazdowski
fea013b8e8 38356: allow integers as curses colours 2016-04-29 14:01:06 +01:00
Sebastian Gniazdowski
7fc0c2d57d 39354: zcurses fix for colour management
Alter internal return 	code so as not to mask curses error code.
2016-04-29 10:17:44 +01:00
Barton E. Schaefer
222dea055c Mikael Berthe: 38307: PCRE segfault when parenthesized group matches nothing
unposted: regression test for 38307
2016-04-23 14:20:16 -07:00
Jun-ichi Takimoto
a4020e10a3 37868: add 'static' to file local variables 2016-02-03 01:25:33 +09:00
Jun-ichi Takimoto
ca3bc0d95d 37838: use UNUSED() consistently 2016-01-30 00:26:23 +09:00
Barton E. Schaefer
572f8c85ab 37810: repair handling of backslashes and of names starting with "+"/":"/"=" in zparseopts option specs 2016-01-27 22:10:38 -08:00
Barton E. Schaefer
8ddcdad0c1 37802: Clarify zparseopts documention. zparseopts "X::" specifier should also look for the optional argument in the word after "-X". 2016-01-27 22:10:38 -08:00
Jun T
1d98f77a9b Jun T.: 37759: save more function pointers from realparamtab when hacking in their replacements
Restoring from the original external symbols fails for some dynamic link schemes (e.g. 64bit Cygwin).
2016-01-25 08:28:30 -08:00
Barton E. Schaefer
5eae5b58b1 Jun T.: 37515: multibyte handling as per 35448. 2016-01-08 20:42:00 -08:00
Peter Stephenson
a5233fd01e 37378: New bindkey tests.
Also fix Meta bug on pattern match in zpty -r.
2015-12-10 17:51:41 +00:00
Peter Stephenson
04479a56e0 unposted: fix init_io() calls in previous change 2015-12-04 09:42:35 +00:00
Barton E. Schaefer
3d962aacd5 37229: non-local assignment to a parameter name whose outermost declaration is private, is an error rather than a silent no-op.
Also fix %prep sed expression for Solaris.
2015-11-26 12:43:08 -08:00
Barton E. Schaefer
4e90e27036 37208: assignment in a nested scope should not change private parameters in the outer scope from unset to set
Bug remains that the attempt does not generate a warning
2015-11-23 21:43:14 -08:00
Barton E. Schaefer
d3d5325d27 37081: new module zsh/param/private for private-scoped parameters in functions 2015-11-08 16:19:37 -08:00
Peter Stephenson
0628802baf 37014: Improved internal parameter setting.
Enhance WARNCREATEGLOBAL to work in many more cases.

Don't create REPLY as an integer if it didn't previously exist
as one, even if the value to be set is integral, as this is likely to
mess up later uses of REPLY.
2015-10-29 15:01:07 +00:00
Peter Stephenson
d45a68c546 36974: fix some functions with empty argument lists 2015-10-27 09:28:36 +00:00
Barton E. Schaefer
609273875d 36968: use addmodulefd() to tell the shell about the descriptor of the dbm file 2015-10-26 07:25:51 -07:00
Peter Stephenson
15490398d7 36944: extend fd management to zsocket 2015-10-24 20:48:47 +01:00
Peter Stephenson
1f6dcf9bcd 36941: Mark file descripors in ztcp as used.
Allow such file descriptors to be either internal and closed on exec
or external and so managed explicitly by module.
2015-10-24 20:24:35 +01:00
Barton E. Schaefer
c2254cfe2c 36661: replace obsolete "autobins" setting with "autofeatures" 2015-09-27 12:43:03 -07:00
Barton E. Schaefer
6ff0628182 36509: allocate hash table nodes with zshcalloc() to avoid garbage flag values 2015-09-12 09:53:39 -07:00
Sebastian Gniazdowski
89b55d4a5f 36489: fix curses bug with hash table for colours 2015-09-11 18:45:01 +01:00
Mikael Magnusson
9ca9a092de 36302: attr: Fix compilation with libcap 2.24 2015-08-28 05:12:29 +02:00
Jun-ichi Takimoto
2e69ece5cf users/20455: do not use posix_openpt() on OpenBSD 2015-08-23 14:31:56 +09:00
Peter Stephenson
f8164fb647 36227: attempt to fix metafication problem with ztrftime.
fmt is treated as metafied on entry; use returned length to ensure
we metafy or output the correct length if there are embedded nulls.
2015-08-18 16:20:48 +01:00
Peter Stephenson
5292d60eb1 Revert "36222: unmetafy output from strftime"
This reverts commit 8141a3d850.
2015-08-18 14:27:42 +01:00
Peter Stephenson
8141a3d850 36222: unmetafy output from strftime 2015-08-18 12:36:51 +01:00
Peter Stephenson
770beb5816 36218: use unmetafied file name for mkdir system call 2015-08-18 11:10:54 +01:00
Barton E. Schaefer
a01f29c11d 36092: return the zpty master file descriptor in $REPLY for use with "zle -F" etc. 2015-08-11 08:55:23 -07:00
Peter Stephenson
cbdb3cf9be not quite posted: check for error return before EINTR 2015-08-10 13:44:12 +01:00
Joshua Krusell
9728f535e2 36039: Restart socket commands on EINTR 2015-08-10 12:32:33 +01: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
Oliver Kiddle
3d9a8073c2 35963: simplify condition found by coverity to include tautology 2015-07-31 15:01:30 +02:00
Oliver Kiddle
0f02b27ab0 35864: add sysopen, sysseek and systell to system module 2015-07-24 12:36:35 +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
Oliver Kiddle
a257525afc 35681: fix day of month initialisation 2015-07-03 22:59:27 +02:00
Peter Stephenson
7d588bc158 33566: regex module fix for unmatched parentheses 2015-06-22 17:35:38 +01: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
Oliver Kiddle
4804a7c5ff 35360 (replacing 35357): fix for configuring zpty on FreeBSD without
pty.ko loaded
2015-06-03 23:54:09 +02:00
Baptiste Daroussin
aab6bdc366 35357: FreeBSD needs HAVE_POSIX_OPENPT for zpty 2015-06-02 09:21:24 +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
f454ee26a8 35114: zformat -a multibyte char widths 2015-05-13 21:02:48 +01: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
Theo Buehler
b4aa9cdc76 34792: langinfo: Fix pointer type 2015-03-29 06:19:38 +00: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
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
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
Peter Stephenson
d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Mikael Magnusson
e2fe81ae9a 33785: Fix leaks of desthost in ztcp
Found by coverity.
2014-11-24 08:16:48 +01:00
Oliver Kiddle
a526a2203b 33743: use posix_openpt in zpty if it is available 2014-11-24 00:05:59 +01:00
Mikael Magnusson
a9004ce32f 33607: Fix some minor problems in zattr module
Remove the listattr call in zgetattr, it only caused no error to be output
when trying to retrieve an xattr from a file with no xattrs. When a file
had xattrs, it would just add an extra syscall for no good reason.

Always set an array parameter in zlistattr, this makes the returned value
much easier to use; in fact the _zattr completer didn't account for this
and zlistattr foo <tab> on a file with only one attribute did not work.

Almost all of the patch is only reindent, the only modification that's
not a pure deletions is:
 -        ret = 1 + (attr_len > val_len || attr_len < 0);
 +        ret = 1 + ((val_len > 0 && attr_len > val_len) || attr_len < 0);
which makes sure we return the correct error in the new path due to the
removed listattr call. (If val_len is -1 due to no attribute existing,
it doesn't mean the user should retry the call because the attribute
grew in size).
2014-11-07 11:10:30 +01:00
Peter Stephenson
ef4fb421f5 33582: don't include tcp.mdh in zftp.c.
It's a private module definition header that doesn't need
to be exposed.
2014-10-31 10:23:29 +00:00
Jun T
d36421d376 33566: quash null pointer constant compiler warning 2014-10-29 08:48:17 -07:00
Peter Stephenson
0557c226fc 33294: $functions[func_with_redir] plus extra tests 2014-09-30 12:58:52 +01:00
Peter Stephenson
08e5191ff0 users/19097: remove $functypetrace in favour of ref to $zsheval_context 2014-09-18 19:09:52 +01:00
Peter Stephenson
246404a44d Add $functypestack special parameter in zsh/parameter 2014-09-12 20:35:16 +01:00
Barton E. Schaefer
956829c18e 33122: typo from 32891 caused incorrect matches for pcre_match -n 2014-09-07 10:48:32 -07:00
Peter Stephenson
cc6e9db29d 33047: use git to simplify massively source distribution file selection 2014-08-23 21:01:58 +01:00
Peter Stephenson
51c0ccd303 missed updates to calls to ztrftime() 2014-07-30 14:20:07 +01:00
Barton E. Schaefer
f6429189a8 32903: new empty (unset) elements in the special parameter hash tables are special themselves 2014-07-24 08:16:29 -07:00
Barton E. Schaefer
933a0c45d2 32898 (credit Jun T.): fix offset_start initialization bug in 32891 2014-07-23 08:40:11 -07:00
Barton E. Schaefer
2693d852f6 32891: CASE_MATCH for =~ when using pcre; fix pcre_match with empty string 2014-07-20 11:42:09 -07:00
Barton E. Schaefer
38be9fe84a 32468: save/restore match/mbegin/mend when doing pattern lookups against zstyle contexts 2014-03-09 00:29:02 -08:00
Barton E. Schaefer
956d35ef12 32388: zparseopts -K preserves individual associative array elements 2014-02-15 13:49:26 -08:00
Jun T
feae6af6d2 32131: avoid infinite loop reading pty on platforms that do not buffer output after child exit 2013-12-16 22:15:08 -08:00
Peter Stephenson
4163ebf4c7 unposted, see 32054: Rationalise character encoding.
Shell functions are strictly ASCII for maximum portability.

Other files within the distribution may contain UTF-8 characters.

Exception for test files: where they need single character input
with the top bit set, ISO-8859-X is used (X doesn't matter as
we don't need the Euro).
2013-11-27 15:56:44 +00:00
Jun T
ef4d20ad6f 31902: rationalise use of gamma function.
Make zsh/mathfunc consistent across systems and use tgamma() where
available
2013-10-27 00:00:56 +01:00
Mikael Magnusson
fa03332635 31805: Add $patchars and $dis_patchars to zsh/parameter module 2013-10-11 14:57:57 +02:00
Peter Stephenson
b0a0441902 31672: Add test that was failing and fix zpty set-up race 2013-08-26 21:01:17 +01:00
Peter Stephenson
f75904a380 31665: zpty should attach terminal on slave.
Also add test.
2013-08-25 20:48:52 +01:00
Peter Stephenson
a4d3b8f676 31419: Add time zone and year to string formatted time output from zstat 2013-05-21 17:42:57 +01:00
Peter Stephenson
4b86cc48f7 30726: make shell options passed to emulate stick along with the emulation 2012-10-11 20:14:01 +00:00
Peter Stephenson
4e2cdd7956 30722: fix some cases where emulations or options were not propagated properly
from the emulate command
2012-10-07 19:46:46 +00:00
Phil Pennock
52ef609f69 30513: zsh/regex metafy fixes for widechar 2012-06-16 01:21:02 +00:00
Peter Stephenson
86f8e8de69 30307 plus tweak suggsted by Wayne: use %lld for zlong when long long 2012-03-05 10:06:28 +00:00