summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-02-08 11:49:28 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-02-08 11:49:28 +0000
commit4a0ddedf0af0bbd22530132df830b588b2b63220 (patch)
treeff240f0b690eeb65ad4cc579518ff584c86038d1
parentb8d5ad137c4a9d11155588b07e6454e49a3e322d (diff)
downloadzsh-4a0ddedf0af0bbd22530132df830b588b2b63220.tar.gz
zsh-4a0ddedf0af0bbd22530132df830b588b2b63220.zip
unposted: a couple of typeset -g's and a comment
-rw-r--r--ChangeLog9
-rw-r--r--Completion/compinit2
-rw-r--r--Functions/Calendar/calendar_scandate5
-rw-r--r--Src/subst.c5
4 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 36bec02fd..992bbcb71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-02-08 Peter Stephenson <pws@csr.com>
+ * unposte: Src/subst.c: comment about what colon in parameter
+ substitution might be doing.
+
+ * unposted: Completion/compinit,
+ Functions/Calendar/calendar_scandate: add some "typeset -g"s
+ to avoid WARN_CREATE_GLOBAL warnings.
+
* 27665: Frank: Completion/Unix/Command/_tmux: update.
* 27658: Completion/Unix/Command/_zip: work around globbing
@@ -12700,5 +12707,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4886 $
+* $Revision: 1.4887 $
*****************************************************
diff --git a/Completion/compinit b/Completion/compinit
index 1e4b7acef..d85ff072e 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -440,7 +440,7 @@ Ignore insecure $_i_q and continue [y] or abort compinit [n]? "; then
(( $#_i_wdirs )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wdirs%.zwc})/*}" )
fi
fi
- _comp_secure=yes
+ typeset -g _comp_secure=yes
fi
fi
diff --git a/Functions/Calendar/calendar_scandate b/Functions/Calendar/calendar_scandate
index fd8eb1133..4ae2ae606 100644
--- a/Functions/Calendar/calendar_scandate
+++ b/Functions/Calendar/calendar_scandate
@@ -720,8 +720,9 @@ if (( relative )); then
fi
# relative_start is zero if we're not using it
(( reladd += (hour * 60 + minute) * 60 + second ))
+ typeset -g REPLY
(( REPLY = relative_start + reladd ))
- [[ -n $setvar ]] && REPLY2=$line
+ [[ -n $setvar ]] && typeset -g REPLY2="$line"
return 0
fi
return 1
@@ -747,6 +748,6 @@ fi
strftime -s REPLY -r $fmt $nums
-[[ -n $setvar ]] && REPLY2=$line
+[[ -n $setvar ]] && typeset -g REPLY2="$line"
return 0
diff --git a/Src/subst.c b/Src/subst.c
index 0bb0b798f..462d0b3a0 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2356,6 +2356,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
if (!(flags & (SUB_MATCH|SUB_REST|SUB_BIND|SUB_EIND|SUB_LEN)))
flags |= SUB_REST;
+ /*
+ * With ":" treat a value as unset if the variable is set but
+ * - (array) contains no elements
+ * - (scalar) contains an empty string
+ */
if (colf && !vunset)
vunset = (isarr) ? !*aval : !*val || (*val == Nularg && !val[1]);