diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2014-10-08 01:29:12 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2014-10-08 01:29:12 +0200 |
commit | 1c3f90e3af0c3d6c8e946653169287baf5814ad4 (patch) | |
tree | 9b15e9ad8157bd8f9f697f6dc4e59146b6833c59 /Src/init.c | |
parent | 1ffb184b46edd34d389af4e016abcaafec454d44 (diff) | |
parent | 9982ab6fb5266298c056326ed265fc8560202603 (diff) | |
download | zsh-1c3f90e3af0c3d6c8e946653169287baf5814ad4.tar.gz zsh-1c3f90e3af0c3d6c8e946653169287baf5814ad4.zip |
Merge commit '9982ab6fb5266298c056326ed265fc8560202603' into debian
This is exactly one commit after the zsh-5.0.7 and adds one missing
(and not unimportant) changelog entry for the 5.0.7 release.
Diffstat (limited to 'Src/init.c')
-rw-r--r-- | Src/init.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/Src/init.c b/Src/init.c index 5e92f59df..6d005dce7 100644 --- a/Src/init.c +++ b/Src/init.c @@ -252,8 +252,9 @@ parseargs(char **argv, char **runscript) paramlist = znewlinklist(); if (*argv) { if (unset(SHINSTDIN)) { + posixzero = *argv; if (cmd) - argzero = posixzero = *argv; + argzero = *argv; else *runscript = *argv; opts[INTERACTIVE] &= 1; @@ -769,7 +770,8 @@ setupvals(void) struct timezone dummy_tz; char *ptr; int i, j; -#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined (ADDITIONAL_FPATH) +#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined (ADDITIONAL_FPATH) || defined(FIXED_FPATH_DIR) +#define FPATH_NEEDS_INIT 1 char **fpathptr; # if defined(FPATH_DIR) && defined(FPATH_SUBDIRS) char *fpath_subdirs[] = FPATH_SUBDIRS; @@ -778,11 +780,17 @@ setupvals(void) char *more_fndirs[] = ADDITIONAL_FPATH; int more_fndirs_len; # endif +# ifdef FIXED_FPATH_DIR +# define FIXED_FPATH_LEN 1 +# else +# define FIXED_FPATH_LEN 0 +# endif # ifdef SITEFPATH_DIR - int fpathlen = 1; +# define SITE_FPATH_LEN 1 # else - int fpathlen = 0; +# define SITE_FPATH_LEN 0 # endif + int fpathlen = FIXED_FPATH_LEN + SITE_FPATH_LEN; #endif int close_fds[10], tmppipe[2]; @@ -861,23 +869,27 @@ setupvals(void) manpath = mkarray(NULL); fignore = mkarray(NULL); -#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined(ADDITIONAL_FPATH) +#ifdef FPATH_NEEDS_INIT # ifdef FPATH_DIR # ifdef FPATH_SUBDIRS fpathlen += sizeof(fpath_subdirs)/sizeof(char *); -# else +# else /* FPATH_SUBDIRS */ fpathlen++; -# endif -# endif +# endif /* FPATH_SUBDIRS */ +# endif /* FPATH_DIR */ # if defined(ADDITIONAL_FPATH) more_fndirs_len = sizeof(more_fndirs)/sizeof(char *); fpathlen += more_fndirs_len; -# endif +# endif /* ADDITONAL_FPATH */ fpath = fpathptr = (char **)zalloc((fpathlen+1)*sizeof(char *)); +# ifdef FIXED_FPATH_DIR + *fpathptr++ = ztrdup(FIXED_FPATH_DIR); + fpathlen--; +# endif # ifdef SITEFPATH_DIR *fpathptr++ = ztrdup(SITEFPATH_DIR); fpathlen--; -# endif +# endif /* SITEFPATH_DIR */ # if defined(ADDITIONAL_FPATH) for (j = 0; j < more_fndirs_len; j++) *fpathptr++ = ztrdup(more_fndirs[j]); @@ -896,9 +908,9 @@ setupvals(void) # endif # endif *fpathptr = NULL; -#else +#else /* FPATH_NEEDS_INIT */ fpath = mkarray(NULL); -#endif +#endif /* FPATH_NEEDS_INIT */ mailpath = mkarray(NULL); watch = mkarray(NULL); @@ -1122,6 +1134,7 @@ init_signals(void) winch_block(); /* See utils.c:preprompt() */ #endif if (interact) { + install_handler(SIGPIPE); install_handler(SIGALRM); signal_ignore(SIGTERM); } |