2023-09-26 14:41:57 +02:00
|
|
|
From 54823555425ffabe31b42672b1894d0e3ff1b018 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@thaodan.de>
|
|
|
|
Date: Fri, 10 Feb 2023 23:31:35 +0200
|
|
|
|
Subject: [PATCH] Allow to override pdmp base
|
2020-08-21 13:01:12 +02:00
|
|
|
|
2022-04-05 08:15:21 +02:00
|
|
|
---
|
2023-09-26 14:41:57 +02:00
|
|
|
src/emacs.c | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
2022-04-05 08:15:21 +02:00
|
|
|
|
2023-09-26 14:41:57 +02:00
|
|
|
diff --git a/src/emacs.c b/src/emacs.c
|
|
|
|
index 687b8c7f81f0..2d6bfe07d813 100644
|
2022-04-05 08:15:21 +02:00
|
|
|
--- src/emacs.c
|
2023-09-26 14:41:57 +02:00
|
|
|
+++ src/emacs.c
|
|
|
|
@@ -920,11 +920,15 @@ load_pdump (int argc, char **argv, char *dump_file)
|
2022-04-05 08:15:21 +02:00
|
|
|
NULL
|
|
|
|
#endif
|
|
|
|
;
|
2020-08-21 13:01:12 +02:00
|
|
|
+#ifdef PDMP_BASE
|
2022-04-05 08:15:21 +02:00
|
|
|
+ const char *argv0_base = PDMP_BASE
|
2020-08-21 13:01:12 +02:00
|
|
|
+#else
|
2022-04-05 08:15:21 +02:00
|
|
|
const char *argv0_base =
|
|
|
|
#ifdef NS_SELF_CONTAINED
|
|
|
|
"Emacs"
|
|
|
|
#else
|
|
|
|
"emacs"
|
2020-08-21 13:01:12 +02:00
|
|
|
+#endif
|
2023-08-07 10:20:19 +02:00
|
|
|
#endif
|
2023-09-26 14:41:57 +02:00
|
|
|
;
|
2023-08-07 10:20:19 +02:00
|
|
|
|
2023-09-26 14:41:57 +02:00
|
|
|
@@ -1065,7 +1069,11 @@ load_pdump (int argc, char **argv, char *dump_file)
|
|
|
|
if (IS_DIRECTORY_SEP (*p))
|
|
|
|
last_sep = p;
|
|
|
|
}
|
2023-08-07 10:20:19 +02:00
|
|
|
+#ifdef PDMP_BASE
|
2023-09-26 14:41:57 +02:00
|
|
|
+ argv0_base = PDMP_BASE;
|
|
|
|
+#else
|
|
|
|
argv0_base = last_sep ? last_sep + 1 : argv[0];
|
2023-08-07 10:20:19 +02:00
|
|
|
+#endif
|
2023-09-26 14:41:57 +02:00
|
|
|
ptrdiff_t needed = (strlen (path_exec)
|
|
|
|
+ 1
|
|
|
|
+ strlen (argv0_base)
|