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
Peter Stephenson
72a67716ac
20974: Bug with scalar assignment to special array in typeset
2015-11-20 11:18:16 +00:00
Barton E. Schaefer
30b90f166e
37080: use paramtab abstraction more consistently, add explanatory comments
2015-11-08 12:44:31 -08:00
Peter Stephenson
ba36967b57
37038: add -l option to emulate to list options in emulations
2015-11-01 18:12:40 +00: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
Barton E. Schaefer
8abe1496fb
36256: local options should remain in effect for "emulate -L" even if additional option settings are applied
2015-08-21 13:38:19 -07:00
Peter Stephenson
61afb8dc8d
36262: Replace fix for missing unmeta in chdir().
...
It was needed in the argument to one of a pair of lchdir()s rather
than within zchdir().
Add tests for the case of a character with 0x83 within it.
2015-08-21 10:04:13 +01: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
6fa8708bfc
36083: set array value when consistently retying scalar and array
2015-08-10 20:30:09 +01:00
Peter Stephenson
17d52d69ec
Fix retying variables in opposite order.
...
Now gives an error.
Add test.
2015-08-09 19:10:01 +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
Daniel Shahaf
32669e77f4
unposted: Typo fix.
2015-08-04 10:41:25 +00:00
Peter Stephenson
eb08892dcf
35635: a bit more consistency about making elements local
2015-06-27 21:19:26 +01: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
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
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
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
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
Peter Stephenson
93e72ed1e9
35353: print -x and print -X expand tabs
2015-06-02 09:17:04 +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
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
ff19094669
35193: Add "unalias -a".
2015-05-18 16:57:08 +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
Peter Stephenson
ec57c91b58
users/20203: nested functions in always blocks when exit pending
2015-05-13 16:17:04 +01: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
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
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
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
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
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
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
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
Mikael Magnusson
1507719d0a
34112: typeset: fix leak of oldval
...
Found by Coverity (Issue 1255803).
2015-01-06 23:47:30 +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
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
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
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
Jun Kuriyama
e12b515082
33984: bin_dirs() should use zputs() to print metafied directory names
2014-12-16 23:40:32 -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
Barton E. Schaefer
53344183e1
33656: different algorithm for "whence -am" to produce results more consistent with "whence -m"
...
This uses the scanmatchtable routine to collect the names that match the
input pattern, then uses the original -a path search loop to generate
the output, to avoid duplicating test conditions and output formats.
2014-11-13 09:20:46 -08:00
Peter Stephenson
0ccbc3873f
Handle -a option to whence in combination with -m.
2014-11-08 20:49:07 +00:00
Barton E. Schaefer
605a73e415
33429: disallow non-integer values for HISTSIZE and SAVEHIST of "fc -p", and fix crash on zero values for same
2014-10-10 23:12:57 -07:00
Oliver Kiddle
00a654af5c
33323: fix bug in removing math functions and complete -M option to functions
2014-10-02 19:29:32 +02:00
Peter Stephenson
d3d0910293
32918: add %. to ztrftime for use in prompts
2014-07-30 12:10:15 +01:00
Barton E. Schaefer
77119afe19
unposted (see 32892): 'fc -I' is an error
2014-07-24 08:33:13 -07:00
Peter Stephenson
880020ca2e
32624: use correct scaling factor (clock ticks) for times
2014-05-29 21:40:33 +01:00
Peter Stephenson
a06cd1766a
32479: POSIXTRAPS and implicit return values.
...
With POSIXTRAPS never propagate implicit return value.
In any case if not forcing a return value don't use lastval
from within the trap, use the one from the surrounding code.
2014-03-14 12:52:41 +00:00
Peter Stephenson
ed44ddad22
32246: option "shift -p" pops arguments from end of array
2014-01-11 19:31:29 +00:00
Peter Stephenson
c866657a3c
31706: standardize handling of "test ! <x> <y> <z>"
2013-09-06 20:37:40 +01:00
Barton E. Schaefer
935758ab7f
31637: be more selective about retry of lchdir() in cd_do_chdir()
...
Change of directory should not be retried relative to the current directory
when it has already failed along some path that does not refer to the
current directory.
2013-08-18 20:24:45 -07:00
Peter Stephenson
9ebf22b34b
31631: Use cygwin_conv_path if available.
...
Prefer it to cygwin_conv_to_posix_path.
2013-08-05 19:55:15 +01:00
Peter Stephenson
9d32c82da3
17591: fix error message for invalid fd in print -u
2013-07-29 10:44:07 +01:00
Peter Stephenson
fdf2867e5f
31444: Basic code for enable/disable -p
2013-06-13 18:38:33 +01:00
Barton Schaefer
1182a75e1b
upon "read" of a short line, assign all variables passed as arguments.
...
It was noted that (print 1 2 | read one two three four) assigned values
only to $one and $two except in the case where EOF was reached.
2013-05-20 23:38:58 -07:00
Peter Stephenson
424ff5644b
users/17754: failing to retie an array
...
and colon-separated scalar shouldn't be a fatal error
2013-04-10 18:14:41 +01:00
Peter Stephenson
555b95c5f3
31060:"+" before a flag for "functions" or
...
"autoload" should suppress display of function body.
2013-02-22 20:26:32 +00:00
Bart Schaefer
3ed9e4d1b9
unposted: tweak 30949 to fix buffer pointer
2013-01-08 07:18:50 +00:00
Bart Schaefer
dda51b9dbb
30949: restore "read -q" behavior lost by 27188
2013-01-06 18:55:00 +00:00
Bart Schaefer
cba5449c3d
30786: do not enter interactive history editing or command execution if
...
"fc" is called from a ZLE widget.
2012-11-08 16:50:38 +00: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
8d9cb7f42e
fix trivial typo with "functions +T"
2012-10-09 09:24:22 +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
Peter Stephenson
321471891e
30718: emulate command evaluations should apply sticky emulation
...
to autoloads, too
2012-10-07 17:50:18 +00:00
Peter Stephenson
dbec4fa6cc
30692: allow autoload +X -m to work
...
change to _path_files to make it load in that fashion
2012-09-21 19:08:35 +00:00
Peter Stephenson
dd3a8ead16
users/17236: r and other fc output didn't metafy when listing to a file
...
other than stdout
2012-09-08 19:19:06 +00:00
Peter Stephenson
6f3ff6b653
30633: "functions -T" only traces marked function, not called functions
2012-08-21 18:03:01 +00:00
Peter Stephenson
268e56a144
30169: repeat "typeset -T" with same two first arguments is not an error
2012-08-16 14:00:11 +00:00
Peter Stephenson
129ebac4b0
Bart: 30560: unset ordinary array element by setting to null
2012-07-15 18:06:40 +00:00
Bart Schaefer
e1491b2542
30540: typeset flag handling with SECONDS
2012-06-30 17:40:18 +00:00
Peter Stephenson
d60de3001b
30469: Src/builtin.c: allow reverse listing of history using
...
fc -r, but don't allow reverse execution of commands at all.
2012-05-08 11:29:32 +00:00
Bart Schaefer
fa8a0e241c
30320: "emulate" accepts invocation-time flags; other small doc tweaks.
2012-03-07 06:10:42 +00:00
Peter Stephenson
4735ee67af
30127: forbid fc from executing history lines in reverse
2012-02-05 19:28:16 +00:00
Peter Stephenson
a6de37ec2b
29744: don't mess up non '-A' cases in read -E fix
2011-08-29 17:21:39 +00:00
Peter Stephenson
af071465b1
29731: fix read -AE, test that and read -Ae
2011-08-28 17:06:27 +00:00
Peter Stephenson
12e246495c
29413: "print -S" for saving to history with lexical word split
2011-06-03 19:54:43 +00:00
Peter Stephenson
d89361739a
29165: use term.h globally if needed at all.
2011-05-09 09:49:08 +00:00
Peter Stephenson
35ddd9c4ba
users/15953: handle EINTR when using read -k or -q with -u or -p
2011-04-11 16:34:21 +00:00