See Bug#25120.
* src/lread.c (read_integer): Treat incomplete integer literals as errors.
* test/src/lread-tests.el (lread-empty-int-literal): New unit test for
incomplete integer literals.
*p = '\0';
}
- if (! valid)
+ if (valid != 1)
{
sprintf (buf, "integer, radix %"pI"d", radix);
invalid_syntax (buf);
(ert-deftest lread-string-char-name ()
(should (equal (read "\"a\\N{SYLOTI NAGRI LETTER DHO}b\"") "a\uA817b")))
+(ert-deftest lread-empty-int-literal ()
+ "Check that Bug#25120 is fixed."
+ (should-error (read "#b") :type 'invalid-read-syntax)
+ (should-error (read "#o") :type 'invalid-read-syntax)
+ (should-error (read "#x") :type 'invalid-read-syntax)
+ (should-error (read "#24r") :type 'invalid-read-syntax)
+ (should-error (read "#") :type 'invalid-read-syntax))
+
;;; lread-tests.el ends here