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

57 commits

Author SHA1 Message Date
Roman Perepelitsa
6f6363de94 46275: eliminate undefined behavior caused by redefinition of hashtable
struct hashtable has different set of data members in different
translation units. This is undefined behavior.
2020-07-29 08:27:15 +02:00
Martijn Dekker
c578f0a08b 45004: Fix typos in comments 2019-12-11 02:37:39 +00:00
Daniel Shahaf
4b55c0f40c 42146: type -w += global aliases
Follow-up to 36403, which did the same for suffix aliases.
2017-12-20 05:43:42 +00:00
Peter Stephenson
151a4660e2 41164: Don't free a history entry if it's curline.
This replaces 41113 / 94014ff65b with a simple local change for the
immediate problem.  It's not entirely clear if this reflects wider
changes in the structure of the history code.
2017-05-30 09:39:32 +01:00
Peter Stephenson
94014ff65b 41113 (tweaked): Save current line linkage to history ring.
When saving history state save whether the current history line
is linked into the ring and remove it, and restore as appropriate
later.  This avoids surprises where the history ring is freed
and incorrectly frees the current state in curline, which has
a different allocation strategy.

Original patch tweaked to make restoring more logical.
2017-05-18 09:33:08 +01:00
Jun-ichi Takimoto
c09af3516f unposted: declare file local variables as static 2017-03-10 18:44:41 +09: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
Peter Stephenson
f90a0447aa 40353 with tweaks to whence -v: extend directory cache use.
Now used for all autoloaded functions after load, including those
where the file was found along fpath, reducing duplication of
directory names.
2017-01-16 10:31:56 +00:00
Peter Stephenson
00f16c8e68 unposted: one missing *name = NULL 2017-01-12 20:59:24 +00:00
Peter Stephenson
178e62dbfe 40342: Add directory name cache for autoload file paths.
This renders "autoload /blah/blah/*" as efficient as use of
fpath.
2017-01-12 20:56:20 +00:00
Peter Stephenson
f26d1ba6b0 Add features associated with autoloading a function using an absolute
path.

-d defaults to normal fpath

-r remembers the path without actually loading.  May be combined with -d.

-R does the same but it's an error if not found

-X can now take a directory path: this is used to output not yet loaded
functions that have an associated path.
2017-01-11 11:26:13 +00:00
Daniel Shahaf
3a8727dc6b 40009: alias -L: Emit aliases that begin with a plus sign correctly. 2016-11-28 07:16:37 +00:00
Jun-ichi Takimoto
ca3bc0d95d 37838: use UNUSED() consistently 2016-01-30 00:26:23 +09:00
Daniel Shahaf
a8a00be442 37591: 'alias -L': skip with a warning aliases with '=' in their LHS 2016-01-13 01:25:46 +00:00
Daniel Shahaf
1ba2fac03d 36403: type -w += suffix alias
This makes 'type -w' distinguish suffix aliases from regular aliases,
like bare 'type' already does.

