Skip to content

Commit

Permalink
Fix APE uname direction
Browse files Browse the repository at this point in the history
Fixes #942
  • Loading branch information
jart committed Nov 10, 2023
1 parent d2f49ca commit 3d3cdcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ape/ape.S
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,9 @@ ape_disk:

#ifdef APE_IS_SHELL_SCRIPT
apesh: .ascii "\n@\n#'\"\n" // sixth edition shebang
.ascii "m=\"$(/bin/uname -m >/dev/null)\" || "
.ascii "m=\"$(/usr/bin/uname -m)\"\n"
.ascii "m=$(/bin/uname -m 2>/dev/null) || "
.ascii "m=$(/usr/bin/uname -m 2>/dev/null) || "
.ascii "m=x86_64\n"

.ascii "if [ \"$m\" = x86_64 ] || [ \"$m\" = amd64 ]; then\n"
// Until all operating systems can be updated to support APE,
Expand Down
5 changes: 3 additions & 2 deletions tool/build/apelink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,8 +1944,9 @@ int main(int argc, char *argv[]) {
}

// otherwise this is a fresh install so consider the platform
p = stpcpy(p, "m=\"$(/bin/uname -m >/dev/null)\" || "
"m=\"$(/usr/bin/uname -m)\"\n");
p = stpcpy(p, "m=$(/bin/uname -m 2>/dev/null) || "
"m=$(/usr/bin/uname -m 2>/dev/null) || "
"m=x86_64\n");
if (support_vector & _HOSTXNU) {
p = stpcpy(p, "if [ ! -d /Applications ]; then\n");
}
Expand Down

0 comments on commit 3d3cdcf

Please sign in to comment.