diff --git a/input.cpp b/input.cpp
index 3b135cf19..1367c88ea 100644
--- a/input.cpp
+++ b/input.cpp
@@ -710,7 +710,7 @@ wint_t input_readch()
             {
                 case R_EOF: /* If it's closed, then just return */
                 {
-                    return WEOF;
+                    return R_EOF;
                 }
                 case R_SELF_INSERT:
                 {