mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-06 23:31:28 +02:00
23232: minor tweaks to zmodload
This commit is contained in:
parent
949152124b
commit
11bbce3a66
3 changed files with 16 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-03-23 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 23232: Src/module.c, Doc/Zsh/builtins.yo: improve
|
||||||
|
warning interface; record that zmodload doesn't flag an error
|
||||||
|
on failed loading.
|
||||||
|
|
||||||
2007-03-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
2007-03-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
* 23228: Functions/Calendar/calendar_{scan,show}date: fix
|
* 23228: Functions/Calendar/calendar_{scan,show}date: fix
|
||||||
|
|
|
@ -1864,7 +1864,13 @@ be in a file with a name consisting of the specified var(name) followed by
|
||||||
a standard suffix, usually `tt(.so)' (`tt(.sl)' on HPUX).
|
a standard suffix, usually `tt(.so)' (`tt(.sl)' on HPUX).
|
||||||
If the module to be loaded is
|
If the module to be loaded is
|
||||||
already loaded and the tt(-i) option is given, the duplicate module is
|
already loaded and the tt(-i) option is given, the duplicate module is
|
||||||
ignored. Otherwise tt(zmodload) prints an error message.
|
ignored. Otherwise tt(zmodload) prints an error message and returns
|
||||||
|
a non-zero status. The current code block is not aborted unless
|
||||||
|
tt(zmodload) detects an inconsistency, such as an invalid module name
|
||||||
|
or circular dependency list. Hence `tt(zmodload -i) var(module)
|
||||||
|
tt(2>/dev/null)' is sufficient to test whether a module is available.
|
||||||
|
If it is available, the module is loaded if necessary, while if it
|
||||||
|
is not available, non-zero status is silently returned.
|
||||||
|
|
||||||
The var(name)d module is searched for in the same way a command is, using
|
The var(name)d module is searched for in the same way a command is, using
|
||||||
tt($module_path) instead of tt($path). However, the path search is
|
tt($module_path) instead of tt($path). However, the path search is
|
||||||
|
|
12
Src/module.c
12
Src/module.c
|
@ -439,11 +439,8 @@ do_load_module(char const *name, int silent)
|
||||||
void *ret;
|
void *ret;
|
||||||
|
|
||||||
ret = try_load_module(name);
|
ret = try_load_module(name);
|
||||||
if (!ret && !silent) {
|
if (!ret && !silent)
|
||||||
int waserr = errflag;
|
zwarn("failed to load module: %s", name);
|
||||||
zerr("failed to load module: %s", name);
|
|
||||||
errflag = waserr;
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,11 +451,8 @@ do_load_module(char const *name, int silent)
|
||||||
static void *
|
static void *
|
||||||
do_load_module(char const *name, int silent)
|
do_load_module(char const *name, int silent)
|
||||||
{
|
{
|
||||||
int waserr = errflag;
|
|
||||||
|
|
||||||
if (!silent)
|
if (!silent)
|
||||||
zerr("failed to load module: %s", name);
|
zwarn("failed to load module: %s", name);
|
||||||
errflag = waserr;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue