diff --git a/src/rcfile.c b/src/rcfile.c index 1b1b5d3..17899aa 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -400,7 +400,9 @@ void parse_binding(char *ptr, bool dobind) else if (keycopy[0] != '^' && keycopy[0] != 'M' && keycopy[0] != 'F') { rcfile_error(N_("Key name must begin with \"^\", \"M\", or \"F\"")); goto free_copy; - } else if (keycopy[0] == '^' && (keycopy[1] < 64 || keycopy[1] > 127)) { + } else if ((keycopy[0] == '^' && (keycopy[1] < 64 || keycopy[1] > 127)) + || (strcmp(keycopy, "^Space") && strcmp(keycopy, "M-Space") + && strlen(keycopy) > 2)) { rcfile_error(N_("Key name %s is invalid"), keycopy); goto free_copy; }