about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/prompt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/prompt.c b/Src/prompt.c
index 7f964aad5..5e80da172 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -579,7 +579,7 @@ putpromptchar(int doprint, int endchar)
 		    arg = 1;
 		else if (arg < 0)
 		    arg += arrlen(psvar) + 1;
-		if (arrlen(psvar) >= arg)
+		if (arg > 0 && arrlen(psvar) >= arg)
 		    stradd(psvar[arg - 1]);
 		break;
 	    case 'E':