diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-01-14 19:14:40 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-01-14 19:14:40 +0000 |
commit | e142bdeb17005fdb974b0352c743f9da68dbb8aa (patch) | |
tree | 6ff0657f3ec5540579bbce67fcbe950e7782f106 /Src | |
parent | 9fc3e9a8dbfd2bbce2fd825a104414994539cd4d (diff) | |
download | zsh-e142bdeb17005fdb974b0352c743f9da68dbb8aa.tar.gz zsh-e142bdeb17005fdb974b0352c743f9da68dbb8aa.tar.xz zsh-e142bdeb17005fdb974b0352c743f9da68dbb8aa.zip |
zsh-workers/9322
Diffstat (limited to 'Src')
-rw-r--r-- | Src/init.c | 48 | ||||
-rw-r--r-- | Src/zsh.mdd | 3 |
2 files changed, 38 insertions, 13 deletions
diff --git a/Src/init.c b/Src/init.c index 11d9ab65c..e213db0cb 100644 --- a/Src/init.c +++ b/Src/init.c @@ -547,6 +547,18 @@ setupvals(void) #ifdef HAVE_GETRLIMIT int i; #endif +#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) + char **fpathptr; +# if defined(FPATH_DIR) && defined(FPATH_SUBDIRS) + char *fpath_subdirs[] = FPATH_SUBDIRS; + int j; +# endif +# ifdef SITEPATH_DIR + int fpathlen = 1; +# else + int fpathlen = 0; +# endif +#endif getkeyptr = NULL; @@ -581,23 +593,33 @@ setupvals(void) cdpath = mkarray(NULL); manpath = mkarray(NULL); fignore = mkarray(NULL); -#ifdef FPATH_DIR -# ifdef FPATH_SUBDIRS - { - char *fpath_subdirs[] = FPATH_SUBDIRS; - int len = sizeof(fpath_subdirs)/sizeof(char *), j; - - fpath = zalloc((len+1)*sizeof(char *)); - for (j = 0; j < len; j++) - fpath[j] = tricat(FPATH_DIR, "/", fpath_subdirs[j]); - fpath[len] = NULL; - } -# else - fpath = mkarray(ztrdup(FPATH_DIR)); + +#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) +# ifdef FPATH_DIR +# ifdef FPATH_SUBDIRS + fpathlen += sizeof(fpath_subdirs)/sizeof(char *); +# else + fpathlen++; +# endif +# endif + fpath = fpathptr = (char **)zalloc((fpathlen+1)*sizeof(char *)); +# ifdef SITEFPATH_DIR + *fpathptr++ = ztrdup(SITEFPATH_DIR); + fpathlen--; # endif +# ifdef FPATH_DIR +# ifdef FPATH_SUBDIRS + for (j = 0; j < fpathlen; j++) + *fpathptr++ = tricat(FPATH_DIR, "/", fpath_subdirs[j]); +# else + *fpathptr++ = ztrdup(FPATH_DIR); +# endif +# endif + *fpathptr = NULL; #else fpath = mkarray(NULL); #endif + mailpath = mkarray(NULL); watch = mkarray(NULL); psvar = mkarray(NULL); diff --git a/Src/zsh.mdd b/Src/zsh.mdd index cca6ec8f9..f78e0694e 100644 --- a/Src/zsh.mdd +++ b/Src/zsh.mdd @@ -34,6 +34,9 @@ version.h: $(sdir_top)/Config/version.mk zshpaths.h: Makemod $(CONFIG_INCS) @echo '#define MODULE_DIR "'$(MODDIR)'"' > zshpaths.h.tmp + @if test x$(sitefndir) != xno; then \ + echo '#define SITEFPATH_DIR "'$(sitefndir)'"' >> zshpaths.h.tmp; \ + fi @if test x$(fndir) != xno; then \ echo '#define FPATH_DIR "'$(fndir)'"' >> zshpaths.h.tmp; \ if test x$(FUNCTIONS_SUBDIRS) != x -a \ |