summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-03-16 09:50:58 +0800
committerPo Lu <luangruo@yahoo.com>2024-03-16 09:50:58 +0800
commit6461854f47d0b768e0550b46317045811a8cbe80 (patch)
tree15ef9fe31d8bc6de4c214a1686b94e8a4613007b /src
parentbbbf1e6f2d5c93e51e62c33529d3098b1ee46616 (diff)
downloademacs-6461854f47d0b768e0550b46317045811a8cbe80.tar.gz
; Circumvent miscompilations on Sun C 5.12 (148917-07)
* src/minibuf.c (Ftry_completion, Fall_completions): Transform ternary expressions after open-ended if statements into proper if/else statements.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index df6ca7ce1d8..51816133fb2 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1701,11 +1701,12 @@ or from one of the possible completions. */)
tem = Fcommandp (elt, Qnil);
else
{
- tem = (type == hash_table
- ? call2 (predicate, elt,
- HASH_VALUE (XHASH_TABLE (collection),
- idx - 1))
- : call1 (predicate, elt));
+ if (type == hash_table)
+ tem = call2 (predicate, elt,
+ HASH_VALUE (XHASH_TABLE (collection),
+ idx - 1));
+ else
+ tem = call1 (predicate, elt);
}
if (NILP (tem)) continue;
}
@@ -1845,9 +1846,12 @@ with a space are ignored unless STRING itself starts with a space. */)
Lisp_Object allmatches;
if (VECTORP (collection))
collection = check_obarray (collection);
- int type = HASH_TABLE_P (collection) ? 3
- : OBARRAYP (collection) ? 2
- : NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection));
+ int type = (HASH_TABLE_P (collection)
+ ? 3 : (OBARRAYP (collection)
+ ? 2 : ((NILP (collection)
+ || (CONSP (collection)
+ && !FUNCTIONP (collection)))
+ ? 1 : 0)));
ptrdiff_t idx = 0;
Lisp_Object bucket, tem, zero;
@@ -1931,10 +1935,12 @@ with a space are ignored unless STRING itself starts with a space. */)
tem = Fcommandp (elt, Qnil);
else
{
- tem = type == 3
- ? call2 (predicate, elt,
- HASH_VALUE (XHASH_TABLE (collection), idx - 1))
- : call1 (predicate, elt);
+ if (type == 3)
+ tem = call2 (predicate, elt,
+ HASH_VALUE (XHASH_TABLE (collection),
+ idx - 1));
+ else
+ tem = call1 (predicate, elt);
}
if (NILP (tem)) continue;
}