ladybird/Ports/kakoune/patches/0001-Use-proc-self-exe-on-SerenityOS.patch
2022-10-14 13:37:29 +02:00

25 lines
798 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: demostanis <demostanis@protonmail.com>
Date: Sat, 10 Sep 2022 20:19:23 +0200
Subject: [PATCH] Use /proc/self/exe on SerenityOS
---
src/file.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/file.cc b/src/file.cc
index d38c956..9c74364 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -603,7 +603,7 @@ FsStatus get_fs_status(StringView filename)
String get_kak_binary_path()
{
char buffer[2048];
-#if defined(__linux__) or defined(__CYGWIN__) or defined(__gnu_hurd__)
+#if defined(__linux__) or defined(__CYGWIN__) or defined(__gnu_hurd__) or defined(__serenity__)
ssize_t res = readlink("/proc/self/exe", buffer, 2048);
kak_assert(res != -1);
buffer[res] = '\0';
--
2.37.3