summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog49
-rw-r--r--Completion/Unix/Command/_iconv67
-rw-r--r--Completion/Unix/Type/_hosts15
-rw-r--r--Config/version.mk4
-rw-r--r--Doc/Zsh/builtins.yo4
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_detect_svn2
-rw-r--r--INSTALL20
-rw-r--r--Src/exec.c5
-rw-r--r--Src/init.c2
-rw-r--r--Test/A05execution.ztst4
-rw-r--r--Test/E01options.ztst17
-rwxr-xr-xUtil/helpfiles38
12 files changed, 180 insertions, 47 deletions
diff --git a/ChangeLog b/ChangeLog
index f2736c7f7..02722f1c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2013-12-14 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * unposted: version 5.0.3, finally.
+
+2013-12-13 Barton E. Schaefer <schaefer@zsh.org>
+
+ * Martin Vaeth: 32105: Util/helpfiles: support all combinations of
+ man or nroff with colcrt or col.
+
+ * Aaron Peschel: 32103: Completion/Unix/Type/_hosts: parse
+ host:port format in ssh known_hosts files.
+
+2013-12-10 Barton E. Schaefer <schaefer@zsh.org>
+
+ * 32099: Src/init.c: fix pointer declaration to avoid compile
+ time error when arithmetic on void * is not allowed.
+
+2013-12-09 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * users/18210: Doc/Zsh/builtins.yo: document print -D better.
+
+ * 32093: INSTALL: describe the dependency issues fixed
+ by the doc bundle.
+
+2013-12-09 Peter Stephenson <p.stephenson@samsung.com>
+
+ * Jun T.: 32056: Completion/Unix/Command/_iconv: Handle
+ different versions of iconv.
+
+2013-12-06 Peter Stephenson <p.stephenson@samsung.com>
+
+ * Daniel Shahaf: 32091: Src/exec.c, Test/E01options.ztst:
+ WARN_CREATE_GLOBAL false positive for assignment before
+ commands.
+
+2013-12-05 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * Daniel Shahaf: 32089:
+ Functions/VCS_Info/Backends/VCS_INFO_detect_svn: tweak for
+ detecting Subversion repository.
+
+2013-12-02 Barton E. Schaefer <schaefer@zsh.org>
+
+ * 32080 (plus unposted second instance of same):
+ Test/A05execution.ztst: suppress any error output from
+ nonessential "setopt MONITOR"
+
2013-12-01 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted: Config/version.mk: 5.0.2-test-3.
@@ -27,7 +74,7 @@
Src/Modules/example.c, Src/module.c: Rationalise character
encodings: shell functions are strictly ASCII for maximum
portability; other files needed for building and documentation
- are ASCII are UTF-8; test files may use ISO-8859-X (we don't
+ are ASCII or UTF-8; test files may use ISO-8859-X (we don't
require the Euro symbol) where needed to get single character
input with the top bit set.
diff --git a/Completion/Unix/Command/_iconv b/Completion/Unix/Command/_iconv
index 190ed5f77..82c2d320a 100644
--- a/Completion/Unix/Command/_iconv
+++ b/Completion/Unix/Command/_iconv
@@ -1,37 +1,58 @@
#compdef iconv
local expl curcontext="$curcontext" state line ret=1
-local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}"
-local -U codeset
-
-if _pick_variant gnu='(GNU|EGLIBC)' unix --version; then
-
- local exargs="--list -? --help --usage --version -V"
- _arguments -C -S -s \
- "(-f --from-code $exargs)"{-f+,--from-code=}'[specify code set of input file]:code set:->codeset' \
- "(-t --to-code $exargs)"{-t+,--to-code=}'[specify code set for output]:code set:->codeset' \
- '(- 1 -l --list)'{-l,--list}'[list all character code sets]' \
- "($exargs)-c[omit invalid characters from output]" \
- "(-o --output $exargs)"{-o+,--output=}'[specify output file]:output file:_files' \
- "(-s --silent --verbose $exargs)"{-s,--silent}'[suppress warnings]' \
- "(-s --silent $exargs)--verbose[print progress information]" \
- '(-)'{-\?,--help}'[display help information]' \
- '(-)--usage[display a short usage message]' \
- '(-)'{-V,--version}'[print program version]' \
- '1:input file:_files' && return 0
- if [[ $state = codeset ]]; then
- if compset -P '*[^/]/'; then
- _wanted option expl option compadd "$@" /TRANSLIT && ret=0
+if _pick_variant libiconv='GNU*libiconv' glibc='(GNU*libc|EGLIBC)' unix --version; then
+ local -a args
+ local exargs="-l --list -? --help --usage --version -V"
+
+ args=(
+ "(-f --from-code $exargs)"{-f+,--from-code=}'[specify code set of input file]:code set:->from_codeset'
+ "(-t --to-code $exargs)"{-t+,--to-code=}'[specify code set for output]:code set:->to_codeset'
+ '(- 1 -l --list)'{-l,--list}'[list all character code sets]'
+ "($exargs)-c[omit invalid characters from output]"
+ "(-s --silent --verbose $exargs)"{-s,--silent}'[suppress warnings]'
+ '(-)'{-\?,--help}'[display help information]'
+ '(-)--usage[display a short usage message]'
+ '(-)'{-V,--version}'[print program version]'
+ '1:input file:_files'
+ )
+
+ case $_cmd_variant[$service] in
+ (libiconv)
+ args=( ${(R)args:#(|\*)(|\(*\))-[V\?]*} ) # remove -V and -?
+ args+=(
+ '--byte-subst=[format for unconvertible bytes]:format string:'
+ '--widechar-subst=[format for unconvertible wide chars]:format string:'
+ '--unicode-subst=[format for unconvertible Unicode chars]:format string:'
+ )
+ ;;
+ (glibc)
+ args+=(
+ "(-o --output $exargs)"{-o+,--output=}'[specify output file]:output file:_files'
+ "(-s --silent $exargs)--verbose[print progress information]"
+ )
+ ;;
+ esac
+
+ _arguments -C -S -s : $args && return 0
+
+ if [[ $state = *_codeset ]]; then
+ # suffix is meaningfull only for output encoding
+ if [[ $state = to_codeset ]] && compset -P '*[^/]/'; then
+ _wanted suffix expl suffix compadd "$@" /TRANSLIT /IGNORE && ret=0
else
_wanted codesets expl 'code set' compadd "$@" \
- -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
- ${${${(f)"$(_call_program codesets iconv --list)"}## #}%//} && ret=0
+ -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
+ ${$(_call_program codesets iconv --list)%//} && ret=0
fi
fi
return ret
+
else
+ local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}"
+ local -U codeset
_arguments -C \
'-f[specify code set of input file]:code set:->codeset' \
diff --git a/Completion/Unix/Type/_hosts b/Completion/Unix/Type/_hosts
index 499caede1..c3133dc68 100644
--- a/Completion/Unix/Type/_hosts
+++ b/Completion/Unix/Type/_hosts
@@ -41,9 +41,20 @@ if ! zstyle -a ":completion:${curcontext}:hosts" hosts _hosts; then
for khostfile in $khostfiles; do
if [[ -r $khostfile ]]; then
- khosts=(${${(s:,:)${(j:,:)${(u)${(f)"$(<$khostfile)"}%%[ |#]*}}}:#*[\[\]]*})
+ khosts=(${(s/,/j/,/u)${(f)"$(<$khostfile)"}%%[ |#]*})
+
+ # known_hosts syntax supports the host being in the form [hostname]:port
+ # The filter below extracts the hostname from lines using this format.
+ khosts=($(for host ($khosts); do
+ if [[ $host =~ "\[(.*)\]:\d*" ]]; then
+ echo $match
+ else
+ echo $host
+ fi
+ done))
+
if [[ -z $useip ]]; then
- khosts=(${${${khosts:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)}:#*[\[\]]*})
+ khosts=(${${khosts:#(#s)[0-9]##.[0-9]##.[0-9]##.[0-9]##(#e)}:#(#s)[0-9a-f:]##(#e)})
fi
_cache_hosts+=($khosts)
fi
diff --git a/Config/version.mk b/Config/version.mk
index 9abdcdc01..2b87d1aa9 100644
--- a/Config/version.mk
+++ b/Config/version.mk
@@ -27,5 +27,5 @@
# This must also serve as a shell script, so do not add spaces around the
# `=' signs.
-VERSION=5.0.2-test-3
-VERSION_DATE='December 1, 2013'
+VERSION=5.0.3
+VERSION_DATE='December 14, 2013'
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index b23ce3083..8c7bc85ea 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1113,8 +1113,8 @@ Print the arguments in var(cols) columns. Unless tt(-a) is also given,
arguments are printed with the row incrementing first.
)
item(tt(-D))(
-Treat the arguments as directory names, replacing prefixes with tt(~)
-expressions, as appropriate.
+Treat the arguments as paths, replacing directory prefixes with tt(~)
+expressions corresponding to directory names, as appropriate.
)
item(tt(-i))(
If given together with tt(-o) or tt(-O), sorting is performed
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_svn b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
index 43dedcde9..c2288e421 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn
@@ -7,5 +7,5 @@ setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
-vcs_comm[detect_need_file]="entries format"
+vcs_comm[detect_need_file]="entries format wc.db"
VCS_INFO_bydir_detect '.svn' || return 1
diff --git a/INSTALL b/INSTALL
index f4b09e06a..00791cd86 100644
--- a/INSTALL
+++ b/INSTALL
@@ -13,6 +13,26 @@ instructions in the first.
MAKING AND INSTALLING
=====================
+Dependencies
+------------
+
+The main shell can be compiled with tools available on a typical
+Unix-like system including development packages. However, the
+documentation requires various additional tools that are not so standard:
+
+- YODL, for turning the documentation source files (.yo) into manual
+pages and TeXinfo source for producing PDF and .info formats;
+
+- Perl and interactive manual tools, for turning the zshbuiltins(1)
+manual into help files that can be displayed by the run-help function.
+For example, the colcrt or col tool, not typically required for
+installing software, must be available.
+
+To avoid needing these, the source distribution is supplemented by a
+documentation distribution that may be downloaded from the same place as
+the source. This provides fully generated documentation with references
+to files in the default locations.
+
Check MACHINES File
-------------------
diff --git a/Src/exec.c b/Src/exec.c
index df915e152..dccdc2b0d 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3309,7 +3309,10 @@ execcmd(Estate state, int input, int output, int how, int last1)
}
if (type == WC_SIMPLE) {
if (varspc) {
- addvars(state, varspc, ADDVAR_EXPORT|ADDVAR_RESTRICT);
+ int addflags = ADDVAR_EXPORT|ADDVAR_RESTRICT;
+ if (forked)
+ addflags |= ADDVAR_RESTORE;
+ addvars(state, varspc, addflags);
if (errflag)
_exit(1);
}
diff --git a/Src/init.c b/Src/init.c
index 7032ff8ae..53c4fbd72 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -281,7 +281,7 @@ parseargs(char **argv, char **runscript)
/**/
static void
-parseopts_insert(LinkList optlist, void *base, int optno)
+parseopts_insert(LinkList optlist, char *base, int optno)
{
LinkNode node;
void *ptr = base + (optno < 0 ? -optno : optno);
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index ba7e02cd5..c8320a14d 100644
--- a/Test/A05execution.ztst
+++ b/Test/A05execution.ztst
@@ -179,7 +179,7 @@
0:Status reset by starting a backgrounded command
>0
- setopt MONITOR
+ { setopt MONITOR } 2>/dev/null
[[ -o MONITOR ]] || print -u $ZTST_fd 'Unable to change MONITOR option'
repeat 2048; do (return 2 |
return 1 |
@@ -195,7 +195,7 @@
F:This test checks for a bug in `$pipestatus[]' handling. If it breaks then
F:the bug is still there or it reappeared. See workers-29973 for details.
- setopt MONITOR
+ { setopt MONITOR } 2>/dev/null
externFunc() { awk >/dev/null 2>&1; true; }
false | true | false | true | externFunc
echo $pipestatus
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index e00eb0e9c..d9f219115 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -83,12 +83,13 @@
%prep
mkdir options.tmp && cd options.tmp
- mkdir tmpcd
+ mkdir tmpcd homedir
touch tmpfile1 tmpfile2
mydir=$PWD
mydirt=`print -P %~`
+ mydirhome=`export HOME=$mydir/homedir; print -P %~`
catpath=$(which cat)
lspath==ls
@@ -513,10 +514,10 @@
print *(#q:s/#(#b)tmp(*e)/'scrunchy${match[1]}'/)
unsetopt histsubstpattern
0:HIST_SUBST_PATTERN option
->TINGcd TINGfile1 TINGfile2
+>TINGcd TINGfile1 TINGfile2 homedir
>THUMPcd THUMPfile1 THUMPfile2
>one.c Two.X Three.X
->scrunchyfile1 scrunchyfile2 tmpcd
+>homedir scrunchyfile1 scrunchyfile2 tmpcd
setopt ignorebraces
echo X{a,b}Y
@@ -853,6 +854,7 @@
# Do you have any idea how dull this is?
+ (export HOME=$mydir/homedir
pushd $mydir/tmpcd
pushd
dirs
@@ -863,11 +865,11 @@
popd
pushd
popd
- dirs
+ dirs)
0q:PUSHD_TO_HOME option
->$mydirt $mydirt/tmpcd
->~ $mydirt $mydirt/tmpcd
->$mydirt
+>$mydirhome $mydirhome/tmpcd
+>~ $mydirhome $mydirhome/tmpcd
+>$mydirhome
array=(one two three four)
setopt rcexpandparam
@@ -1067,6 +1069,7 @@
fn2() {
foo3=bar6
}
+ foo4=bar7 =true
}
fn
0:WARN_CREATE_GLOBAL option
diff --git a/Util/helpfiles b/Util/helpfiles
index ebd8bd125..900564842 100755
--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -65,13 +65,40 @@ $ENV{'LANG'} = 'C';
$ENV{'MANWIDTH'} = '80';
$ENV{'GROFF_NO_SGR'} = ''; # We need "classical" formatting of man pages.
-unless(open(MANPAGE, '-|', "man $manfile | colcrt -")) {
- close(MANPAGE);
- open(MANPAGE, '-|', "man $manfile | col -bx")
+$mantmp = $destdir . '/man.tmp';
+$coltmpbase = 'col.tmp';
+$coltmp = $destdir . '/' . $coltmpbase;
+$args = "$manfile >$mantmp";
+unlink($mantmp);
+&Info('attempting man ', $args);
+if(system('man ' . $args) || !(-s $mantmp)) {
+ unlink($mantmp);
+ &Info('attempting nroff -man ', $args);
+ if(system('nroff -man ' . $args) || !(-s $mantmp)) {
+ unlink($mantmp);
+ &Die('man and nroff -man both failed for ', $manfile);
+ }
+}
+$args = "$mantmp >$coltmp";
+unlink($coltmp);
+&Info('attempting colcrt ', $args);
+if(system('colcrt ' . $args) || !(-s $coltmp)) {
+ unlink($coltmp);
+ &Info('attempting col -bx <', $args);
# The x is necessary so that spaces don't turn into tabs, which messes
# up the calculations of indentation on machines which randomly wrap lines
# round to the previous line (so you see what we're up against).
- || &Die('can run neither "man | colcrt -" nor "man | col -bx"');
+ if(system('col -bx <' . $args) || !(-s $coltmp)) {
+ unlink($mantmp);
+ unlink($coltmp);
+ &Die('colcrt and col -bx both failed');
+ }
+}
+unlink($mantmp) || &Die('cannot remove tempfile ', $mantmp);
+
+unless(open(MANPAGE, '<', $coltmp)) {
+ unlink($coltmp);
+ &Die('generated tmpfile cannot be read');
}
unless($linkfile eq '') {
@@ -198,7 +225,8 @@ BUILTINS: while (<MANPAGE>) {
select STDOUT;
close OUT;
-close(MANPAGE) || &Die('piping from man ', $manfile, ' failed');
+close(MANPAGE);
+unlink($coltmpbase) || &Die('cannot remove tempfile ', $coltmpbase);
foreach $file (<*>) {
open (IN, $file);