about summary refs log tree commit diff
path: root/Src/cond.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-09-16 00:00:28 +0200
committerOliver Kiddle <opk@zsh.org>2016-09-16 00:00:28 +0200
commitfbafc5b509e311efee064bbd12396a2e207f3393 (patch)
tree9fdf8f236fb1d25b54079e81cf75bf05eeca0b26 /Src/cond.c
parent00708285e94ce42a31fd59bbcd06d010a6d0d6ee (diff)
downloadzsh-fbafc5b509e311efee064bbd12396a2e207f3393.tar.gz
zsh-fbafc5b509e311efee064bbd12396a2e207f3393.tar.xz
zsh-fbafc5b509e311efee064bbd12396a2e207f3393.zip
39332: support ksh's [[ -v varname ]] condition for checking if variables are set
Diffstat (limited to 'Src/cond.c')
-rw-r--r--Src/cond.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Src/cond.c b/Src/cond.c
index f25ebd4a3..42e9de30f 100644
--- a/Src/cond.c
+++ b/Src/cond.c
@@ -351,6 +351,8 @@ evalcond(Estate state, char *fromtest)
 	return (!S_ISSOCK(dostat(left)));
     case 'u':
 	return (!(dostat(left) & S_ISUID));
+    case 'v':
+	return (!issetvar(left));
     case 'w':
 	return (!doaccess(left, W_OK));
     case 'x':