From f2ae2badff37c008ba8217a12f8ee6dc6a3c5a39 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 7 Apr 2016 12:20:45 +0200 Subject: Main: Add local option Add option that changes default paths for config file and control socket to the current working directory. --- lib/string.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/string.h b/lib/string.h index 218f7b1c..0f249d37 100644 --- a/lib/string.h +++ b/lib/string.h @@ -24,4 +24,10 @@ void buffer_puts(buffer *buf, const char *str); int patmatch(const byte *pat, const byte *str); +static inline char *xbasename(const char *str) +{ + char *s = strrchr(str, '/'); + return s ? s+1 : (char *) str; +} + #endif -- cgit v1.2.3