Use-case: detecting programmatically whether the command word is indeed
a valid command word (see <https://github.com/zsh-users/zsh-syntax-highlighting/issues/126>)
2015-09-03 09:17:39 +00: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
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
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
Peter Stephenson
cf6b0f5663 33285: apply function definition redirections at execution 2014-09-29 21:02:59 +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
6f3ff6b653 30633: "functions -T" only traces marked function, not called functions 2012-08-21 18:03:01 +00:00
Bart Schaefer
30361b650c 30184: use a HASH_EXECUTABLES_ONLY test that matches the test used by
exec.c:iscom() during path search.
2012-03-01 03:35:04 +00:00
Peter Stephenson
c214b86e94 30101: add HASH_EXECUTABLES_ONLY option 2012-01-08 16:02:54 +00:00
Peter Stephenson
bafa15955d 29195: Separate nameddir hash to avoid clash of
"bool" type on Solaris
2011-05-09 10:38:02 +00:00
Peter Stephenson
d89361739a 29165: use term.h globally if needed at all. 2011-05-09 09:49:08 +00:00
Peter Stephenson
e85349fbf7 users/14411: Src/hashtable.c: only hash stat-able executable regular
files as commands
2009-09-21 09:22:20 +00:00
Peter Stephenson
c7d8b0dfb8 26546, 26556: sticky emulation for functions defined in emulate ... -c ...
environments, plus documentation
2009-02-11 20:42:15 +00:00
Clint Adams
484644676a 25985: don't try to disable signal traps if getsignum returns -1. 2008-11-01 01:19:35 +00:00
Peter Stephenson
d37f9672cb 25651: make getpermtext() output indentation more logical 2008-09-11 17:14:38 +00:00
Peter Stephenson
2853ca830a 25247 with further modifications: add $funcsourcetrace 2008-08-11 19:22:54 +00:00
Oliver Kiddle
8d956e9bcb 24048: fix home directory expansion with NIS on Solaris 2007-11-01 10:59:40 +00:00
Peter Stephenson
1b52f47cf2 23665: autoloading of module features and related tweaks 2007-07-06 21:52:38 +00:00
Peter Stephenson
0108088f52 23152: make ztrcmp() respect MULTIBYTE
make sorting of printed hash tables more consistent
2007-02-06 21:47:54 +00:00
Wayne Davison
4cb83571c4 Changed some structures to avoid gcc's type-punned warnings. 2006-03-07 21:30:36 +00:00
Clint Adams
a915138852 22284: add --disable-dynamic-nss configure switch to disable use of getpw*(), getgr*(), initgroups() functions. 2006-02-19 19:36:31 +00:00
Wayne Davison
e79af955f0 Got rid of some unsigned-char/char pointer casts. 2005-11-15 08:44:17 +00:00
Peter Stephenson
05b06b1c08 fix autoloaded trap bug; rejig use of trapfuncs
(now traplists); improve trap tests
2005-02-06 20:36:09 +00:00
Wayne Davison
fb0937a69e Marked unused parameters with the new UNUSED() macro. 2004-06-02 22:14:25 +00:00
Wayne Davison
059162c442 Supply all initializers for the final struct reswd element. 2004-05-28 19:07:13 +00:00
Oliver Kiddle
ca0deae382 19767, 19785: store flags for -z and -k options to autoload allowing the
completion system to be used with ksh_autoload set
2004-04-20 12:11:13 +00:00
Oliver Kiddle
95231270ed 19595: rename DO to DOLOOP to avoid conflict with curses.h on Tru64 5.1 2004-03-11 14:25:12 +00:00
Peter Stephenson
815bc92148 a la 19209: zcalloc -> zshcalloc 2003-10-29 19:17:30 +00:00
Peter Stephenson
8e359a669e 19020: fix printaliasnode 2003-09-03 13:41:25 +00:00
Peter Stephenson
3ffb3ad2f2 19014: add alias -s suf=handler 2003-09-03 10:15:32 +00:00
Peter Stephenson
9634760d5e 17582: Improved option argument handling.
unposted: Updated version to 4.1.0-dev-6 because of interface change.
2002-08-27 21:10:30 +00:00
Oliver Kiddle
af0697b705 17503: fix various typos and spelling mistakes in source code comments 2002-08-05 12:35:59 +00:00
Andrey Borzenkov
7c0a534298 15253 : hash foo together with foo.exe on Cygwin 2001-07-05 11:43:10 +00:00
Wayne Davison
7e17db1fdc The function addhistnode() is no longer called for a HIST_TMPSTORE
entry, so I removed the checking for that flag.  Also, freehistdata()
now avoids calling removehashnode() on a HIST_TMPSTORE entry.
2001-05-19 09:22:07 +00:00
Wayne Davison
eb71464b09 Changed addhistnode() to not displace an already-hashed command with
one that is marked HIST_TMPSTORE.  Also changed the function to not
ever destroy the entry we're currently adding (the caller now destroys
the newly-added entry, if it so desires).
2001-05-15 16:32:22 +00:00
Sven Wischnowsky
757168e2c8 remove 13108 (trap queues); replace with signal queueing to ensure that user signal handlers are only executed when it is safe to run them (13365) 2001-01-16 13:44:18 +00:00