diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2026-03-14 09:31:51 +0200 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2026-03-14 09:31:51 +0200 |
| commit | 79eb4385bd34e8ee06b35637f092ee45dc3e3706 (patch) | |
| tree | 4c3de5583733e9c9cfdc7b5f31a56f8d2ba205ba /lib | |
| parent | f3416de0e2fd920dda7379c3b7dc2b3087cc30c6 (diff) | |
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.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |