Yayo Razo
c3e38b317d
fix(compat): drop fgetln compat shim, migrate prompt-history.c to getline
...
Following up on the comment on #5365 - this drops fgetln from
prompt-history.c (its only remaining caller) in favor of getline, and
removes the fgetln compat shim entirely since nothing references it
anymore: the compat.h declaration, compat/fgetln.c itself, and its
entry in configure.ac's AC_REPLACE_FUNCS list.
fgetln doesn't null-terminate its returned buffer when the final line
in the file lacks a trailing newline, so the old loop had a second
branch to heap-copy and manually terminate that case. getline always
null-terminates regardless, so that branch goes away and the loop
becomes uniform.
Verified with a real build (ubuntu-24.04 container, same
--enable-utf8proc --enable-asan configure CI uses): crafted a history
file with a normal entry, a blank line, and a final entry with no
trailing newline at EOF (the exact case the removed branch existed
for), loaded it through a real ASan-built tmux via show-prompt-history,
all three entries came back correctly. Full regress suite is otherwise
clean against this change.
2026-07-13 13:03:58 -06:00
Nicholas Marriott
61a7be0eab
Turn off regular expressions when fuzzing because there are cases that take too
...
much time or memory that cannot be fixed.
2026-04-26 21:19:16 +01:00
Nicholas Marriott
478eaea982
Update base64 compat.
2026-02-26 10:55:41 +00:00
Nicholas Marriott
6cc1a607fc
optarg should be "extern char *" not "extern const char *".
2025-05-01 07:53:02 +01:00
Nicholas Marriott
f367e3a6c8
Switch to getopt_long from OpenSSH, from Koichi Murase in GitHub issue 4492.
2025-04-28 09:02:15 +01:00
Nicholas Marriott
f0a85d0469
Move cgroup dbus requests to the child to avoid a race where a spawned child
...
that quickly forks will have only the parent process moved to the newly created
cgroup. From Daniel De Graaf, GitHub issue 4435.
2025-04-14 07:27:02 +01:00
Nicholas Marriott
9e4a9c51cc
Use evbuffer_readline if readln is not available. It doesn't work properly but
...
at least it builds.
2024-11-27 10:37:45 +00:00
Nicholas Marriott
dd4c0109a9
Missing headers for Android, from Biswapriyo Nath.
2024-04-15 09:07:41 +01:00
Nicholas Marriott
84faada25b
Remove existing defines.
2024-01-17 10:59:07 +00:00
Nicholas Marriott
55d0abad89
Need htonll and ntohll.
2024-01-17 10:57:32 +00:00
Nicholas Marriott
b9524f5b72
Add support for spawning panes in separate cgroups with systemd and a configure
...
flag to disable. From Eric T Johnson yut23 AT gvljohnsons DOT com in GitHub
issue 3514.
2023-04-03 08:54:06 +01:00
Nicholas Marriott
5ce34add77
Do not attempt to connect to the socket as a client if systemd is active, from
...
Julien Moutinho in GitHub issue 3345.
2022-10-18 15:58:06 +01:00
Nicholas Marriott
fc7f1e7acb
Add support for systemd socket activation (where systemd creates the Unix
...
domain socket for tmux rather than tmux creating it). Build with
--enable-systemd. From Julien Moutinho in GitHub issue 3119.
2022-03-28 08:42:13 +01:00
Nicholas Marriott
9ed1226a66
Need a declaration for getpeereid also.
2022-03-08 11:04:15 +00:00
Nicholas Marriott
e3d71d9bdf
Add compat clock_gettime for older macOS. GitHub issue 2555.
2021-02-05 11:01:21 +00:00
Nicholas Marriott
a3011be0d2
Look for libevent2 differently from libevent for platforms with both.
2021-01-17 17:21:51 +00:00
Nicholas Marriott
3eb1519bd7
Scaffold for oss-fuzz, from Sergey Nizovtsev.
2020-11-09 16:44:39 +00:00
Nicholas Marriott
72c46aa15e
Add support for Haiku, from David Carlier. GitHub issue 2453.
2020-11-09 09:00:41 +00:00
Nicholas Marriott
680e7a382f
glibc's malloc is very bad about returning memory from the kernel, add a call
...
to its malloc_trim to prompt it to do so. Reported by Sarunas Valaskevicius.
2020-10-06 08:18:42 +01:00
Nicholas Marriott
233d14f4da
Hide warnings due to Apple's stupidity with __dead, reported by Kurtis Rader.
2020-09-04 08:37:11 +01:00
Nicholas Marriott
3a1fc7315c
Add getline compat.
2020-06-18 21:01:55 +01:00
Nicholas Marriott
a48cc458a6
Maybe this is better.
2020-05-22 17:27:07 +01:00
Nicholas Marriott
1fdacba111
Think Solaris needs term.h here.
2020-05-22 17:24:42 +01:00
Nicholas Marriott
6ae26a6b54
Fix utf8proc version logging.
2020-05-22 17:20:35 +01:00
Nicholas Marriott
87a59efc94
Log ncurses and utf8proc versions.
2020-05-22 17:14:35 +01:00
Nicholas Marriott
ec61aa3025
Solaris at least does not have _PATH_VI.
2020-05-01 09:11:56 +01:00
Nicholas Marriott
80f20b8e4e
getopt varies too much between platforms, and we already use compat/getopt.c
...
for Linux so just use it everywhere.
2020-03-17 16:07:06 +00:00
Nicholas Marriott
74b424075c
Use FNM_IGNORECASE if present, from Eric N Vander Weele in GitHub issue 2067.
2020-01-25 16:41:49 +00:00
Nicholas Marriott
3879509426
Define FNM_CASEFOLD to 0 for AIX, from Eric N Vander Weele.
2019-12-16 21:34:36 +00:00
Nicholas Marriott
92ecd611f6
Check each _PATH_* define individually (Solaris has paths.h but not all of the
...
defines). From Eric N Vander Weele.
2019-12-03 18:53:23 +00:00
Nicholas Marriott
9f0904ce6f
Remove unused fparseln compat code.
2019-05-27 14:28:05 +01:00
Nicholas Marriott
3c5d3a3780
Add PATH_DEFPATH to compat.h from Carlo Marcelo Arenas Belón.
2019-04-09 21:31:50 +01:00
Nicholas Marriott
a3967de9a5
Include headers if found regardless of forkpty.
2017-10-11 08:03:31 +01:00
Nicholas Marriott
143ccd27b4
Add memmem to compat.
2017-06-09 08:53:58 +01:00
Nicholas Marriott
b723f50e65
Do not need getopt.h for getopt, from Eric N Vander Weele.
2017-04-20 20:35:11 +01:00
Nicholas Marriott
9420758127
getptmfd() and fdforkpty() compat.
2017-04-20 19:09:07 +01:00
Nicholas Marriott
95c38087db
Missed freezero.
2017-04-19 07:58:45 +01:00
Nicholas Marriott
2e5664d2df
Update imsg*.[ch] from OpenBSD, add some compat bits it needs and remove some
...
bits it doesn't.
2017-03-24 10:05:53 +00:00
Nicholas Marriott
b79df1dc29
Compat code for strndup and strnlen.
2017-03-09 15:43:08 +00:00
Nicholas Marriott
514a723f74
Solaris fixes, mostly from Dagobert Michelsen.
2017-03-09 15:39:13 +00:00
Nicholas Marriott
c54a5d9fb3
Add wchar.h to compat.h, from Koichi Shiraishi.
2017-01-31 12:51:53 +00:00
Nicholas Marriott
3e495b4001
compat/* should not include tmux.h.
2017-01-25 13:49:01 +00:00
Nicholas Marriott
a3d5bfcece
Define away pledge() on !OpenBSD.
2017-01-23 12:27:58 +00:00
Nicholas Marriott
acf331f7f1
Add b64_pton as well.
2017-01-22 19:12:15 +00:00
Nicholas Marriott
e6f7180af1
tmux no longer uses openat() so we can remove the compatibilty function.
2016-10-13 22:17:29 +01:00
Nicholas Marriott
3ed0973493
Solaris build fixes from Rob Paisley.
2016-09-08 15:32:15 +01:00
Nicholas Marriott
6c94774b70
Add support for using utf8proc with --enable-utf8proc, useful for platforms
...
(like OS X) where the system implementation is crap. From Joshua Rubin.
2016-09-01 20:40:03 +01:00
Nicholas Marriott
cfef0c6658
getprogname() and setproctitle() on Linux.
2016-05-27 18:04:25 +01:00
Nicholas Marriott
fe4e9470bb
Add --static to PKG_CONFIG rather than replacing it.
2016-05-05 15:18:58 +01:00
Nicholas Marriott
ca29dc9abc
Update my email address.
2016-01-19 18:07:25 +00:00