Support absolute directory names in -x argument and in yate.conf extrapath.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6088 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2016-02-08 09:24:21 +00:00
parent 2966769c33
commit 3ec80e12bb
3 changed files with 9 additions and 6 deletions

View File

@ -11,8 +11,8 @@
; Note that you MUST NOT add a path separator at the end
;modpath=
; extrapath: string: Relative path to an extra modules directory, gets loaded
; before those added by command line -x parameters
; extrapath: string: Absolute or relative path to an extra modules directory,
; gets loaded before those added by command line -x parameters
; Note that you MUST NOT add a path separator at the end
;extrapath=

View File

@ -68,8 +68,8 @@ Path to modules directory, overrides compiled-in value
.B \-e \fIpathname\fR
Path to shared directory, overrides compiled-in value
.TP
.B \-x \fIrelpath\fR
Relative path to extra modules directory (can be repeated)
.B \-x \fIdirpath\fR
Absolute or relative path to extra modules directory (can be repeated)
.TP
.B \-w \fIdirectory\fR
Change working directory

View File

@ -1831,7 +1831,10 @@ bool Engine::loadPluginDir(const String& relPath)
#endif
bool defload = s_cfg.getBoolValue("general","modload",true);
String path = s_modpath;
if (relPath) {
static const Regexp r("^\\([/\\]\\|[[:alpha:]]:[/\\]\\).");
if (r.matches(relPath))
path = relPath;
else if (relPath) {
if (!path.endsWith(PATH_SEP))
path += PATH_SEP;
path += relPath;
@ -2275,7 +2278,7 @@ static void usage(bool client, FILE* f)
" -c pathname Path to conf files directory (" CFG_PATH ")\n"
" -u pathname Path to user files directory (%s)\n"
" -m pathname Path to modules directory (" MOD_PATH ")\n"
" -x relpath Relative path to extra modules directory (can be repeated)\n"
" -x dirpath Absolute or relative path to extra modules directory (can be repeated)\n"
" -w directory Change working directory\n"
" -N nodename Set the name of this node in a cluster\n"
#ifdef RLIMIT_CORE