1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-26 22:10:45 +02:00

Fixes from Thorsten Dahlheimer.

21578: mkmakemod.sh didn't exit on cleanup.
21582: fix failure status of zmodload -R.
21583: fix circularity test of zmodload -A.
This commit is contained in:
Peter Stephenson 2005-08-09 10:02:08 +00:00
parent aa638fec26
commit c73dd46019
4 changed files with 37 additions and 14 deletions

View File

@ -1,5 +1,14 @@
2005-08-09 Peter Stephenson <pws@csr.com>
* 21583: Thorsten Dahlheimer: Src/module.c: extend circularity
test of zmodload -A.
* 21582: Thorsten Dahlheimer: Src/module.c: failure status of
zmodload -R was wrong.
* 21578: Thorsten Dahlheimer: Src/mkmakemod.sh: script used not
to exit after cleaning up.
* 21577 (adapted): Dan Bullok: Src/Zle/zle_main.c, Src/init.c,
Src/utils.c: improved 21567 which reexpands the prompt and
refreshes but doesn't trash the line editor.

View File

@ -1481,6 +1481,17 @@ resetprompt(UNUSED(char **args))
return redisplay(NULL);
}
/* same bug called from outside zle */
/**/
mod_export void
zle_resetprompt(void)
{ reexpandprompt();
if (zleactive)
redisplay(NULL);
}
/**/
mod_export void
trashzle(void)
@ -1572,6 +1583,7 @@ setup_(UNUSED(Module m))
{
/* Set up editor entry points */
trashzleptr = trashzle;
zle_resetpromptptr = zle_resetprompt;
zrefreshptr = zrefresh;
zleaddtolineptr = zleaddtoline;
zlegetlineptr = zlegetline;
@ -1659,6 +1671,7 @@ finish_(UNUSED(Module m))
/* editor entry points */
trashzleptr = noop_function;
zle_resetpromptptr = noop_function;
zrefreshptr = noop_function;
zleaddtolineptr = noop_function_int;
zlegetlineptr = NULL;

View File

@ -37,7 +37,7 @@
# `:<<\Make' and `Make' -- this will be copied into Makemod.in.
#
# The resulting Makemod.in knows how to build each module that is defined.
# For each module in also knows how to build a .mdh file. Each source file
# For each module it also knows how to build a .mdh file. Each source file
# should #include the .mdh file for the module it is a part of. The .mdh
# file #includes the .mdh files for any module dependencies, then each of
# $headers, and then each .epro (for global declarations). It will
@ -92,7 +92,7 @@ if $first_stage; then
dir_top=`echo $the_subdir | sed 's,[^/][^/]*,..,g'`
trap "rm -f $the_subdir/${the_makefile}.in" 1 2 15
trap "rm -f $the_subdir/${the_makefile}.in; exit 1" 1 2 15
echo "creating $the_subdir/${the_makefile}.in"
exec 3>&1 >$the_subdir/${the_makefile}.in
echo "##### ${the_makefile}.in generated automatically by mkmakemod.sh"
@ -466,11 +466,11 @@ if $first_stage; then
fi
if $second_stage ; then
trap "rm -f $the_subdir/${the_makefile}" 1 2 15
trap "rm -f $the_subdir/${the_makefile}; exit 1" 1 2 15
${CONFIG_SHELL-/bin/sh} ./config.status \
--file=$the_subdir/${the_makefile}:$the_subdir/${the_makefile}.in ||
return 1
exit 1
fi
exit 0

View File

@ -1043,7 +1043,6 @@ bin_zmodload_alias(char *nam, char **args, Options ops)
*/
LinkNode node;
Module m;
int ret = 0;
if (!*args) {
if (OPT_ISSET(ops,'R')) {
@ -1058,7 +1057,7 @@ bin_zmodload_alias(char *nam, char **args, Options ops)
return 0;
}
for (; !ret && *args; args++) {
for (; *args; args++) {
char *eqpos = strchr(*args, '=');
char *aliasname = eqpos ? eqpos+1 : NULL;
if (eqpos)
@ -1078,8 +1077,7 @@ bin_zmodload_alias(char *nam, char **args, Options ops)
m = (Module) getdata(node);
if (!(m->flags & MOD_ALIAS)) {
zwarnnam(nam, "module is not an alias: %s", *args, 0);
ret = 1;
break;
return 1;
}
delete_module(node);
} else {
@ -1093,12 +1091,15 @@ bin_zmodload_alias(char *nam, char **args, Options ops)
zwarnnam(nam, "invalid module name `%s'", aliasname, 0);
return 1;
}
find_module(aliasname, 1, &mname);
if (!strcmp(mname, *args)) {
zwarnnam(nam, "module alias would refer to itself: %s",
*args, 0);
return 1;
}
do {
if (!strcmp(mname, *args)) {
zwarnnam(nam, "module alias would refer to itself: %s",
*args, 0);
return 1;
}
} while ((node = find_module(mname, 0, NULL))
&& ((m = (Module) getdata(node))->flags & MOD_ALIAS)
&& (mname = m->u.alias));
node = find_module(*args, 0, NULL);
if (node) {
m = (Module) getdata(node);