Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: change module_path to mpath(?)



When I was fiddling with the module stuff I said that I would like to
change the name of the parameter `module_path' to `mapth' (to match it 
with `fpath' and to avoid the underscore which is quite unusual for a
zsh-parameter).

The patch below does this. So this is an incompatible change and I'm
far from sure if you'll want to apply it. Also I'm not sure, if you
like it anyway.

Bye
 Sven

diff -u os/init.c Src/init.c
--- os/init.c	Sat Jan 30 21:20:19 1999
+++ Src/init.c	Sat Jan 30 21:22:07 1999
@@ -515,7 +515,7 @@
     watch    = mkarray(NULL);
     psvar    = mkarray(NULL);
 #ifdef DYNAMIC
-    module_path = mkarray(ztrdup(MODULE_DIR));
+    mpath = mkarray(ztrdup(MODULE_DIR));
     modules = newlinklist();
 #endif
 
diff -u os/module.c Src/module.c
--- os/module.c	Sat Jan 30 21:20:19 1999
+++ Src/module.c	Sat Jan 30 21:22:50 1999
@@ -127,10 +127,10 @@
 
 #ifdef DYNAMIC
 
-/* $module_path ($MODULE_PATH) */
+/* $mpath ($MPATH) */
 
 /**/
-char **module_path;
+char **mpath;
 
 /* List of modules */
 
@@ -345,7 +345,7 @@
     }
 
     l = strlen(name) + 1;
-    for (pp = module_path; !ret && *pp; pp++) {
+    for (pp = mpath; !ret && *pp; pp++) {
 	if (l + (**pp ? strlen(*pp) : 1) > PATH_MAX)
 	    continue;
 	sprintf(buf, "%s/%s", **pp ? *pp : ".", name);
diff -u os/params.c Src/params.c
--- os/params.c	Sat Jan 30 21:20:19 1999
+++ Src/params.c	Sat Jan 30 21:25:47 1999
@@ -202,8 +202,8 @@
 IPDEF8("PSVAR", &psvar, "psvar", 0),
 
 #ifdef DYNAMIC
-/* MODULE_PATH is not imported for security reasons */
-IPDEF8("MODULE_PATH", &module_path, "module_path", PM_DONTIMPORT|PM_RESTRICTED),
+/* MPATH is not imported for security reasons */
+IPDEF8("MPATH", &mpath, "mpath", PM_DONTIMPORT|PM_RESTRICTED),
 #endif
 
 #define IPDEF9F(A,B,C,D) {NULL,A,D|PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT,BR((void *)B),SFN(arrvarsetfn),GFN(arrvargetfn),stdunsetfn,0,NULL,C,NULL,0}
@@ -238,7 +238,7 @@
 /*TEST END*/
 
 #ifdef DYNAMIC
-IPDEF9F("module_path", &module_path, "MODULE_PATH", PM_RESTRICTED),
+IPDEF9F("mpath", &mpath, "MPATH", PM_RESTRICTED),
 #endif
 IPDEF9F("path", &path, "PATH", PM_RESTRICTED),
 
diff -u om/compctl-examples Misc/compctl-examples
--- om/compctl-examples	Sat Jan 30 21:19:41 1999
+++ Misc/compctl-examples	Sat Jan 30 21:23:23 1999
@@ -52,7 +52,7 @@
 compctl -x 'p[1]' - 'p[2,-1]' -l '' -- sched
 compctl -x 'C[-1,[+-]o]' -o - 'c[-1,-A]' -A -- set
 compctl -b -x 'w[1,-N] p[3]' -F -- zle
-compctl -s '${^module_path}/*(N:t:r)' -x \
+compctl -s '${^mpath}/*(N:t:r)' -x \
 	'W[1,-*(a*u|u*a)*],W[1,-*a*]p[3,-1]' -B - \
 	'W[1,-*u*]' -s '$(zmodload)' -- zmodload
 
diff -u om/new-completion-examples Misc/new-completion-examples
--- om/new-completion-examples	Sat Jan 30 21:19:41 1999
+++ Misc/new-completion-examples	Sat Jan 30 21:23:38 1999
@@ -517,7 +517,7 @@
   elif [[ -mword 1 -*u* ]] then
     complist -s '$(zmodload)'
   else
-    complist -s '${^module_path}/*(N:t:r)'
+    complist -s '${^mpath}/*(N:t:r)'
   fi
 }
 
diff -u od/Zsh/builtins.yo Doc/Zsh/builtins.yo
--- od/Zsh/builtins.yo	Sat Jan 30 21:19:49 1999
+++ Doc/Zsh/builtins.yo	Sat Jan 30 21:24:12 1999
@@ -1175,7 +1175,7 @@
 tt(zmodload) prints an error message.
 
 The var(name)d module is searched for in the same way a command is, using
-tt($module_path) instead of tt($path).  If var(name) contains a `tt(/)',
+tt($mpath) instead of tt($path).  If var(name) contains a `tt(/)',
 it will be used as-is, and a path search will be performed otherwise.
 This behaviour can be modified by the tt(PATH_DIRS) option.
 cindex(PATH_DIRS, use of)
diff -u od/Zsh/params.yo Doc/Zsh/params.yo
--- od/Zsh/params.yo	Sat Jan 30 21:19:50 1999
+++ Doc/Zsh/params.yo	Sat Jan 30 21:24:30 1999
@@ -556,9 +556,9 @@
 array can be useful, however, since setting it also sets
 tt(MANPATH), and vice versa.
 )
-vindex(module_path)
-vindex(MODULE_PATH)
-item(tt(module_path) <S> <Z> (tt(MODULE_PATH) <S>))(
+vindex(mpath)
+vindex(MPATH)
+item(tt(mpath) <S> <Z> (tt(MPATH) <S>))(
 An array (colon-separated list)
 of directories that tt(zmodload)
 searches for dynamically loadable modules.
diff -u od/Zsh/restricted.yo Doc/Zsh/restricted.yo
--- od/Zsh/restricted.yo	Sat Jan 30 21:19:50 1999
+++ Doc/Zsh/restricted.yo	Sat Jan 30 21:24:51 1999
@@ -13,8 +13,8 @@
 
 startitemize()
 itemiz(changing directories with the tt(cd) builtin)
-itemiz(changing or unsetting the tt(PATH), tt(path), tt(MODULE_PATH),
-tt(module_path), tt(SHELL), tt(HISTFILE), tt(HISTSIZE), tt(GID), tt(EGID),
+itemiz(changing or unsetting the tt(PATH), tt(path), tt(MPATH),
+tt(mpath), tt(SHELL), tt(HISTFILE), tt(HISTSIZE), tt(GID), tt(EGID),
 tt(UID), tt(EUID), tt(USERNAME), tt(LD_LIBRARY_PATH),
 tt(LD_AOUT_LIBRARY_PATH), tt(LD_PRELOAD) and  tt(LD_AOUT_PRELOAD)
 parameters)

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author