about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2020-01-16 20:23:50 +0000
committerDaniel Shahaf <danielsh@apache.org>2020-01-26 03:46:00 +0000
commit35111697316f1b2d48144c58e0e345770bb3fb71 (patch)
tree5581fdc72015f5742ddcf082549f82edecd41493
parent5e843a3721ff53a9a2c0c8a3611cba829640716c (diff)
downloadzsh-35111697316f1b2d48144c58e0e345770bb3fb71.tar.gz
zsh-35111697316f1b2d48144c58e0e345770bb3fb71.tar.xz
zsh-35111697316f1b2d48144c58e0e345770bb3fb71.zip
unposted: internal: Add some comments and fix indentation. No functional change.
-rw-r--r--ChangeLog5
-rw-r--r--Src/init.c15
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 625e4a639..870588391 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-26  Daniel Shahaf  <danielsh@apache.org>
+
+	* unposted: Src/init.c: internal: Add some comments and fix
+	indentation.  No functional change.
+
 2020-01-23  Daniel Shahaf  <danielsh@apache.org>
 
 	* 45340: Src/params.c: internal: Document the difference between
diff --git a/Src/init.c b/Src/init.c
index 2e2ef881c..04a5856ff 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -882,7 +882,7 @@ setupvals(char *cmd, char *runscript, char *zsh_name)
     char *ptr;
     int i, j;
 #if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined (ADDITIONAL_FPATH) || defined(FIXED_FPATH_DIR)
-#define FPATH_NEEDS_INIT 1
+# define FPATH_NEEDS_INIT 1
     char **fpathptr;
 # if defined(FPATH_DIR) && defined(FPATH_SUBDIRS)
     char *fpath_subdirs[] = FPATH_SUBDIRS;
@@ -994,18 +994,29 @@ setupvals(char *cmd, char *runscript, char *zsh_name)
 # endif /* ADDITONAL_FPATH */
     fpath = fpathptr = (char **)zalloc((fpathlen+1)*sizeof(char *));
 # ifdef FIXED_FPATH_DIR
+    /* Zeroth: /usr/local/share/zsh/site-functions */
     *fpathptr++ = ztrdup(FIXED_FPATH_DIR);
     fpathlen--;
 # endif
 # ifdef SITEFPATH_DIR
+    /* First: the directory from --enable-site-fndir
+     *
+     * default: /usr/local/share/zsh/site-functions
+     * (but changeable by passing --prefix or --datadir to configure) */
     *fpathptr++ = ztrdup(SITEFPATH_DIR);
     fpathlen--;
 # endif /* SITEFPATH_DIR */
 # if defined(ADDITIONAL_FPATH)
+    /* Second: the directories from --enable-additional-fpath
+     * 
+     * default: empty list */
     for (j = 0; j < more_fndirs_len; j++)
 	*fpathptr++ = ztrdup(more_fndirs[j]);
 # endif
 # ifdef FPATH_DIR
+    /* Third: The directory from --enable-fndir
+     *
+     * default: /usr/local/share/zsh/${ZSH_VERSION}/functions */
 #  ifdef FPATH_SUBDIRS
 #   ifdef ADDITIONAL_FPATH
     for (j = more_fndirs_len; j < fpathlen; j++)
@@ -1013,7 +1024,7 @@ setupvals(char *cmd, char *runscript, char *zsh_name)
 #   else
     for (j = 0; j < fpathlen; j++)
 	*fpathptr++ = tricat(FPATH_DIR, "/", fpath_subdirs[j]);
-#endif
+#   endif
 #  else
     *fpathptr++ = ztrdup(FPATH_DIR);
 #  endif