about summary refs log tree commit diff
path: root/seq.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 14:07:46 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 14:10:47 +0200
commit6aad1db77c7e6d9d639d1419871fb69dff7ca56d (patch)
tree90aefe324b0bd98584536174a15b62a793c6c2f3 /seq.c
parentdc4670141859e03d860ea968d7827498581eb867 (diff)
downloadmblaze-6aad1db77c7e6d9d639d1419871fb69dff7ca56d.tar.gz
mblaze-6aad1db77c7e6d9d639d1419871fb69dff7ca56d.tar.xz
mblaze-6aad1db77c7e6d9d639d1419871fb69dff7ca56d.zip
seq: export blaze822_home_file
Diffstat (limited to 'seq.c')
-rw-r--r--seq.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/seq.c b/seq.c
index a2648bf..55dfd32 100644
--- a/seq.c
+++ b/seq.c
@@ -15,8 +15,8 @@
 #include "blaze822.h"
 #include "blaze822_priv.h"
 
-static char *
-homefile(char *suffix)
+char *
+blaze822_home_file(char *basename)
 {
 	static char path[PATH_MAX];
 	static char *homedir;
@@ -26,7 +26,7 @@ homefile(char *suffix)
 	if (!homedir)
 		homedir = getpwuid(getuid())->pw_dir;
 
-	snprintf(path, sizeof path, "%s/%s", homedir, suffix);
+	snprintf(path, sizeof path, "%s/%s", homedir, basename);
 
 	return path;
 }
@@ -41,7 +41,7 @@ blaze822_seq_open(char *file)
 	if (!file)
 		file = getenv("MAILMAP");
 	if (!file)
-		file = homefile(".santoku/map");
+		file = blaze822_home_file(".santoku/map");
 	fd = open(file, O_RDONLY);
 	if (!fd)
 		return 0;
@@ -126,7 +126,7 @@ blaze822_seq_cur()
 
 	char *curlink = getenv("MAILCUR");
 	if (!curlink)
-		curlink = homefile(".santoku/cur");
+		curlink = blaze822_home_file(".santoku/cur");
 
 	int r = readlink(curlink, b, sizeof b - 1);
 	if (r < 0)
@@ -141,7 +141,7 @@ blaze822_seq_setcur(char *s)
 	char curtmplink[PATH_MAX];
 	char *curlink = getenv("MAILCUR");
 	if (!curlink)
-		curlink = homefile(".santoku/cur");
+		curlink = blaze822_home_file(".santoku/cur");
 
 	if (snprintf(curtmplink, sizeof curtmplink, "%s-", curlink) >= PATH_MAX)
 		return -1;  // truncation