Mercurial > hg > xemacs-beta
comparison src/data.c @ 5905:85fd1ab80057
Fix a bug in #'parse-integer with negative bignums and non-nil JUNK-ALLOWED
src/ChangeLog addition:
2015-05-08 Aidan Kehoe <kehoea@parhasard.net>
* data.c (parse_integer):
Fix a bug here with the interaction of negative bignums and a
non-zero JUNK-ALLOWED argument.
tests/ChangeLog addition:
2015-05-08 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Check for a bug just fixed with the interaction of negative
bignums and :junk-allowed non-nil.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Fri, 08 May 2015 16:24:57 +0100 |
parents | 5afddd952c46 |
children | 6174848f3e6c |
comparison
equal
deleted
inserted
replaced
5904:ee27ca517e90 | 5905:85fd1ab80057 |
---|---|
1897 | 1897 |
1898 #ifdef HAVE_BIGNUM | 1898 #ifdef HAVE_BIGNUM |
1899 if (!NILP (result)) | 1899 if (!NILP (result)) |
1900 { | 1900 { |
1901 /* Bignum terminated by whitespace or by non-digit. */ | 1901 /* Bignum terminated by whitespace or by non-digit. */ |
1902 return Fcanonicalize_number (result); | 1902 if (negativland) |
1903 { | |
1904 bignum_set_long (scratch_bignum, -1L); | |
1905 bignum_mul (XBIGNUM_DATA (result), XBIGNUM_DATA (result), | |
1906 scratch_bignum); | |
1907 } | |
1908 return result; | |
1903 } | 1909 } |
1904 #endif | 1910 #endif |
1905 | 1911 |
1906 if (onum == (EMACS_UINT) -1) | 1912 if (onum == (EMACS_UINT) -1) |
1907 { | 1913 { |