about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/prompt.yo2
-rw-r--r--Src/prompt.c6
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 77551ef16..295ceb67d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-24  Peter Stephenson  <pws@csr.com>
+
+	* 25242: Mikael: Doc/Zsh/prompt.yo, Src/prompt.c: add V prompt
+	test for contents of psvar.
+
 2008-06-23  Peter Stephenson  <pws@csr.com>
 
 	* 25237: Doc/Zsh/tcpsys.yo, Functions/TCP/tcp_open: make
diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo
index d5177346a..54dc3f609 100644
--- a/Doc/Zsh/prompt.yo
+++ b/Doc/Zsh/prompt.yo
@@ -274,6 +274,8 @@ sitem(tt(S))(True if the tt(SECONDS) parameter is at least var(n).)
 sitem(tt(T))(True if the time in hours is equal to var(n).)
 sitem(tt(t))(True if the time in minutes is equal to var(n).)
 sitem(tt(v))(True if the array tt(psvar) has at least var(n) elements.)
+sitem(tt(V))(True if element var(n) of the array tt(psvar) is set and
+non-empty.)
 sitem(tt(w))(True if the day of the week is equal to var(n) (Sunday = 0).)
 endsitem()
 )
diff --git a/Src/prompt.c b/Src/prompt.c
index 034a4fa29..72ba2e244 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -321,6 +321,12 @@ putpromptchar(int doprint, int endchar, unsigned int *txtchangep)
 		    if (arrlen(psvar) >= arg)
 			test = 1;
 		    break;
+		case 'V':
+		    if (arrlen(psvar) >= arg) {
+			if (*psvar[(arg ? arg : 1) - 1])
+			    test = 1;
+		    }
+		    break;
 		case '_':
 		    test = (cmdsp >= arg);
 		    break;