438 Commits

Author SHA1 Message Date
Oliver Kiddle
6a691a3487 53404: terminal integration with semantic markers 2025-11-10 21:02:31 +01:00
Oliver Kiddle
c9417b0374 54001: add missing uses of mod_export 2025-10-24 22:38:23 +02:00
Mike Gilbert
e20df6ee53 53992: check for declaration of fpurge() instead of link-ability
musl-libc has fpurge() but does not declare it in stdio.h. zsh does not
need fpurge() if musl is in use.
2025-10-21 23:59:18 +09:00
Daniel Shahaf
5db0d046b6 53607: Stop printing /usr/bin/foo -> /usr/bin/foo in 'whence -s'.
Makes the new test PASS.

Review-by: Bart Schaefer
2025-05-14 14:53:12 +00:00
Wu, Zhenyu
a61b105795 github #126: Fix some typos 2025-01-27 23:39:05 +01:00
dana
6bb792dba8 53257: use monotonic clock where appropriate
update the following features to use the monotonic clock for calculating time
deltas and intervals:

* MAILCHECK parameter
* PERIOD parameter
* SECONDS parameter
* %(nS.t.f) prompt-expansion sequence
* time built-in's elapsed time and cpu % values
* zsh/zftp ZFTP_TMOUT parameter
* zsh/zprof timings

