summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-04-07 12:20:45 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-04-07 12:39:49 +0200
commitf2ae2badff37c008ba8217a12f8ee6dc6a3c5a39 (patch)
treebeabb5400cc490e50bae9f776868f2bfe9172783 /lib
parent06edbb67ed807811654e7fd8f0f9b83766430216 (diff)
Main: Add local option
Add option that changes default paths for config file and control socket to the current working directory.
Diffstat (limited to 'lib')
-rw-r--r--lib/string.h6
1 files changed, 6 insertions, 0 deletions
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