aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-03-12 10:35:25 -0700
committerPaul Eggert2018-03-12 10:37:05 -0700
commite067f1fd9feabc9c83cfbba177616a46b28d058a (patch)
treeed584ec923078e1bd3d8ed66ca8df93a3475f022
parent0965d94ca426765382f366bf48f88ba5f9500afd (diff)
downloademacs-e067f1fd9feabc9c83cfbba177616a46b28d058a.tar.gz
emacs-e067f1fd9feabc9c83cfbba177616a46b28d058a.zip
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.
-rw-r--r--src/data.c2
-rw-r--r--src/lread.c4
-rw-r--r--src/process.c2
-rw-r--r--src/sysdep.c6
-rw-r--r--src/xfaces.c2
5 files changed, 6 insertions, 10 deletions
diff --git a/src/data.c b/src/data.c
index 62b3fcfeb24..06308c62c49 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2754,7 +2754,7 @@ If the base used is not 10, STRING is always parsed as an integer. */)
2754 while (*p == ' ' || *p == '\t') 2754 while (*p == ' ' || *p == '\t')
2755 p++; 2755 p++;
2756 2756
2757 val = string_to_number (p, b, 1); 2757 val = string_to_number (p, b, true);
2758 return NILP (val) ? make_number (0) : val; 2758 return NILP (val) ? make_number (0) : val;
2759} 2759}
2760 2760
diff --git a/src/lread.c b/src/lread.c
index 0ea7677300b..381f9cf20c5 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2693,7 +2693,7 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
2693 invalid_syntax (buf); 2693 invalid_syntax (buf);
2694 } 2694 }
2695 2695
2696 return string_to_number (buf, radix, 0); 2696 return string_to_number (buf, radix, false);
2697} 2697}
2698 2698
2699 2699
@@ -3502,7 +3502,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3502 3502
3503 if (!quoted && !uninterned_symbol) 3503 if (!quoted && !uninterned_symbol)
3504 { 3504 {
3505 Lisp_Object result = string_to_number (read_buffer, 10, 0); 3505 Lisp_Object result = string_to_number (read_buffer, 10, false);
3506 if (! NILP (result)) 3506 if (! NILP (result))
3507 return unbind_to (count, result); 3507 return unbind_to (count, result);
3508 } 3508 }
diff --git a/src/process.c b/src/process.c
index 9b9b9f35503..11d914aab24 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6844,7 +6844,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
6844 if (NILP (tem)) 6844 if (NILP (tem))
6845 { 6845 {
6846 Lisp_Object process_number 6846 Lisp_Object process_number
6847 = string_to_number (SSDATA (process), 10, 1); 6847 = string_to_number (SSDATA (process), 10, true);
6848 if (NUMBERP (process_number)) 6848 if (NUMBERP (process_number))
6849 tem = process_number; 6849 tem = process_number;
6850 } 6850 }
diff --git a/src/sysdep.c b/src/sysdep.c
index 1eaf648ea78..c59034ce5c3 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -3006,11 +3006,7 @@ list_system_processes (void)
3006 for (tail = proclist; CONSP (tail); tail = next) 3006 for (tail = proclist; CONSP (tail); tail = next)
3007 { 3007 {
3008 next = XCDR (tail); 3008 next = XCDR (tail);
3009 Lisp_Object pidstring = XCAR (tail); 3009 XSETCAR (tail, Fstring_to_number (XCAR (tail), Qnil));
3010 Lisp_Object pid = Fstring_to_number (pidstring, Qnil);
3011 if (!INTEGERP (pid) || XINT (pid) <= 0)
3012 xsignal1 (Qoverflow_error, pidstring);
3013 XSETCAR (tail, pid);
3014 } 3010 }
3015 3011
3016 /* directory_files_internal returns the files in reverse order; undo 3012 /* directory_files_internal returns the files in reverse order; undo
diff --git a/src/xfaces.c b/src/xfaces.c
index 56df06574a7..a9c2f37e9f2 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3392,7 +3392,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
3392 value = Qunspecified; 3392 value = Qunspecified;
3393 else if (EQ (attr, QCheight)) 3393 else if (EQ (attr, QCheight))
3394 { 3394 {
3395 value = Fstring_to_number (value, make_number (10)); 3395 value = Fstring_to_number (value, Qnil);
3396 if (!INTEGERP (value) || XINT (value) <= 0) 3396 if (!INTEGERP (value) || XINT (value) <= 0)
3397 signal_error ("Invalid face height from X resource", value); 3397 signal_error ("Invalid face height from X resource", value);
3398 } 3398 }