Barton E. Schaefer
98b7960c78
39943: no need to compute arrlen() in arrdup_max() when max == 0.
2016-11-15 10:04:14 -08:00
Peter Stephenson
921b39ac6b
39949: Special case for "-" in directory names.
...
It can be sh-tokenized to Dash to allow for appearing in ranges
after substitution, so needs to be turned back to "-" in that case.
2016-11-15 18:01:32 +00:00
Peter Stephenson
99acd1e7f4
39906: More multibyte optimisations for US-ASCII.
...
This treats characters 0 to 0x7f as single byte US-ASCII along
the lines we already do in other places in the code.
2016-11-14 10:12:04 +00:00
Peter Stephenson
a1633e09a7
39886 based on 39877: Optimise arrdup to arrdup_max.
...
Only duplicate as much of the array as is needed.
2016-11-09 11:54:57 +00:00
Peter Stephenson
1683371fa5
unposted: follow up to 39867: don't need test against zero
2016-11-08 10:51:03 +00:00
Peter Stephenson
39521515c3
39867, tweaked: Use cast to unsigned char to test character.
...
We want the unsigned variant to be <= 0x7f. Use the normal STOUC()
macro and turn this into a single test.
2016-11-08 10:09:26 +00:00
Peter Stephenson
9c68ef083b
39825: optimise mb_metastrlenend() for 7-bit character.
...
As the shell relies intimately on US-ASCII as a subset we can
skip the multibyte functions if we are dealing with a complete
7-bit character.
2016-11-04 09:56:51 +00:00
Barton E. Schaefer
e61ed2b80d
39470: failure to open a supposedly unique temp file name should result in an error
...
Also band-aid for signal-related race conditions in temp file name generation
2016-09-29 11:16:24 -07:00
Daniel Shahaf
f368720b8b
39252: internal: quotestring: Drop the 'e' parameter, which no caller uses.
2016-09-11 09:22:18 +00:00
Jun-ichi Takimoto
acad0620ef
39087: fix 'conditionally uninitialized' variables
2016-08-23 18:18:50 +09:00
Daniel Shahaf
7154052ebe
39046 + 39061: New :P history modifier.
2016-08-22 03:34:30 +00:00
Daniel Shahaf
f9b1703511
38971: Start using the new arrlen_ge() / arrlen_le() helpers.
2016-08-01 08:01:29 +00:00
Daniel Shahaf
1a368bf31f
38973: Optimize indexing array parameters.
...
% () { for 1 in $prefix/zsh/bin/zsh Src/zsh; do $1 -f -c 'a=( {1..1000000} ); repeat 3 time ( repeat 300 : $a[1] )'; done }
( repeat 300; do; : $a[1]; done; ) 1.68s user 0.01s system 98% cpu 1.718 total
( repeat 300; do; : $a[1]; done; ) 1.69s user 0.01s system 99% cpu 1.710 total
( repeat 300; do; : $a[1]; done; ) 1.69s user 0.01s system 99% cpu 1.714 total
( repeat 300; do; : $a[1]; done; ) 0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; ) 0.00s user 0.01s system 72% cpu 0.022 total
( repeat 300; do; : $a[1]; done; ) 0.01s user 0.01s system 69% cpu 0.023 total
2016-08-01 08:01:28 +00:00
Peter Stephenson
8cf68f05ab
21603: Make read_poll more interruptible.
...
If we interrupted the first read we still did the fallback read.
This is wrong.
2016-06-02 11:01:39 +01:00
Peter Stephenson
6d82ce161a
37946: make rm * warnings more informative.
...
Now count files that would be deleted up to 100.
2016-02-11 15:23:57 +00:00
Jun-ichi Takimoto
a4020e10a3
37868: add 'static' to file local variables
2016-02-03 01:25:33 +09:00
Kamil Dudka
69c86cd2c3
37780: Care printing error if nothing to print.
2016-01-25 17:15:23 +00:00
Peter Stephenson
be32864e6f
37776: Set errflag before calls to zwarning().
...
This avoids an attempt to call zerr() or zerrnam() recusrively.
2016-01-25 15:43:06 +00:00
Peter Stephenson
8eb9070d67
37678: Now possible to quote "-" in pattern range
2016-01-19 09:55:46 +00:00
Daniel Shahaf
69379369da
unposted: Extend docstring of callhookfunc().
2016-01-15 06:30:12 +00:00
Peter Stephenson
7f5b2f5709
37348: Tests and fix for ${(q+)...}.
...
Needs dupstring() for empty string case.
2015-12-08 15:08:24 +00:00
Peter Stephenson
f5b8efa7e0
37344: restore old printable quoting, add ${(q+)...}.
...
The \C- form is only used inside quotedzputs().
${(q+)...} outputs a quotedzputs() representation.
2015-12-07 21:49:07 +00:00
Peter Stephenson
9fb30cf572
37331: Use a single chracter to represent an MB_INCOMPLETE.
...
This is as it is likely to appear as a single character in output
even if it has multiple octets.
2015-12-07 18:54:03 +00:00
Peter Stephenson
87670fb011
37326: comment only: multibyte string lenght/width counting
2015-12-06 16:39:57 +00:00
Peter Stephenson
5a76a5d34e
37314: upgrade quotedzputs() for non-printable output.
...
Use nicechar with $'..' quoting; upgrade nicechar() etc. to
use suitable output.
2015-12-06 15:33:02 +00:00
Daniel Shahaf
7154b8314d
37296: Avoid needless calloc().
2015-12-03 23:47:24 +00:00
Peter Stephenson
acbd2ca701
37191: fix strftime() expansion issue with %p and %P.
...
In some locales the output from this can validly be empty, so
we need to treat them specially.
2015-11-22 18:14:13 +00:00
Peter Stephenson
272119b774
unposted: small typo again
2015-10-24 21:00:30 +01:00
Peter Stephenson
c8c42d6ed5
unposted: small typo
2015-10-24 20:59:48 +01: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
3f96063335
36773: limit CORRECT / CORRECT_ALL to directory names in cases where it is obvious that a directory is expected
2015-10-04 14:01:08 -07:00
Barton E. Schaefer
4375d7b905
36562: sanitize $PWD on import, per POSIX
2015-09-19 23:03:39 -07:00
Barton E. Schaefer
07796811b0
cf. 36554: remove unnecessary pointer dereference
2015-09-19 09:34:05 -07:00
Barton E. Schaefer
18130bed7f
36552 plus test: fix Nularg string in quotestring(QT_DOLLARS)
2015-09-17 21:44:14 -07:00
Mikael Magnusson
cbe00216fe
36380: Avoid gcc case syntax
2015-09-01 23:18:17 +02:00
Barton E. Schaefer
3747f6b6ab
36376: handle signals during read1char() so it is possible to interrupt correct/correctall prompts
2015-09-01 11:26:06 -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
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
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
bbd4cae6ad
35872: protect against NULL pointers in unmeta
2015-07-23 10:04:09 +01: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
Mikael Magnusson
e402747dd6
35745: ztrftime: Pass everything unhandled to the system strftime()
2015-07-09 15:32:55 +02: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
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
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
Jun-ichi Takimoto
a6db0b41ca
35064: rename ISPRINT to ZISPRINT to avoid conflict
2015-05-09 16:02:37 +09:00
Jun-ichi Takimoto
4bc554bb8b
34636: replace broken isprint() on Mac OS X
2015-03-05 01:48:34 +09:00