From e36d5d4fa270f156c6426fd4df58ba7bb7895c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 14:11:24 -0500 Subject: [PATCH] Make ape-m1 not die on realpath error The loader was dying after the first PATH component if the command was not found. :( --- ape/ape-m1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ape/ape-m1.c b/ape/ape-m1.c index 0b5860e5c..5b544f502 100644 --- a/ape/ape-m1.c +++ b/ape/ape-m1.c @@ -325,10 +325,11 @@ static char AccessCommand(struct PathSearcher *ps, unsigned long pathlen) { memmove(ps->path + pathlen, ps->name, ps->namelen); ps->path[pathlen + ps->namelen] = 0; if (!realpath(ps->path, buf)) { - Pexit(ps->path, -errno, "realpath"); + return 0; } if ((n = strlen(buf)) >= sizeof(ps->path)) { - Pexit(buf, 0, "too long"); + Perror(buf, 0, "too long"); + return 0; } memcpy(ps->path, buf, n + 1); if (!access(ps->path, X_OK)) {