mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
40306 with doc tweaks: Change behaviour expanding alias in () function definition.
Now an error unless the () is part of the same error as the name. Add ALIAS_FUNC_DEF option to allow it again.
This commit is contained in:
parent
b088b67a54
commit
bb218704d2
8 changed files with 129 additions and 6 deletions
27
Src/input.c
27
Src/input.c
|
@ -670,3 +670,30 @@ ingetptr(void)
|
|||
{
|
||||
return inbufptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the current input line, including continuations, is
|
||||
* expanding an alias. This does not detect alias expansions that
|
||||
* have been fully processed and popped from the input stack.
|
||||
* If there is an alias, the most recently expanded is returned,
|
||||
* else NULL.
|
||||
*/
|
||||
|
||||
/**/
|
||||
char *input_hasalias(void)
|
||||
{
|
||||
int flags = inbufflags;
|
||||
struct instacks *instackptr = instacktop;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (!(flags & INP_CONT))
|
||||
break;
|
||||
instackptr--;
|
||||
if (instackptr->alias)
|
||||
return instackptr->alias->node.nam;
|
||||
flags = instackptr->flags;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue