diff --git a/ChangeLog b/ChangeLog
index c453aee84..e08cafd30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-30 Peter Stephenson
+
+ * 39777: Src/parse.c, Test/D08cmdsubst.ztst: $() is a valid
+ empty command substitution.
+
2016-10-29 Barton E. Schaefer
* 39758: Src/builtin.c, Src/params.c: revise 39704 to output
diff --git a/Src/parse.c b/Src/parse.c
index 24b8cd97f..50a0d5f9f 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -594,7 +594,7 @@ par_event(int endtok)
if (tok == ENDINPUT)
return 0;
if (tok == endtok)
- return 0;
+ return 1;
p = ecadd(0);
diff --git a/Test/D08cmdsubst.ztst b/Test/D08cmdsubst.ztst
index 89e725966..362537349 100644
--- a/Test/D08cmdsubst.ztst
+++ b/Test/D08cmdsubst.ztst
@@ -153,3 +153,17 @@
eval 'foo echo this just works, OK\?)'
0:backtracking within command string parsing with alias still pending
>this just works, OK?
+
+ (
+ set errexit
+ show_nargs() { print $#; }
+ print a $() b
+ print c "$()" d
+ )
+0:Empty $() is a valid empty substitution.
+>a b
+>c d
+
+ empty=$() && print "'$empty'"
+0:Empty $() is a valid assignment
+>''