1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-26 19:18:50 +00:00

Revert overenthusiastic procfs fixup

Also, be more systematic in calls to string_to_number.
* src/sysdep.c (list_system_processes) [HAVE_PROCFS]: Allow pids
to be floating-point if they exceed fixnum range.  This partially
reverts my patch 2018-03-09T20:06:05Z!eggert@cs.ucla.edu, which
went too far in fixing string-to-number mishandling.
This commit is contained in:
Paul Eggert 2018-03-12 10:35:25 -07:00
parent 0965d94ca4
commit e067f1fd9f
5 changed files with 6 additions and 10 deletions

View File

@ -2754,7 +2754,7 @@ If the base used is not 10, STRING is always parsed as an integer. */)
while (*p == ' ' || *p == '\t')
p++;
val = string_to_number (p, b, 1);
val = string_to_number (p, b, true);
return NILP (val) ? make_number (0) : val;
}

View File

@ -2693,7 +2693,7 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
invalid_syntax (buf);
}
return string_to_number (buf, radix, 0);
return string_to_number (buf, radix, false);
}
@ -3502,7 +3502,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
if (!quoted && !uninterned_symbol)
{
Lisp_Object result = string_to_number (read_buffer, 10, 0);
Lisp_Object result = string_to_number (read_buffer, 10, false);
if (! NILP (result))
return unbind_to (count, result);
}

View File

@ -6844,7 +6844,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
if (NILP (tem))
{
Lisp_Object process_number
= string_to_number (SSDATA (process), 10, 1);
= string_to_number (SSDATA (process), 10, true);
if (NUMBERP (process_number))
tem = process_number;
}

View File

@ -3006,11 +3006,7 @@ list_system_processes (void)
for (tail = proclist; CONSP (tail); tail = next)
{
next = XCDR (tail);
Lisp_Object pidstring = XCAR (tail);
Lisp_Object pid = Fstring_to_number (pidstring, Qnil);
if (!INTEGERP (pid) || XINT (pid) <= 0)
xsignal1 (Qoverflow_error, pidstring);
XSETCAR (tail, pid);
XSETCAR (tail, Fstring_to_number (XCAR (tail), Qnil));
}
/* directory_files_internal returns the files in reverse order; undo

View File

@ -3392,7 +3392,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
value = Qunspecified;
else if (EQ (attr, QCheight))
{
value = Fstring_to_number (value, make_number (10));
value = Fstring_to_number (value, Qnil);
if (!INTEGERP (value) || XINT (value) <= 0)
signal_error ("Invalid face height from X resource", value);
}