also use CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC on macOS
2024-12-26 10:09:25 -06:00
Oliver Kiddle
57248b8883 52750: remove ansi2knr support for old pre-ansi K&R compilers 2024-03-18 20:02:34 +01:00
Bart Schaefer
4fb96cc639 52612: %l replacment of zwarning() does literal string output 2024-03-02 09:22:43 -08:00
Bart Schaefer
d7cf4f25eb 52509: manage internals of stdio objects when performing redirections. 2024-01-28 17:14:23 -08:00
Bart Schaefer
3406089647 52468: save and restore state of correct TTY when using read -s / -d 2024-01-24 17:27:41 -08:00
Bart Schaefer
98a6892cb1 52244: Fix a batch of minor defects reported by Coverity.
Coverity defects 1547831, 1547826 (remove unused function), 1521551,
1500752, 1500747, 1401549, 1372423, 1270645, 1255799, 1255792, 1255789,
1255787, 1255782, 1255750
2023-10-26 08:27:18 -07:00
Bart Schaefer
29644f12e7 52193: handle UTF8-encoded USERNAME and therefore home directory in zcompile
Includes one unposted thinko fix ztrdup -> dupstring
2023-10-01 11:34:33 -07:00
Jun-ichi Takimoto
02e33c54d8 52169: a few more improvements of (#) flag
fix (#X) in C locale in FreeBSD, DragonFly, NetBSD.
Negative values such as ${(#X):--1} are now error.
UCS4 is limited to < 0x8000_0000 (in OSes without __STDC_ISO_10646__).
2023-09-27 01:56:47 +09:00
Robert Woods
97b4a30c4e 52053: whitelist capability CAP_WAKE_ALARM
Since the systemd update v254 from July 28, 2023, the capability
'CAP_WAKE_ALARM' is passed by default to some user process (especially
desktop managers). Since 'CAP_WAKE_ALARM' is very narrow in focus, it
is preferable that zsh does not consider it as a 'privileged'
capability.
2023-08-27 15:05:08 -07:00
Jun-ichi Takimoto
1b9bc3441c 51884: reset IFS if it contains invalid characters
This happens only if MULTIBYTE option is on.
2023-06-26 16:52:40 +09:00
Oliver Kiddle
f80ad32c3f 51769: fix compilation when HAVE_GETRUSAGE is not defined
Also silence compiler warning when HAVE_SETUPTERM is not defined.
2023-05-21 03:36:26 +02:00
Bart Schaefer
8d009d35a9 51510: Skip namespaces in "set"/"typeset" output, add tests, fix bug 2023-03-06 20:01:04 -08:00
Bart Schaefer
ea0bd72dd8 51485: module for several ksh93 features, mostly enabled only in ksh emulation. 2023-03-05 14:16:31 -08:00
Bart Schaefer
a9ba166216 51483: Enable assignment and expansion of parameters with ksh-like namespace prefixes. 2023-03-05 14:03:42 -08:00
Oliver Kiddle
667ead3a64 51258, 51272: refactor handling of terminal attributes, removing OFF flags in zattr 2023-01-10 20:53:17 +01:00
Oliver Kiddle
a73c705b0c 51212: remove STOUC() macro
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
2022-12-16 23:28:10 +01:00
Jun-ichi Takimoto
33938ad489 50668: treat 8bit chars correctly when multibyte is unset
The problem was found in character range, but may have existed in other
occasions
2022-09-27 15:20:24 +09:00
Peter Stephenson
02747bbbd3 49989: Single byte versions of nice quoting.
Align interfaces for "nice" printing of characters with those for
multibyte to make more available in single-byte compilation.
2022-04-05 09:40:07 +01:00
Bart Schaefer
0d9c2422bf 49992: further unify single- and multi-byte implementations of nicechar() 2022-04-04 14:48:21 -07:00
Bart Schaefer
b80d160039 49991: single-byte brace expansion handles $'\0' and control character output aligns with multibyte 2022-04-04 14:21:50 -07:00
Oliver Kiddle
07c77dad50 49606: remove old NIS-specific code for retrieving user data 2021-11-28 20:55:02 +01:00
Oliver Kiddle
271cfc685b 49534, 49539: separate watch/log functionality out into a module 2021-11-02 21:41:53 +01:00
Oliver Kiddle
68c8c60eaa 49533: add null check for preprompt functions list that could occur following an error when loading a module 2021-10-30 23:35:53 +02:00
Jun-ichi Takimoto
dd51ffa5b4 49422: improve support of --disable-dynamic-nss
see also 49392 (Vincent) and 49412 (Axel)
2021-09-22 13:36:57 +09:00
Bart Schaefer
988688d23d 49282: set $0 correctly when calling functions from hooks 2021-09-06 14:02:20 -07:00
Jun-ichi Takimoto
0f62e07c80 48389: getkeystring() should not return ptr to local var
Now it returns NULL if called with GETKEY_SINGLE_CHAR and next character
is not found. Caller must check the return value.
2021-04-06 23:05:03 +09:00
Mikael Magnusson
ea3351c496 48202 + 48366: Fix handling of NUL bytes in zexpandtabs multibyte version 2021-04-01 09:50:52 +02:00
Stephane Chazelas
d96c898101 47745: Fix [:IDENT:] vs posixidentifiers
wcsitype(c, IIDENT) should return false for non-ASCII characters
when the POSIX_IDENTIFIERS option is on, not the other way round.
2021-03-23 00:15:09 -05:00
Bart Schaefer
94e38548e3 45915: fix handling of hyphens in spckword() 2020-05-30 14:31:10 -07:00
Daniel Shahaf
deca7c9285 45730: _arguments: Add the -0 flag, which makes $opt_args be populated sanely.
Also, write/extend docstrings for sepjoin() and zjoin().
2020-05-03 01:27:36 +00:00
Cedric Ware
25c9b61a66 45708: zsh/system: Enable sub-second timeout in zsystem flock 2020-04-20 12:10:01 -05:00
Daniel Shahaf
fc286a7c11 45583/0008: Extend tests to prove that what remains of xsymlinks() handles symlink loops gracefully. 2020-03-25 23:49:02 +00:00
Daniel Shahaf
dabfd1f1fb 45583/0007: Remove code that is now unreachable. 2020-03-25 23:49:02 +00:00
Daniel Shahaf
12347c26ce 45583/0006: Don't use xsymlinks() in 'whence -s'. 2020-03-25 23:49:02 +00:00
Daniel Shahaf
47fc5fe01f 45583/0004: Fix segfault on resolving symlink loops 2020-03-25 23:49:02 +00:00
Peter Stephenson
2b1e5a3d22 45563: %z can be used for zlong in warnings and errors 2020-03-22 18:45:02 +00:00
Jun-ichi Takimoto
0bc1edef5a 45536: fix handling of 8bit character under C-locale
correctly escape unprintable 8bit character by using \M-
2020-03-17 15:11:04 +09:00
Peter Stephenson
a6a1b28b98 45487: Missing mod_export declarations for AIX 2020-02-24 10:55:48 +00:00
dana
ed21a7b700 unposted: zerrmsg(): Fix macro guard missed in previous commit 2019-12-26 14:57:07 -06:00
Daniel Shahaf
81185f4c61 internal: Allow %L in zerrmsg() in non-debug builds, too.
This will let error messages include long integers.
2019-12-26 11:49:45 +00:00
Daniel Shahaf
3c4b3c8798 45064: Fix the mktemp() warning, in debug builds only.
On Linux, linking to mktemp() generates the following warning:
.
    utils.o: In function `gettempname':
    ./Src/utils.c:2229: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'

The warning cannot be disabled.

Work around that by using mkstemp() instead, and massage its output so
it behaves like mktemp().  See the new comment for further details.
2019-12-18 06:01:47 +00:00
Jun-ichi Takimoto
a98e13ed1f 44714: Take account of CDABLE_VARS while checking spelling 2019-08-29 18:21:50 +09:00
Oliver Kiddle
3de2333b08 44307: allow for atoi() returning a negative number 2019-05-20 00:14:01 +02:00
dana
7951ede1db unposted (per 43938): Avoid segfault when unmetafying empty string 2018-12-30 03:42:07 -06:00
dana
162c198aab 43953: Fix rounding/truncation error in %. time-format specifier
Also fixes an issue where %. couldn't be used more than once in a format
string without strange results

Tweaked very slightly per workers/43954
2018-12-29 05:24:25 -06:00