diff options
| -rw-r--r-- | src/lread.c | 2 | ||||
| -rw-r--r-- | test/src/lread-tests.el | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index fdbf0329118..35348f1ddb8 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2536,7 +2536,7 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix) | |||
| 2536 | *p = '\0'; | 2536 | *p = '\0'; |
| 2537 | } | 2537 | } |
| 2538 | 2538 | ||
| 2539 | if (! valid) | 2539 | if (valid != 1) |
| 2540 | { | 2540 | { |
| 2541 | sprintf (buf, "integer, radix %"pI"d", radix); | 2541 | sprintf (buf, "integer, radix %"pI"d", radix); |
| 2542 | invalid_syntax (buf); | 2542 | invalid_syntax (buf); |
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 1a82d133a44..609f82ec20b 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el | |||
| @@ -104,4 +104,12 @@ | |||
| 104 | (ert-deftest lread-string-char-name () | 104 | (ert-deftest lread-string-char-name () |
| 105 | (should (equal (read "\"a\\N{SYLOTI NAGRI LETTER DHO}b\"") "a\uA817b"))) | 105 | (should (equal (read "\"a\\N{SYLOTI NAGRI LETTER DHO}b\"") "a\uA817b"))) |
| 106 | 106 | ||
| 107 | (ert-deftest lread-empty-int-literal () | ||
| 108 | "Check that Bug#25120 is fixed." | ||
| 109 | (should-error (read "#b") :type 'invalid-read-syntax) | ||
| 110 | (should-error (read "#o") :type 'invalid-read-syntax) | ||
| 111 | (should-error (read "#x") :type 'invalid-read-syntax) | ||
| 112 | (should-error (read "#24r") :type 'invalid-read-syntax) | ||
| 113 | (should-error (read "#") :type 'invalid-read-syntax)) | ||
| 114 | |||
| 107 | ;;; lread-tests.el ends here | 115 | ;;; lread-tests.el ends here |