From 79eb4385bd34e8ee06b35637f092ee45dc3e3706 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 14 Mar 2026 09:31:51 +0200 Subject: dfm: Add privilege escalation. Pressing 'Z' (default) will spawn a nested dfm by escalating privileges using the value of DFM_SU (default 'sudo'). Pressing 'Z' again inside of this escalated mode returns to the original dfm. --- lib/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/util.h') diff --git a/lib/util.h b/lib/util.h index 9a69746..1eeb8dd 100644 --- a/lib/util.h +++ b/lib/util.h @@ -336,5 +336,14 @@ path_resolve(char *s, usize l) return w; } +static inline const char * +basename_l(const char *s, usize l) +{ + for (usize i = l; i; i--) + if (s[i - 1] == '/') + return s + i; + return s; +} + #endif // DYLAN_UTIL_H -- cgit v1.2.3